Revision 22, 0.6 kB
(checked in by naoya_t, 17 years ago)
|
2008-03-04 08:09
|
Line | |
---|
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] |
---|
11 | |
---|
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 |
---|
18 | |
---|
19 | firstNLines n cs = unlines $ take n $ lines cs |
---|
20 | |
---|
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] |
---|
25 | |
---|
26 | fib 0 = 0 |
---|
27 | fib 1 = 1 |
---|
28 | fib n = fib (n-1) + fib (n-2) |
---|
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 |
---|