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
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.
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.