Skip to content

Instantly share code, notes, and snippets.

@int-index
Created December 2, 2017 21:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save int-index/e9b018a5f7f1313416903a12065161e3 to your computer and use it in GitHub Desktop.
Save int-index/e9b018a5f7f1313416903a12065161e3 to your computer and use it in GitHub Desktop.
Bistrength
class Bistrength g where
bistrength :: Bifunctor f => g (f a b) -> f (g a) (g b)
instance Bistrength ((,) x) where
bistrength (x, f) = bimap (x,) (x,) f
instance Bistrength ((,,) x y) where
bistrength (x, y, f) = bimap (x,y,) (x,y,) f
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment