Created
June 30, 2021 23:02
-
-
Save phadej/16f97f32fbbc40e8374fd38f4f115c7a to your computer and use it in GitHub Desktop.
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
| data Mokhov2 f g a where | |
| Mokhov2 :: (x -> Either a (y -> a)) -> f x -> g y -> Mokhov2 f g a | |
| toMokhov2 :: Mokhov f g a -> Mokhov2 f g a | |
| toMokhov2 (x :<*?: y) = Mokhov2 f y x where | |
| f :: (x -> a) -> Either a (Either x a -> a) | |
| f xa = Right $ either xa id | |
| fromMokhov2 :: (Functor f, Functor g) => Mokhov2 f g a -> Mokhov f g a | |
| fromMokhov2 (Mokhov2 f x y) = | |
| fmap Left y | |
| :<*?: | |
| fmap (\x' y' -> either id ($ y') (f x')) x |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment