Last active
May 30, 2022 22:04
-
-
Save kindaro/344107a20ff340fa1dbdc07fb7d28633 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 UnicodeSyntax #-} | |
import Data.Functor | |
import Control.Monad | |
f₁ = (putStrLn "f₁" $>) | |
f₂ = (putStrLn "f₂" $>) | |
g₁ = (putStrLn "g₁" $>) | |
g₂ = (putStrLn "g₂" $>) | |
main = do | |
r₁ ← (f₁ ⊗ g₁ >=> f₂ ⊗ g₂) (True, False) | |
print r₁ | |
r₂ ← ((f₁ >=> f₂) ⊗ (g₁ >=> g₂)) (True, False) | |
print r₂ | |
f ⊗ g = \ (x, y) → do | |
x' ← f x | |
y' ← g y | |
pure (x', y') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment