>
> What is going wrong here:
>
> (1) -> li := [2,4,3,2,5,2,7,2,2,7]
>
> (1) [2, 4, 3, 2, 5, 2, 7, 2, 2, 7]
> Type: List(PositiveInteger)
> (3) -> li10 := [recip(i::IntegerMod 10) for i in 0..9]
>
> (3) ["failed", 1, "failed", 7, "failed", "failed", "failed", "failed", 9]
>
I think this is an interpreter bug, that it automatically coerces a Union
type Union(xx, "yy") to its subtype "yy". (Interpreter can handle types like
Union(Integer,String) )
You can use the following workaround:
remove(x+->x case "failed", l)
But the result type is still
(5) -> remove(f, li10)$List(Union(IntegerMod(10),"failed"))
(5) [1, 7, 3, 9]
Type:
List(Union(IntegerMod(10),"failed"))
Obviously the interpreter is unable to automatically realise that it
should also look inside the exports of
What is going wrong here:
(1) -> li := [2,4,3,2,5,2,7,2,2,7]
(1) [2, 4, 3, 2, 5, 2, 7, 2, 2, 7]
Type: List(PositiveInteger)
(2) -> remove(2,li)
(2) [4, 3, 5, 7, 7]