Why is there a tycon mismatch operator and operand do not agree error? Any Suggestion for a solution?
fun reve (x:string) = implode o rev o explode x
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
The problem lies in, that function application binds stronger than
o.That is, it is interpreted as:
Since
explode xis achar listand not a function, this will fail.You can fix this by placing your parentheses properly
Or writing it in point-free notation:
It’s also possible to define a right-associative function application operator, usually called
$, which does what you want without parentheses: