-- | The main entry point.
init' :: [a] -> Maybe [a]
init' [] = Nothing
init' [x] = Just []
init' (x:xs) = Just (x: (init' xs))
main = print . init' $ [1,2,3]
and now I see this error message
src/Main.hs@5:26-5:34
Couldn't match expected type
[a]
with actual type ‘Maybe [a]’
Relevant bindings include xs :: [a] (bound at
/home/app/isolation-runner-work/projects/112785/session.207/src/src/Main.hs:5:10)
x :: a (bound at
/home/app/isolation-runner-work/projects/112785/session.207/src/src/Main.hs:5:8)
init' :: [a] -> Maybe [a] (bound at
/home/app/isolation-runner-work/projects/112785/session.207/src/src/Main.hs:3:1) …
Dit e-mailbericht is gecontroleerd op virussen met Avast antivirussoftware.
www.avast.com