Created
December 6, 2017 14:17
-
-
Save dminuoso/e8eeccee5177708d0a1de82ece4cd5c1 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
combine1 :: (a -> a) -> State [a] () | |
combine1 op = do | |
a <- pop | |
push $ op a | |
combine2 :: (a -> a -> a) -> State [a] () | |
combine2 op = do | |
a <- pop | |
b <- pop | |
push op a b | |
combine3 :: (a -> a -> a -> a) -> State [a] () | |
combine3 op = do | |
a <- pop | |
b <- pop | |
c <- pop | |
push $ op a b c | |
combine4 :: (a -> a -> a -> a -> a) -> State [a] () | |
combine4 op = do | |
a <- pop | |
b <- pop | |
c <- pop | |
d <- pop | |
push $ op a b c d |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment