Skip to content

Instantly share code, notes, and snippets.

@jutememo
Created October 14, 2009 02:25
Show Gist options
  • Save jutememo/209730 to your computer and use it in GitHub Desktop.
Save jutememo/209730 to your computer and use it in GitHub Desktop.
module Mainbak01_00 where
import Stack
comb :: (Stack a -> (a, Stack a))
-> (Stack a -> (a, Stack a))
-> Stack a -> (a, Stack a)
comb m n = \stack0 ->
let (_, stack1) = m stack0
(x, stack2) = n stack1
in (x, stack2)
main = do
print $ comb pop pop $ s
print $ comb (comb pop pop) pop $ s
print $ pop `comb` pop `comb` pop $ s
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment