Show
Ignore:
Files:
1 modified

Legend:

Unmodified
Added
Removed
  • hh2008/naoya_t/trunk/test.hs

    r22 r18  
    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] 
     1main = putStrLn "Hello, World!" 
    112 
    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 
     3-- main = do { cs <- getContents ; print $ length $ lines cs } 
    184 
    195firstNLines n cs = unlines $ take n $ lines cs 
    206 
    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] 
     7-- main = print $ 5 + 2 * 5 
     8rmain = print $ tail [1,2,3] 
     9-- main = tail [1,2,3] 
     10 
     11tail [1,2,3] 
     12print [1,2,3,4] 
    2513 
    2614fib 0 = 0 
     
    2816fib n = fib (n-1) + fib (n-2) 
    2917 
    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