This PR mainly extracts lambdas that takes more then one argument as a pair, and instead of constructing the arrays of pairs and later mapping over that them the code now calls the function instead of where the pair operator was used.
This hopefully does two things:
it reduces the number of calls that happens in the code, reducing the packing and unpacking the reader and purescript needs to do.
it also moves the declaration of the function to before its "virtual" usage, making the code more linear and there by easier to read
I have also tried to give the parameters longer names since they are now farther away from the callsite and you don't have the context of the actual values as close as before. (though its not that fara way in any of the cases).
There is also some mild cleanups, removing extra $ that it seemed was unnecessary.
This PR mainly extracts lambdas that takes more then one argument as a pair, and instead of constructing the arrays of pairs and later mapping over that them the code now calls the function instead of where the pair operator was used.
This hopefully does two things:
it also moves the declaration of the function to before its "virtual" usage, making the code more linear and there by easier to read
I have also tried to give the parameters longer names since they are now farther away from the callsite and you don't have the context of the actual values as close as before. (though its not that fara way in any of the cases).
There is also some mild cleanups, removing extra
$
that it seemed was unnecessary.example:
let button setter letter value = D.button (klass buttonClass <|> click (setter value)) [ text (letter <> " = " <> show value) ] D.div [ D.div_ $ [ button setP "P" true , button setP "P" false , button setQ "Q" true , button setQ "Q" false ]