more
This commit is contained in:
parent
0a7e277873
commit
90c5785d68
3 changed files with 31 additions and 0 deletions
14
LinkedList.hs
Normal file
14
LinkedList.hs
Normal 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"
|
||||
Loading…
Add table
Add a link
Reference in a new issue