Reduce doesn't curry correctly
josephcsible opened this issue ยท 0 comments
Issue type:
- ๐ Bug
Short description:
The reduce operator doesn't seem to curry its operator parameter correctly.
Steps to reproduce the problem:
- In the List tab, choose "String", add strings "Red" and "Grass", and save the result to a variable card, which I'll call needles.
- In the Operator tab, select "String String Contains", and save it to a variable card, which I'll call stringStringContains.
- In the map tab, put stringStringContains on the left and needles on the right, and save the result to a variable card, which I'll call matchers.
- In the Boolean tab, input "false", and save the result to a variable card, which I'll call false.
- In the Operator tab, select "General Constant", and save the result to a variable card, which I'll call k.
- In the apply tab, put k on the left and false on the right, and save the result to a variable card, which I'll call alwaysFalse.
- In the Operator tab, select "Operator Disjunction", and save the result to a variable card, which I'll call disj.
- In the reduce tab, put disj on the left, matchers in the middle, and alwaysFalse on the right, and save the result to a variable card, which I'll call anyMatches.
- In the Operator tab, select "String Name", and save the result to a variable card, which I'll call stringName.
- In the . (pipe) tab, put stringName on the left and anyMatches on the right, and save the result to a variable card, which I'll call nameMatches.
Expected behaviour:
I expect the nameMatches predicate to return true for items whose names contain "Red" or "Grass".
Actual behavior:
The nameMatches predicate returns the error "The operator contains received an input of length 1 while it needs a length of 2." As a workaround, I can get it to work if I manually curry it by applying the apply operator, by doing this in place of step 2:
2a. In the Operator tab, select "String String Contains", and save it to a variable card, which I'll call rawStringStringContains.
2b. In the Operator tab, select "Operator Apply", and save it to a variable card, which I'll call apply.
2c. In the Apply tab, put apply on the left and rawStringStringContains on the right, and save the result to a variable card, which I'll call stringStringContains.
Versions:
- This mod: 0.11.18
- Minecraft: 1.12.2
- Forge: 14.23.5.2784
Log file:
Nothing relevant