Help for this page

Select Code to Download


  1. or download this
    import System
    
    ...
            putStrLn ( show cc ++ " chars " )
            putStrLn ( show w  ++ " words " )
            putStrLn ( show lc ++ " lines." )
    
  2. or download this
     
    C:\ghc\test>wc 60sp2l.txt
    wc: interrupted
    ...
    Heap exhausted;
    Current maximum heap size is 268435456 bytes (256 Mb);
    use `+RTS -M<size>' to increase it.
    
  3. or download this
    wcf :: ( Int, Int, Int ) -> String -> ( Int, Int, Int )
    wcf ( cc, w, lc ) []                        =    ( cc,   w,   lc   )
    ...
            putStrLn ( show lc ++ " lines." )
    
    main = wc
    
  4. or download this
    C:\ghc\test>ghc -o wc.exe wc.hs
    
    wc.hs:9:8: Parse error in pattern
    
  5. or download this
    Rectangle s1 s2 `containsS` (x,y) =
        let t1 = s1 / 2
            t2 = s2 / 2
        in -t1<=x && x<=t1 && -t2<=y && t2<=t2