Changes in hh2008/naoya_t/trunk/test.hs [18:22]
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
hh2008/naoya_t/trunk/test.hs
r18 r22 1 main = putStrLn "Hello, World!" 1 "Hello, World!" 2 putStrLn "Hello, World!" 3 5 * 6 - 7 4 print $ 5 * 6 - 7 5 \x -> x * x $ 5 * 6 - 7 6 print $ \x -> x * x $ 5 * 6 - 7 7 [1,2,3,4] 8 print [1,2,3,4] 9 tail [1,2,3] 10 print $ tail [1,2,3] 2 11 3 -- main = do { cs <- getContents ; print $ length $ lines cs } 12 print if 1 then '@' else '*' 13 -- if c == '\t' then '@' else c 14 \num -> num * num 15 \x -> x 16 3 + 4 17 4 * 5 - 1 4 18 5 19 firstNLines n cs = unlines $ take n $ lines cs 6 20 7 -- main = print $ 5 + 2 * 5 8 rmain = print $ tail [1,2,3] 9 -- main = tail [1,2,3] 10 11 tail [1,2,3] 12 print [1,2,3,4] 21 f1 = do { cs <- getContents ; print $ length $ lines cs } 22 f2 = print $ 5 + 2 * 5 23 f3 = print $ tail [1,2,3] 24 f4 = tail [1,2,3] 13 25 14 26 fib 0 = 0 … … 16 28 fib n = fib (n-1) + fib (n-2) 17 29 30 square n = n * n 31 triple a = a + a + a 32 33 main = putStrLn "Hello, World!" 34 35 main = print $ 5 * 6 - 7 36 -- main = print $ \x -> x * x $ 5 * 6 - 7