summaryrefslogblamecommitdiff
path: root/1-10/2.hs
blob: baeb99583383da8f298a80b6b8bc67c1a4e6219d (plain) (tree)
1
2
3
4



                                                
myButLast [] = error "empty list"
myButLast [x] = error "list with single element"
myButLast (x:[y]) = x
myButLast (x:xs) = myButLast xs