Last active
April 26, 2020 23:08
-
-
Save MarcelineVQ/49222f9789d8026bc9206365a5749d0e to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| data Identity a = MkId a | |
| (>>=) : Identity a -> (a -> Identity b) -> Identity b | |
| (>>=) (MkId x) f = f x | |
| pure : a -> Identity a | |
| pure = MkId | |
| foo : Int -> Identity Balance | |
| foo i = do | |
| False <- pure (i > 1) | |
| | True => pure RightHeavy | |
| False <- pure (i == 1) | |
| | True => pure RightLean | |
| False <- pure (i == -1) | |
| | True => pure LeftLean | |
| False <- pure (i < -1) | |
| | True => pure LeftHeavy | |
| pure Neutral |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment