her.esy.fun/src/posts/0010-Haskell-Now/monad_composition.hs

10 lines
144 B
Haskell
Raw Normal View History

2019-12-26 16:27:19 +00:00
import Control.Monad ((>=>))
f :: Int -> [Int]
f n = [n, n+1]
g :: Int -> [String]
g n = [show n,">"++show (n+1)]
main = print $ (f >=> g) 2