3 ms·
This is actually possible with the ConstraintKinds extension in GHC. type Mappable = Functor type NotScaryFluffyThing = Monad This makes Mappable a sy
by DanWaterworth 12y ago
This is actually possible with the ConstraintKinds extension in GHC.
type Mappable = Functor
type NotScaryFluffyThing = Monad
This makes Mappable a synonym for Functor and likewise for Monad. (This is not necessarily a good idea; it goes against the principle of least surprise, but it'll work).
- TazeTSchnitzel 12y agoIsn't aliasing types a core language feature?
- lclarkmichalek 12y agoFunctor and Monad are technically not types but type classes (i.e. interface vs an implementing class), hence why simple/naive type aliasing is not enough.
- AnimalMuppet 12y agoMy code definitely needs more NotScaryFluffyThings in it.