Anonymous user
CUSIP: Difference between revisions
m
→{{header|Haskell}}: allMaybe is just sequence
m (→{{header|Haskell}}: allMaybe is just sequence) |
|||
Line 1,414:
data Result = Valid | BadCheck | TooLong | TooShort | InvalidContent deriving Show
-- convert a list of Maybe to a Maybe list.
-- result is Nothing if any of values from the original list are Nothing
allMaybe :: [Maybe a] -> Maybe [a]
allMaybe =
toValue :: Char -> Maybe Int
|