
8 Aug
2013
8 Aug
'13
3:40 a.m.
Some minor nitpicking: IMHO, the naming is inconsistent with respect to the existing functions:
listToMaybe :: [a] -> Maybe a maybeToList :: Maybe a -> [a]
In these two cases, '[lL]ist' and '[mM]aybe' both denote types, whereas in '{left,right}ToMaybe', 'left' is a constructor and 'Maybe' is a type. However, I have no better naming alternative to offer.
The names 'leftToMaybe' and 'rightToMaybe' could also be slightly irritating, because reading the name 'leftToMaybe' might provoke the question: and what happens for the 'Right' case. I would prefer the names 'left' and 'right', but If the name clash with 'Control.Arrow' is an issue, than perhaps 'maybeLeft' and 'maybeRight'. Greetings, Daniel