root/hh2008/naoya_t/trunk/test.hs @ 58

Revision 22, 0.6 kB (checked in by naoya_t, 17 years ago)

2008-03-04 08:09

Line 
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]
11
12print if 1 then '@' else '*'
13-- if c == '\t' then '@' else c
14\num -> num * num
15\x -> x
163 + 4
174 * 5 - 1
18
19firstNLines n cs = unlines $ take n $ lines cs
20
21f1 = do { cs <- getContents ; print $ length $ lines cs }
22f2 = print $ 5 + 2 * 5
23f3 = print $ tail [1,2,3]
24f4 = tail [1,2,3]
25
26fib 0 = 0
27fib 1 = 1
28fib n = fib (n-1) + fib (n-2)
29
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
Note: See TracBrowser for help on using the browser.