Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

makeSem doesn't work well with effects with "pure type" arguments #339

Open
googleson78 opened this issue May 1, 2020 · 2 comments
Open
Labels
enhancement New feature or request polish make the libary joyful t use

Comments

@googleson78
Copy link
Member

googleson78 commented May 1, 2020

With a declaration like this:

-- intended to always be used with a type application
data Eff m a where
  Stuff :: forall ty. Int -> Eff m (F ty)

type family F ty where
  ...

makeSem generates non-compiling declarations.
I'm guessing it generates something like this:

stuff :: forall ty r. Member Eff r => Int -> Sem r (F ty)
stuff x = send $ Stuff x

but ghc can't figure out that the ty from the forall is the one I want to use for ty in the Stuff invocation.

Instead we need something like this:

stuff :: forall ty r. Member Eff r => Int -> Sem r (F ty)
stuff x = send $ Stuff @ty x

but who knows if this breaks something else :/

@bolt12
Copy link
Contributor

bolt12 commented May 1, 2020 via email

@googleson78
Copy link
Member Author

@bolt12 Yes, that's what I'm doing for the time being

@TheMatten TheMatten added enhancement New feature or request polish make the libary joyful t use labels Jun 21, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request polish make the libary joyful t use
Projects
None yet
Development

No branches or pull requests

3 participants