我如何让Idris自动证明两个值不相等? p : Not (Int = String)
p = \Refl impossible
我该如何让Idris自动生成此证明? auto似乎不能证明涉及Not的陈述。我的最终目标是让Idris自动证明矢量中的所有元素都是唯一的,并且两个矢量不相交。 namespace IsSet
data IsSet : List t -> Type whe
我试图计算奇偶校验与半的地板一起,在自然数: data IsEven : Nat -> Nat -> Type where
Times2 : (n : Nat) -> IsEven (n + n) n
data IsOdd : Nat -> Nat -> Type where
Times2Plus1 : (n : Nat) -> IsOdd (S (n + n)) n
inf : Nat
inf = S inf
minimum' : Lazy Nat -> Lazy Nat -> Lazy Nat
minimum' Z b = Z
minimum' b Z = Z
minimum' (S a) (S b) = S (minimum' a b)
main : IO()
main = do
print $ Force $ minimum'
我读Type driven development with Idris,和的一个练习要求读者限定,使得随着一个矢量可以表示一个类型TupleVect,: TupleVect 2 ty = (ty, (ty,()))
我解决它通过定义以下类型: TupleVect : Nat -> Type -> Type
TupleVect Z ty =()
TupleVect (S k) ty = (
这种失败: > the ({A : Type} -> A -> {B : Type} -> B -> (A, B)) MkPair
(input):1:5:When checking argument value to function Prelude.Basics.the:
Type mismatch between
A -> B1 -> (A, B1) (Type
当我尝试编译这个例子 record R where
f:() -> {t: Type} -> t
我得到这个错误: Type mismatch between
() -> t1 (Type of f)
and
() -> t (Expected type)
Specifically:
Type mismatch between