Using Maybe type in Haskell
I'm trying to utilize the Maybe type in Haskell. I have a lookup for key, value tuples that returns a Maybe. How do I access the data that was wrapped by Maybe? For example I want to add the integer contained by Maybe with another integer. Alternatively you can pattern match: case maybeValue of Just value -> ... Nothing -> ... arsenm You could use Data.Maybe.fromMaybe , which takes a Maybe a and a value to use if it is Nothing . You could use the unsafe Data.Maybe.fromJust , which will just crash if the value is Nothing . You likely want to keep things in Maybe . If you wanted to add an