Haskell function composition operator of type (c→d) → (a→b→c) → (a→b→d)

后端 未结 6 681
耶瑟儿~
耶瑟儿~ 2020-11-28 04:21

Ordinary function composition is of the type

(.) :: (b -> c) -> (a -> b) -> a -> c

I figure this should generalize to types

6条回答
  •  醉话见心
    2020-11-28 04:23

    I don't know of a standard library function that does this, but the point-free pattern that accomplishes it is to compose the composition function:

    (.) . (.) :: (b -> c) -> (a -> a1 -> b) -> a -> a1 -> c
    

提交回复
热议问题