idris

    0熱度

    1回答

    考慮: $idris -v 0.99 我想升級到版本1但是,我一味試圖通過運行cabal install idris升級到看到這樣的輸出: $cabal install idris Resolving dependencies... All the requested packages are already installed: idris-1.0 Use --reinstall

    1熱度

    1回答

    Test-Driven Development with Idris的第9章介紹了以下數據類型和removeElem函數。 import Data.Vect data MyElem : a -> Vect k a -> Type where MyHere : MyElem x (x :: xs) MyThere : (later : MyElem x xs) -> MyEl

    4熱度

    1回答

    爲什麼不會以下類型檢測:由於mod功能(感謝@AntonTrunov澄清)的偏袒 v2 : 3 - 2 = 1 v2 = Refl

    2熱度

    1回答

    Type-Driven Development with Idris禮物: twoPlusTwoNotFive : 2 + 2 = 5 -> Void twoPlusTwoNotFive Refl impossible 是對函數或值之上?如果它是前者,那麼爲什麼沒有可變參數,例如 add1 : Int -> Int add1 x = x + 1 特別,我在twoPlusTwoNotFi

    3熱度

    1回答

    從類型驅動開發望着運動9.2與伊德里斯: data Last : List a -> a -> Type where LastOne : Last [value] value LastCons : (prf : Last xs value) -> Last (x :: xs) value Uninhabited (Last [] value) where unin

    3熱度

    2回答

    我想知道如何證明(So (not (y == y)))是Uninhabited的一個實例,我不知道該怎麼去做。它是否可以在Idris中證明,或者由於y的奇怪的Eq實現的可能性而無法證明?

    2熱度

    2回答

    如果我有一個So的類型,比如So (x < y),通過創造的東西像 IsLt : Ord a => (x: a) -> (y: a) -> Type IsLt x y = So (x < y) 我怎樣才能提取(x < y)證明了這件事?我無法在標準庫中找到此功能。 So在標準庫中定義爲: data So : Bool -> Type where Oh : So True 而且我

    1熱度

    1回答

    對於從屬類型,它可以定義一個感應式的有序列表,例如: data IsSorted : {a: Type} -> (ltRel: (a -> a -> Type)) -> List a -> Type where IsSortedZero : IsSorted {a=a} ltRel Nil IsSortedOne : (x: a) -> IsSorted ltRel [x]

    2熱度

    1回答

    我有一個Vehicle類型取決於PowerSource類型: data PowerSource = Petrol | Pedal | Electric data Vehicle : PowerSource -> Type where Unicycle : Vehicle Pedal Motorcycle : (fuel: Nat) -> Vehicle Petrol

    2熱度

    1回答

    如何在Idris REPL中編寫函數?如果我在REPL鍵入函數定義​​,我得到了以下錯誤消息: (input):1:7: error: expected: "$", "&&", "*", "*>", "+", "++", "-", "->", ".", "/", "/=", "::", "<", "<$>", "<*", "<*>", "<+>", "<<",