[ create a new paste ] login | about

Link: http://codepad.org/aGIKi8dF    [ raw code | output | fork ]

Haskell, pasted on May 10:
1
2
3
4
5
compo :: ([a] -> b) -> [([a] -> a)] -> [a] -> b
compo f gs xs = f (map ($ xs) gs)

main = do
   print $ compo sum [head, last] [1,2,3]


Output:
1
4


Create a new paste based on this one


Comments: