4
考虑以下片段匹配:图案上的类型的计算功能在伊德里斯结果
import Data.List
%default total
x : Elem 1 [1, 2]
x = Here
type : Type
type = Elem 1 [1, 2]
y : type
y = Here
这给出了错误:
当检查Y的右侧:之间 ELEM X 类型不匹配(X :: XS)(这里的类型) 和 ITYPE(预期类型)
类型的y
,在查询时,是:
type : Type
-----------
y : type
是否有可能迫使type
期间或y
类型归属之前进行评估,从而使y
类型是Elem 1 [1, 2]
?
我使用的情况是,我希望能够定义返回正确的命题条款证明通用谓词,例如:
subset : List a -> List a -> Type
subset xs ys = (e : a) -> Elem e xs -> Elem e ys
thm_filter_subset : subset (filter p xs) xs
新系统感觉像哈斯克尔的。我一直在想 – dfeuer