The composition of functions in a list of functions!

后端 未结 5 2004
灰色年华
灰色年华 2020-12-31 20:47

I need to define a function \'Compose\' which takes a list \'L\' which is a list of functions. When I specify a parameter that will suit all the functions in the list, the l

5条回答
  •  一生所求
    2020-12-31 21:40

    in haskell:

    compose :: a -> [a -> a] -> a
    compose a (x:xs) = x (compose a xs)
    compose a [] = a
    

提交回复
热议问题