This file contains 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
In https://github.com/ekmett/lens/wiki/Derivation, we see some types for | |
composition of compositions: (.).(.), (.).(.).(.), and so on. Let's prove that | |
the type of (.).(.) is (a -> b) -> (c -> d -> a) -> c -> d -> b, as stated in | |
the site. We'll stick with prefix notation, meaning that we want the type of | |
(.)(.)(.). | |
Recall the type of composition. This should be intuitive: | |
(.) :: (b -> c) -> (a -> b) -> a -> c [1] |