Created
July 18, 2014 07:49
-
-
Save Shimuuar/c221e1f8e98c49d0adc7 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
-- Trick for expressing contexts like (∀ a. Binary a => Binary (f a)) | |
-- | |
-- This type class says that if we have dictionary for data type `a' we can | |
-- construct dictionary for `f a' or equivalently that if `a' is instance of | |
-- Binary `f a' is instance too. | |
class Binary2 f where | |
binaryDict :: BinaryDict a -> BinaryDict (f a) | |
data BinaryDict a where | |
BinaryDict :: Binary a => BinaryDict a |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment