haskell-random/LinkedList.hs
joachimschmidt557 90c5785d68 more
2020-01-19 12:33:18 +01:00

14 lines
275 B
Haskell

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"