[Haskell-beginners] Bool newtype
imantc at gmail.com
Sun Aug 7 21:12:26 UTC 2016
Thank you Theodore.
Could you hint the name of the package, please? Does it coerce safely?
If Coercible does not type check, another option could be to define a class
and a function that works similar to if statement, constrained to instances
of this class.
class Newtype_base nt base where
base_t::nt -> base
if_::Newtype_base nt Bool =>
nt -> then -> else
Standard if is clearer of course but with a few newtypes being passed
around, this may save some key strokes.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Beginners