Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- myMinimum :: Ord a => [a] -> Maybe a
- myMinimum [] = Nothing
- myMinimum (x:xs) = Just (myMinimum' (x:xs))
- where myMinimum' (x:[]) = x
- myMinimum' (x:xs) = myMinimum' ((min x (head xs)):(tail xs))
Add Comment
Please, Sign In to add comment