input-output-hk / input-output-hk/cuddle

Can't apply control operators to values that the rfc considers valid

Open
#71 1 comment 0 reactions 0 assignees View on GitHub
bug
Dominant language
Haskell
Stars
7
Forks
5
PR merge metrics
No merged PRs in 30d

Description

Because of this code:
```
(CtlOp.Lt, CTree.Literal (VUInt n)) -> case tt of
CTree.Postlude PTUInt -> S . TInteger <$> genUniformRM (0, fromIntegral n - 1)
_ -> error "Cannot apply lt operator to target"
```
We can only apply rules like `uint .lt 2`. It forbids the following cases:
```
rule1 = nint .lt 2
rule2 = int .lt 2
rule3 = 1..5 .lt 2
rule4 = 1 .lt 2
rule5 = ((1..3) / (1..5)) .lt 2
```

All these cases are accepted by the `cddl` tool. The same seems to happen with most of the other control operators.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.