Last active
October 28, 2019 16:32
-
-
Save friedbrice/d0e94b9e81ee1436a0f21da7913a511c 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 FlexibleInstances, OverloadedStrings #-} | |
import Data.Function ((&)) | |
import Data.String (IsString) | |
data X | |
data Y | |
data Z | |
data M a | |
instance Eq Y | |
instance IsString Y | |
instance Eq Z | |
instance IsString Z | |
instance Eq (X -> Z) | |
instance IsString (X -> Z) | |
instance Functor M | |
instance Applicative M | |
instance Monad M | |
instance Eq (M Y) | |
instance IsString (M Y) | |
f = undefined | |
g = undefined | |
p = undefined | |
x = undefined | |
xs = undefined | |
fs = undefined | |
f :: X -> Y | |
g :: Y -> Z | |
p :: X -> M Y | |
x :: X | |
xs :: M X | |
fs :: M (X -> Y) | |
pronounce = | |
let | |
"f of x" = f $ x | |
"g of the f of x" = g . f $ x | |
"g of the f" = g . f | |
"x into f" = x & f | |
"f mapped over xs" = f <$> xs | |
"p bind xs" = p =<< xs | |
"xs processed by p" = xs >>= p | |
"fs join xs" = fs <*> xs | |
in | |
pronounce |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment