We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
type ContT :: k -> (k -> Type) -> Type -> Type instance MonadCont (ContT @Type r m)
The MonadCont instance for ContT is unnecessarily restricted to types when it can be polykinded
ContT
instance MonadCont (ContT @k r m) where callCC :: ((a -> ContT r m b) -> ContT r m a) -> ContT r m a callCC cont = ContT \c -> runContT (cont \x -> ContT \ _ -> c x) c
This allows deriving
type Term :: S -> (S -> Type) -> Type type ContTerm :: S -> Type -> Type newtype ContTerm s a = ContTerm ((a -> Term s r) -> Term s r) deriving (Functor, Applicative, Monad, MonadCont) via ContT @S r (Term s)
The kind of ContT should also be made specifiable: forall k. k -> (k -> Type) -> Type -> Type rather than inferrable forall {k}. .. as it is now.
forall k. k -> (k -> Type) -> Type -> Type
forall {k}. ..
The text was updated successfully, but these errors were encountered:
I don't object to making MonadCont have more polykinded instances.
MonadCont
Sorry, something went wrong.
This seems like a good idea.
Are there any downsides to making this change? I cannot think of any obvious ones at least.
No branches or pull requests
The MonadCont instance for
ContT
is unnecessarily restricted to types when it can be polykindedThis allows deriving
The kind of
ContT
should also be made specifiable:forall k. k -> (k -> Type) -> Type -> Type
rather than inferrableforall {k}. ..
as it is now.The text was updated successfully, but these errors were encountered: