Created
September 14, 2026 11:52
-
-
Save LSLeary/304d5b06d88b99c19752be6bc36679b2 to your computer and use it in GitHub Desktop.
Type annotated composition arrows!
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 RequiredTypeArguments #-} | |
| module AnnotatedArrows ( | |
| (<--<), (>--), | |
| (--<), (>-->), | |
| ) where | |
| infixr 9 <--<, >-- | |
| (<--<) :: (b -> c) -> (a -> b) -> a -> c | |
| (<--<) = (.) | |
| (>--) :: forall b -> (a -> b) -> a -> b | |
| _ >-- f = f | |
| _test_l :: Bool -> Int | |
| _test_l = (*2) <--<Int>-- fromEnum <--<Bool>-- not | |
| infixr 9 --<, >--> | |
| (--<) :: (a -> b) -> (b -> c) -> a -> c | |
| (--<) = flip (.) | |
| (>-->) :: forall a -> (a -> b) -> (a -> b) | |
| _ >--> g = g | |
| _test_r :: Int -> Bool | |
| _test_r = (*2) --<Int>--> toEnum --<Bool>--> not |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment