I suggest to include this operator in "Data.Maybe" and "Prelude".Implementation:(?:) :: Maybe a -> a -> amaybeA ?: b = fromMaybe b maybeAUse cases:1.maybeValue ?: error "Value is unexpectedly empty. This is a bug."instead offromMaybe (error "Value is unexpectedly empty. This is a bug.") maybeValue2.maybeA ?: maybeB ?: cinstead offromMaybe (fromMaybe c maybeB) maybeAName collisions:Hayoo search gives only 6 collisions with 5 hardly fundamental libraries.* The nickname and the operator itself are inspired by the ones from Groovy language.** The symbols of the operator are a reminder of plain old ternary construct.*** To understand the nickname look at the operator as on emoticon.
_______________________________________________
Libraries mailing list
Libraries@haskell.org
http://www.haskell.org/mailman/listinfo/libraries