Skip to content

Commit e7b9f86

Browse files
committed
solve ex02 chapter 3
1 parent 5371e56 commit e7b9f86

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

ch03/32.hs

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
{-
2+
- Write down definitions that have the following types;
3+
- it does not matter what the definitions actually do
4+
- as long as they are type correct.
5+
-
6+
- bools :: [Bool]
7+
- nums :: [[Int]]
8+
- add :: Int -> Int -> Int -> Int
9+
- copy :: a -> (a,a)
10+
- apply :: (a -> b) -> a -> b
11+
-}
12+
13+
bools = [False, True]
14+
15+
nums = [[1 :: Int, 2 :: Int]]
16+
17+
add x y z = (x :: Int) + (y :: Int) + (z :: Int)
18+
19+
copy a = (a, a)
20+
21+
apply a b = a(b)

0 commit comments

Comments
 (0)