Last active
May 5, 2020 11:00
-
-
Save tim2CF/b6f7be262c4b4e7c26e60550f405c787 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 MultiParamTypeClasses #-} | |
-- Am I reinventing the wheel? | |
-- Is there some standard Haskell type class which is already doing similar things? | |
module P88LND.Isomorphism | |
( Isomorphism (..), | |
Foo (..), | |
) | |
where | |
class Isomorphism a b where | |
l2r :: a -> b | |
r2l :: b -> a | |
data Foo = Bar | Buz | |
instance Isomorphism Bool Foo where | |
l2r True = Bar | |
l2r False = Buz | |
r2l Bar = True | |
r2l Buz = False |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment