Created
June 17, 2020 13:20
-
-
Save specdrake/3786683c98a0b01855de2a54961a947b 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
f1 = (<$> ((:[]) <$>)) | |
f1 :: (Functor f) => (f [a] -> b) -> f a -> b | |
:: (Functor f) => (f [a] -> b) -> (f a -> b) | |
(=<<) :: (Monad m) => (a -> m b) -> m a -> m b | |
:: (Monad m) => (a -> m b) -> (m a -> m b) | |
-- Applying f1 to (=<<) | |
f = f1 (=<<) | |
f :: (a -> b) -> [a] -> [b] | |
:: (a -> b) -> ([a] -> [b]) | |
-- Matching type of `(=<<)` with (f [a] -> b) | |
f [a] -> b | |
(e -> [a]) -> b -- as f ~ (e ->) | |
(a -> m b) -> (m a -> m b) | |
(a -> [b]) -> ([a] -> [b]) | |
(e -> [a]) -> ([e] -> [a]) | |
-- so b ~ ([e] -> [a]) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment