Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jchia/afe04a4d21e2538a758c38999e80b379 to your computer and use it in GitHub Desktop.
Save jchia/afe04a4d21e2538a758c38999e80b379 to your computer and use it in GitHub Desktop.
class Isomorphic a b where
convert :: a -> b
data Unit = Unit deriving Generic
data Three a b c = A a | B b | C c deriving Generic
data Foo a b = Foo a b deriving Generic
data MyBool = MyFalse | MyTrue deriving Generic
instance Isomorphic (Either () (Either [(Int, Bool)] Char))
(Three Unit [Foo (Identity Int) MyBool] Char)
instance Isomorphic (a, b) (Foo a b)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment