This commit is contained in:
joachimschmidt557 2020-01-19 12:33:18 +01:00
parent 0a7e277873
commit 90c5785d68
3 changed files with 31 additions and 0 deletions

14
LinkedList.hs Normal file
View file

@ -0,0 +1,14 @@
data LinkedList a = Empty | Cons a (LinkedList a)
cons :: a -> LinkedList a -> LinkedList a
cons elem list = Cons elem list
first :: LinkedList a -> Maybe a
first Empty = Nothing
first (Cons first _) = Just first
main :: IO ()
main =
let
a = Empty
in print "asdf"