Haskell Function Signature
Haskell
filter :: (a -> Bool) -> [a] -> [a]
This is saying:
filter
is the identifier of a function.::
is the type annotation.(a -> Bool)
is the first argument.a
means it can be any type. So this is saying: a function that takes an argument of typea
and return aBoolean
.->
is the type separator.[a]
is the second argument. A list of elements of typea
.->
another type separator, this time the return type offilter
.[a]
means a list of typea
.