Answer the question
In order to leave comments, you need to log in
How to create such data type?
I have such a task before me
And here is the example that was presented before (according to which, as I understand it, it is necessary to do it)
I can’t figure out how to make these ~, &, | operations available. After all, these are some kind of service characters, or maybe I don’t understand it correctly, please help me build the data type correctly.
Here's more after the material, just with variables.
Answer the question
In order to leave comments, you need to log in
I myself am still quite a beginner, but if I understand correctly, then something like this:
Data LogExpr = Const Bool
| Var String
| Not LogExpr
| And LogExpr LogExpr
| Or LogExpr LogExpr
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question