[Haskell-cafe] Monad instance for partially applied type constructor?

Christopher Done chrisdone at googlemail.com
Wed Sep 29 14:52:21 EDT 2010


On 29 September 2010 20:48, Ryan Ingram <ryani.spam at gmail.com> wrote:
> But it doesn't let you partially apply the type synonym.
>
> On the other hand, if you did this:
>
> newtype Compose f g a = O { unO :: f (g a) }
> type Poly k = Compose (Vect k) Monomial
>
> instance Monad (Poly k) where ...
>
> would work, but now you have to wrap/unwrap Compose in the instance definition.

LiberalTypeSynonyms lets you partially apply type synonyms.


More information about the Haskell-Cafe mailing list