-
Notifications
You must be signed in to change notification settings - Fork 12
Open
Description
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 : [])
Metadata
Metadata
Assignees
Labels
No labels