A bit of a silly question, but why do people prefer an interface of (fn proc data)
and not (fn data proc)
@slack1 we’ve moved toward the latter, but the former is the historical tradition (ie map
)
I’m not sure if this influences Racket’s choice, but (map proc data)
is nicer with partial application, since you can do (define increment-all (map add1))
ah I see
I also didn’t know that things were auto-curried like that
I thought you had to curry map
They aren’t afaik. I was just saying that if things are autocurried, e.g. In haskell or hackett, then the order of map
/filter
/fold
’s arguments seems more natural
the current rule in racket “functions that operate on some abstract type foo?
use the prefix foo-
in their names and take the foo?
input as the first argument”
also it’s easier to extend to multiple arguments if the function comes first (as in map
)
but in general the rule is as @notjack says