Last active
November 14, 2018 10:46
-
-
Save kuribas/684fc5b6d610f96cc19a9e6232e6cf97 to your computer and use it in GitHub Desktop.
forall in type
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| {-# LANGUAGE RankNTypes #-} | |
| module Test where | |
| type MyType a = forall m. Monad m => m a | |
| test :: MyType Int | |
| test = pure 3 | |
| x :: IO Int | |
| x = test |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| {-# LANGUAGE RankNTypes, FlexibleContexts #-} | |
| module Test where | |
| import Control.Monad.Reader | |
| type MyType a b = forall m. MonadReader b m => m a | |
| test :: MyType Int Int | |
| test = pure 3 | |
| x :: Int -> Int | |
| x = test |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment