4 lines
125 B
Haskell
4 lines
125 B
Haskell
myButLast :: [a] -> a
|
|
myButLast [] = error "List length less than 2"
|
|
myButLast [a, _] = a
|
|
myButLast (hd : tl) = myButLast tl
|