mirror of
https://git8.cs.fau.de/theses/bsc-leon-vatthauer.git
synced 2024-05-31 07:28:34 +02:00
12 lines
208 B
Haskell
12 lines
208 B
Haskell
hd :: [a] -> a
|
|
hd [] = error "empty list"
|
|
hd (x : _) = x
|
|
|
|
main :: IO ()
|
|
main = print (hd []::[String])
|
|
|
|
reverse :: [a] -> [a]
|
|
reverse l = rev l []
|
|
where
|
|
rev [] a = a
|
|
rev (x:xs) a = rev xs (x:a)
|