I write down this:
data IsTag : String -> Type where
NumIsTag : IsTag "num"
StrIsTag : IsTag "str"
arr1 : List (tag : String ** (IsTag tag, (case tag of "num" => Int; "str" => String)))
arr1 = [("num" ** (NumIsTag, 1)), ("str" ** (StrIsTag, "hello"))]
And get the following wield error message:
When checking right hand side of arr1 with expected type
List (tag : String **
(IsTag tag, case tag of "num" => Int "str" => String))
When checking argument b to constructor Builtins.MkPair:
case "num" of
"num" => Int
"str" => String is not a numeric type
But I can't understand, Why case "num" of "num" => Int; "str" => String
is not a numeric type? isn't it equals to Int
?