Skip to content

Instantly share code, notes, and snippets.

@dredozubov
Created September 30, 2016 09:31
Show Gist options
  • Save dredozubov/81337aeaffe2aa77195cc6227d214f21 to your computer and use it in GitHub Desktop.
Save dredozubov/81337aeaffe2aa77195cc6227d214f21 to your computer and use it in GitHub Desktop.
printf :: ((String -> IO ()) -> a) -> a
printf format = format putStrLn
c :: String -> (String -> a) -> a
c s k = k s
d :: (String -> a) -> Int -> a
d k n = k $ show n
s :: (String -> a) -> String -> a
s = id
(%) :: ((String -> a) -> r) -> ((String -> b) -> a) -> ((String -> b) -> r)
f1 % f2 = \k -> f1 $ \s1 -> f2 $ \s2 -> k $ s1 ++ s2
zu :: IO ()
zu = printf (c"hello, "%d%s) 1337 "world!"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment