Provide a fallback for a given Maybe. Behaves like a logical or:
if the maybe value is a Just, returns that maybe; otherwise,
returns the defaultMaybe value.
This is useful when you want to make sure that something which takes a Maybe
always ends up getting a Just variant, by supplying a default value for the
case that you currently have a nothing.
Provide a fallback for a given
Maybe
. Behaves like a logicalor
: if themaybe
value is aJust
, returns thatmaybe
; otherwise, returns thedefaultMaybe
value.This is useful when you want to make sure that something which takes a
Maybe
always ends up getting aJust
variant, by supplying a default value for the case that you currently have a nothing.