mirror of
https://github.com/iritmaximus/haskell.git
synced 2026-10-12 19:13:39 +03:00
4b done
This commit is contained in:
+3
-1
@@ -124,5 +124,7 @@ headHelper x (Just a) = Just x
|
||||
myLast :: [a] -> Maybe a
|
||||
myLast xs = foldr lastHelper Nothing xs
|
||||
|
||||
lastHelper = todo
|
||||
lastHelper x acc = case acc of
|
||||
Nothing -> Just x
|
||||
Just a -> Just a
|
||||
|
||||
|
||||
Reference in New Issue
Block a user