This commit is contained in:
Aaro Koivukangas
2025-12-22 21:40:56 +02:00
parent 465a2b4803
commit 9545dd72e9
+3 -1
View File
@@ -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