Skip to content

Instantly share code, notes, and snippets.

@Kiwi
Forked from tonymorris/c.hs
Created April 17, 2019 06:12
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 Kiwi/2fb7c8ad23d9310d437c6311db534096 to your computer and use it in GitHub Desktop.
Save Kiwi/2fb7c8ad23d9310d437c6311db534096 to your computer and use it in GitHub Desktop.
cancelUnit ::
Iso (a, ()) (b, ()) a b
cancelUnit =
iso
(\(a, ()) -> a)
(\b -> (b, ()))
cancelVoid ::
Iso (Either a Void) (Either b Void) a b
cancelVoid =
dimap (either id absurd) (fmap Left)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment