-
-
Notifications
You must be signed in to change notification settings - Fork 82
New extra combinator: generalised 'readMaybe' #161
Copy link
Copy link
Open
Labels
enhancementNew feature or requestNew feature or requestnewBring something new into library (add function or type or interface)Bring something new into library (add function or type or interface)questionFurther information is requestedFurther information is requestedreexportReexport something newReexport something new
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or requestnewBring something new into library (add function or type or interface)Bring something new into library (add function or type or interface)questionFurther information is requestedFurther information is requestedreexportReexport something newReexport something new
readMaybeis implemented like this:There's a lot of other types that it would be useful to generalize this to. Here's two ideas I've had:
Both of those are the same as
readMaybewhenf ~ Maybe. The first is useful for custom error monads to preserve whether the problem was "no parse" or "ambiguous parse". The second is useful forMaybeTand lots of other things that have some sort of failure state.