flux icon indicating copy to clipboard operation
flux copied to clipboard

Error with arrays and anonymous functions in repl

Open zeebo opened this issue 6 years ago • 1 comments

Consider this repl log:

> ((x) => (y) => [x, y][0])(x: (i) => i)(y: (i) => i)(i: 2)
Error: error calling function "<anonymous function>": error calling function "<anonymous function>": expecting array type

> ((x) => (y) => [x, y][1])(x: (i) => i)(y: (i) => i)(i: 2)
Error: error calling function "<anonymous function>": error calling function "<anonymous function>": expecting array type

> ((x) => (y) => x)(x: (i) => i)(y: (i) => i)(i: 2)
2

> ((x) => (y) => y)(x: (i) => i)(y: (i) => i)(i: 2)
2

> ((x, y) => [x,y][0])(x: (i) => i, y: (i) => i)(i: 2)
2

> ((x, y) => [x,y][1])(x: (i) => i, y: (i) => i)(i: 2)
2

An interesting thing to note is that it appears to only happen with the curried form.

zeebo avatar Jan 10 '19 01:01 zeebo

This issue has had no recent activity and will be closed soon.

github-actions[bot] avatar Sep 22 '24 01:09 github-actions[bot]