Skip to content

Instantly share code, notes, and snippets.

@luqui
Created September 20, 2013 17:18
Show Gist options
  • Save luqui/6640808 to your computer and use it in GitHub Desktop.
Save luqui/6640808 to your computer and use it in GitHub Desktop.
{-# 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