I'm getting what seems to be a precedence issue in calling an SML function, substitute:
fun substitute v new (typevar q) = ...
And I am calling this from another function:
fun new_type_vars (typevar v) non_gens =
substitute v new_var() (typevar v)
But I get an error:
C:/sml/type_checker.sml:22.48-23.44 Error: operator and operand don't agree [tycon mismatch] operator domain: type_exp operand: unit -> string in expression: (substitute v) new_var
Which seems to suggest that it's trying to call (substitute v), and then call the result of that call with argument new_var.
I've tried adding parentheses around the whole thing, but that doesn't help, and when I add parenthesis around the arguments like (v new_var...)
it thinks that v is a function application on new_var. What's going on with this function call?