Skip to content

Instantly share code, notes, and snippets.

@masaeedu
Last active August 25, 2019 06:37
Show Gist options
  • Save masaeedu/55221d2ba17002adffc4e4c69b89e507 to your computer and use it in GitHub Desktop.
Save masaeedu/55221d2ba17002adffc4e4c69b89e507 to your computer and use it in GitHub Desktop.
failing at contramapping entailment
type Whatever
(c :: k -> Constraint)
(f :: k -> *)
(v :: k)
= forall x. (c v => f v -> x) -> x
class Everything (a :: k)
instance Everything a
foo :: (forall x. (cb b => x) -> (ca a => x), f b -> f a) -> (ca a => f a) -> (cb b => f b)
foo (cba,
-- type family Append (a :: k -> Constraint) (b :: k -> Constraint) :: k -> Constraint
-- where
-- Append f g =
-- instance (a x, b x) => Both a b (a
-- foo :: Whatever (MonadError String) Monad a -> Whatever Everything Everything (Either String a)
-- foo ma cb = cb $ ma runExceptT
test :: Monad m => ExceptT e m a -> m (Either e a)
test = runExceptT
-- interpretReader scroll = flip runReaderT scroll
--
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment