D
D
Dmitry Shcherbakov2019-03-08 20:22:04
Haskell
Dmitry Shcherbakov, 2019-03-08 20:22:04

How to create such data type?

I have such a task before me
zQ-rdJ1hDkc.jpg
And here is the example that was presented before (according to which, as I understand it, it is necessary to do it)
RA0zG5Y13vo.jpg
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.
HnITkVthZj8.jpgvEDXelP8wG0.jpg

Answer the question

In order to leave comments, you need to log in

1 answer(s)
Y
YURIY KOZLOV, 2019-03-09
@WizardNG

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 question

Ask a Question

731 491 924 answers to any question