Created
January 20, 2016 23:43
-
-
Save wangbj/c5cc58bd3e5a62b37119 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
showIntBase2 = reverse . concatMap show . un | |
where un = unfoldr go | |
go = uncurry (*>) . (&&&) (guard . (>0)) (Just . swap . (`quotRem` 2)) | |
-- > showIntBase2 12 | |
-- "1100" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
apply2 f g h x = f (g x) (h x) ==>
apply2' f g h = uncurry f . (&&&) g h
sequenceT2 (a, b) = a >> b ~=
uncurry (>>)
or
uncurry (*>)