You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
function created to compute expression : expression (x:y:z:[]) = (term x) ++ (addOperation y) ++ (term z)
shows a type error
• Couldn't match expected type ‘[Char]’ with actual type ‘Char’
• In the second argument of ‘(++)’, namely ‘(term z)’
In the second argument of ‘(++)’, namely
‘(addOperation y) ++ (term z)’
In the expression: (term x) ++ (addOperation y) ++ (term z)
|
17 | expression (x:y:z:[]) = (term x) ++ (addOperation y) ++ (term z)
| ^^^^^^
Possible but immature(imo) solution(or hack) that I came up with is expression (x:y:z:[]) = (term x : []) ++ (addOperation y) ++ (term z : [])
The text was updated successfully, but these errors were encountered:
shubhamkumar13
changed the title
Error in code snippet - Chapter
Error in code snippet - Chapter Single Digit Math
Sep 1, 2019
function created to compute expression :
expression (x:y:z:[]) = (term x) ++ (addOperation y) ++ (term z)
shows a type error
Possible but immature(imo) solution(or hack) that I came up with is
expression (x:y:z:[]) = (term x : []) ++ (addOperation y) ++ (term z : [])
The text was updated successfully, but these errors were encountered: