Haskell: type inference and function composition

后端 未结 2 1245
我寻月下人不归
我寻月下人不归 2020-12-31 06:12

This question was inspired by this answer to another question, indicating that you can remove every occurrence of an element from a list using a function defined as:

2条回答
  •  醉梦人生
    2020-12-31 06:43

    It is also worth noting that if you don't assign a name to the expression, typechecker seems to avoid type defaulting:

    Prelude> :t filter . (/=)
    filter . (/=) :: (Eq a) => a -> [a] -> [a]
    

提交回复
热议问题