Show
Ignore:
Files:
1 modified

Legend:

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

    r18 r22  
    1 main = putStrLn "Hello, World!" 
     1"Hello, World!" 
     2putStrLn "Hello, World!" 
     35 * 6 - 7 
     4print $ 5 * 6 - 7 
     5\x -> x * x $ 5 * 6 - 7 
     6print $ \x -> x * x $ 5 * 6 - 7 
     7[1,2,3,4] 
     8print [1,2,3,4] 
     9tail [1,2,3] 
     10print $ tail [1,2,3] 
    211 
    3 -- main = do { cs <- getContents ; print $ length $ lines cs } 
     12print if 1 then '@' else '*' 
     13-- if c == '\t' then '@' else c 
     14\num -> num * num 
     15\x -> x 
     163 + 4 
     174 * 5 - 1 
    418 
    519firstNLines n cs = unlines $ take n $ lines cs 
    620 
    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] 
     21f1 = do { cs <- getContents ; print $ length $ lines cs } 
     22f2 = print $ 5 + 2 * 5 
     23f3 = print $ tail [1,2,3] 
     24f4 = tail [1,2,3] 
    1325 
    1426fib 0 = 0 
     
    1628fib n = fib (n-1) + fib (n-2) 
    1729 
     30square n = n * n 
     31triple a = a + a + a 
     32 
     33main = putStrLn "Hello, World!" 
     34 
     35main = print $ 5 * 6 - 7 
     36-- main = print $ \x -> x * x $ 5 * 6 - 7