Created
December 2, 2017 21:37
-
-
Save int-index/e9b018a5f7f1313416903a12065161e3 to your computer and use it in GitHub Desktop.
Bistrength
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
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