$ elm repl---- elm-repl 0.17.1 -----------------------------------------------------------:help for help, :exit to exit, more at <https://github.com/elm-lang/elm-repl>--------------------------------------------------------------------------------> a = [1, 2, 3, 4, 5][1,2,3,4,5] : List number> isOdd n = (n % 2 == 1)<function:_user$project$Repl$isOdd> : Int -> Bool> odds = List.filter isOdd a[1,3,5] : List Int> doAction n = n + 1<function:_user$project$Repl$doAction> : number -> number> List.map doAction odds[2,4,6] : List Int
Hello,I am new to elm syntax. I have a list of records with name and age. I want to apply a test function to each record. The function takes one record as input and returns a boolean value. Depending on True or false, I want to take a specific action for each record. How can I implement this in elm? If it was Python, I will just iterate over each item in the list and pass it as a parameter to the function.
--
You received this message because you are subscribed to the Google Groups "Elm Discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elm-discuss+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Hello,I am new to elm syntax. I have a list of records with name and age. I want to apply a test function to each record. The function takes one record as input and returns a boolean value. Depending on True or false, I want to take a specific action for each record. How can I implement this in elm? If it was Python, I will just iterate over each item in the list and pass it as a parameter to the function.