>>> listToMaybe [] Nothing
>>> listToMaybe [9] Just 9
>>> listToMaybe [1,2,3] Just 1Composing maybeToList with listToMaybe should be the identity on singleton/empty lists:
>>> maybeToList $ listToMaybe [5] [5] >>> maybeToList $ listToMaybe [] []But not on lists with more than one element:
>>> maybeToList $ listToMaybe [1,2,3] [1]