You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Lambda or anonymous function for String.filter or String.map always give me this weird error message.
Whatever I am running into is confusing me a lot! Normally I can give fairly
specific hints, but something is really tripping me up this time.
Detected problems in 1 module.
-- SYNTAX PROBLEM ------------------------------------------------- src/Main.elm
I got stuck here:
97| || String.filter \c -> Char.isUpper c pw |> String.isEmpty
^
Whatever I am running into is confusing me a lot! Normally I can give fairly
specific hints, but something is really tripping me up this time.
The surrounding code is the following:
-- False if pw is weak, True if it's strongweakPassword:String->BoolweakPassword pw =
test pw Char.isLower
-- || test pw Char.isUpper||String.filter \c ->Char.isUpper c pw |>String.isEmpty
|| test pw Char.isDigit
-- True if predicate yields an empty stringtest:String-> (Char->Bool) ->Booltest s predicate =String.filter predicate s |>String.isEmpty
It looks to me that
String.filter \c ->Char.isUpper c pw |>String.isEmpty
is the exact same as the body of the test function, if predicate is replaced with \c -> Char.isUpper c . I have tried to add parentheses around the lambda but that just give me other error messages.
String.filter predicate s |>String.isEmpty
I'm new, so it might not always be an error but I have only ever got an error message when I try.
Anyway, the reason for this issue is: Whatever I am running into is confusing me a lot! Normally I can give fairly specific hints, but something is really tripping me up this time.
The text was updated successfully, but these errors were encountered:
Lambda or anonymous function for
String.filter
orString.map
always give me this weird error message.Whatever I am running into is confusing me a lot! Normally I can give fairly
specific hints, but something is really tripping me up this time.
The surrounding code is the following:
It looks to me that
is the exact same as the body of the
test
function, ifpredicate
is replaced with\c -> Char.isUpper c
. I have tried to add parentheses around the lambda but that just give me other error messages.I'm new, so it might not always be an error but I have only ever got an error message when I try.
Anyway, the reason for this issue is: Whatever I am running into is confusing me a lot! Normally I can give fairly specific hints, but something is really tripping me up this time.
The text was updated successfully, but these errors were encountered: