Created
September 20, 2013 17:18
-
-
Save luqui/6640808 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
{-# LANGUAGE ConstraintKinds, MultiParamTypeClasses, FunctionalDependencies #-} | |
class FromCon k a | a -> k where | |
convert :: k b => b -> a | |
instance FromCon Integral Integer where | |
convert = fromIntegral | |
foo :: Integer | |
foo = convert 4 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment