Integrated Dynamics

Integrated Dynamics

63M Downloads

Reduce doesn't curry correctly

josephcsible opened this issue ยท 0 comments

commented

Issue type:

  • ๐Ÿ› Bug

Short description:

The reduce operator doesn't seem to curry its operator parameter correctly.

Steps to reproduce the problem:

  1. In the List tab, choose "String", add strings "Red" and "Grass", and save the result to a variable card, which I'll call needles.
  2. In the Operator tab, select "String String Contains", and save it to a variable card, which I'll call stringStringContains.
  3. 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.
  4. In the Boolean tab, input "false", and save the result to a variable card, which I'll call false.
  5. In the Operator tab, select "General Constant", and save the result to a variable card, which I'll call k.
  6. 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.
  7. In the Operator tab, select "Operator Disjunction", and save the result to a variable card, which I'll call disj.
  8. 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.
  9. In the Operator tab, select "String Name", and save the result to a variable card, which I'll call stringName.
  10. 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