int-index / ether

Monad Transformers and Classes
https://int-index.github.io/ether/
BSD 3-Clause "New" or "Revised" License
78 stars 7 forks source link

Allow types of any kind as tags #15

Closed ElvishJerricco closed 8 years ago

ElvishJerricco commented 8 years ago

I'm writing a library that abstracts over some f :: * -> *, and f makes the most sensible type for the tag. Attempting to use f as the tag for, say, MonadState, results in a type error. Simple example:

class MyClass s f where
  myMethod :: MonadState f s m => f a -> m a

Granted, in this case, I can just use f () as the tag instead of f, but I don't fee like that's a real solution. It would be nice if I could just use f on its own, and manually pass Proxy :: Proxy f to the StateT methods.

int-index commented 8 years ago

Try with the latest version! :)

Poly-kinded tags are one of the features in Ether 0.4 (install via Stackage nightly).

ElvishJerricco commented 8 years ago

Oh cool! My bad, forgot to check my version.

ElvishJerricco commented 8 years ago

Yep, works just fine! Thanks!

int-index commented 8 years ago

Great!