[Haskell-beginners] mapping over newtypes

Tim Baumgartner baumgartner.tim at googlemail.com
Wed Dec 15 22:37:02 CET 2010


Hello Haskellers,

I defined

newtype Banana = Banana Something

When I work with it, I sometimes use a function

mapBanana f (Banana b) = Banana (f b)

which is of course discarded by the compiler. Is this usual practice
or are there any better solutions?

Regards
Tim



More information about the Beginners mailing list