parent
3e886a6c0c
commit
8382832f42
@ -0,0 +1,28 @@ |
|||||||
|
|
||||||
|
type Name = String |
||||||
|
type Table = [ (Name, Name) ] |
||||||
|
|
||||||
|
fathers :: Table |
||||||
|
fathers = [ |
||||||
|
("a", "d"), |
||||||
|
("b", "r") |
||||||
|
] |
||||||
|
|
||||||
|
head' :: [a] -> a |
||||||
|
head' (x:xs) = x |
||||||
|
|
||||||
|
|
||||||
|
helper :: Integer -> [a] -> Integer |
||||||
|
helper acc (x:xs) = helper (acc + 1) xs |
||||||
|
helper acc ([]) = acc |
||||||
|
|
||||||
|
len' :: [a] -> Integer |
||||||
|
len' xs = helper 0 xs |
||||||
|
|
||||||
|
|
||||||
|
inv :: [a] -> [a] |
||||||
|
inv _ = _ |
||||||
|
|
||||||
|
|
||||||
|
getF :: Name -> Maybe Name |
||||||
|
getF n = lookup n fathers |
Loading…
Reference in new issue