I have this tree called arb
and this other called arbAux
and I put a function to replace variable axis: replace Variable "d" arbAux arb
then you should change the "d" for the arbAux
What I have of code is this
type Op = String -- operacion puede ser + - *
type Exp = String -- Exprecion es una variable
data Arbol = Hoja Exp | Nodo Op Arbol Arbol
-- caso de ambos con dos hojas
sustVar::Variable -> Arbol -> Arbol -> Arbol
sustVar var (Hoja e) (Hoja exp) = if (exp == var) then let exp = var
else exp
Please !!! Glue me a little help :) that code gives me an error -.-
codigo.hs:159:113: error: parse error on input ‘else’
|
| else exp
| ^^^^