Created
October 7, 2025 14:04
-
-
Save chrisdone-artificial/2a0b5b46d89abea939a136e1aec25f2c to your computer and use it in GitHub Desktop.
T1 wrapper
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
| newtype T1 t a = T1 { unT1 :: forall e. t e a } | |
| deriving instance (forall e. Functor (t e)) => Functor (T1 t) | |
| instance (forall e. Applicative (Either e)) => Applicative (T1 Either) where | |
| pure x = T1 (pure x) | |
| (<*>) f x = T1 (unT1 f <*> unT1 x) | |
| instance (forall e. Monad (Either e)) => Monad (T1 Either) where | |
| (>>=) m f = T1 (unT1 m >>= unT1 . f) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment