Created
October 7, 2018 12:14
-
-
Save tonymorris/57b39f039786af4ee94d046bd6c0a0c7 to your computer and use it in GitHub Desktop.
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
data ToInt a = ToInt (a -> Int) | |
instance Functor ToInt where | |
-- note, f :: a -> b; g :: a -> Int, and the todo :: b -> Int | |
fmap f (ToInt g) = ToInt (error "todo") | |
class Contravariant f where | |
contramap :: (b -> a) -> f a -> f b | |
instance Contravariant ToInt where | |
-- note, f :: b -> a, g :: a -> Int, and the todo :: b -> Int | |
contramap f (ToInt g) = ToInt (error "todo") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment