Created
August 5, 2016 01:31
-
-
Save sleexyz/5d4a754ecc447157f81a9a3d73f4dbfc 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
-- How do we make a tuple that's functorial over the first parameter? | |
-- We can't! | |
data Tup a b = Tup a b | |
instance Functor (Tup a) where | |
fmap f (Tup x y) = Tup x (f y) | |
instance Functor (Tup a) where | |
fmap f (Tup x y) = Tup x (f y) | |
-- -- Invalid Haskell, unfortunately: | |
-- instance Functor (\a -> (a,b)) where | |
-- fmap f (x,y) = (f x, y) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment