if i do any isUpper "asBsd"
, i'll get True
.
here, the second element to any
is a string.
but, if i do this:
any ("1" `isInfixOf`) ["qas","123","=-0"]
the second element to any
is a list of strings.
how and why this difference between those 2 functions?
another example.
if i write filter isUpper "asdVdf"
, i'll get "V"
.
here, the second element to filter, is a string.
but, if i write this:
filter (isUpper . head) ["abc","Vdh","12"]
, i'll get ["Vdh"]
.
as you can see, the second element to filter is now a list of strings.
why there is a differences and how haskell know's it's right in both cases?
to summarize it:
i don't understand how in the same function, one time haskell get a second element that is a string, and in other time, haskell get a list of strings, in the second element.
one time it happened in any
function, and the other time in filter
function.
how haskell(and me) know's it's right in both cases?
thanks :-).