Higher Order Functions
Functions like map, filter and foldr are also called higher order functions, becuase they take a function as their argument. A higher order function takes a function as its argument or/and returns a function as it’s result.
Here are some more examples of such functions.
apply :: forall a b. (a -> b) -> a -> b
apply f x = f x
compose :: forall a b. (b -> c) -> (a -> b) -> a -> c
compose g f x = g (f x)
当前内容版权归 hamler-lang 或其关联方所有,如需对内容或内容相关联开源项目进行关注与资助,请访问 hamler-lang .