5-- An expensive function.
9qib (S (S n)) = qib n * qib (S n)
11-- An equality whose size reflects the size of numbers.
12data equals : Nat -> Nat -> Type where
14 eqS : m `equals` n -> S m `equals` S n
16eq_refl : {n : Nat} -> n `equals` n
18eq_refl {n = S n} = eqS eq_refl
20-- Here, the proof is very expensive to compute.
21-- We add a recursive argument to prevent Idris from inlining the function.
22f : (r, n : Nat) -> Subset Nat (\k => qib n `equals` qib k)
23f Z n = Element n eq_refl
26-- A (contrived) relation, just to have something to show.
27data represents : Nat -> Nat -> Type where
28 axiom : (n : Nat) -> qib n `represents` n
30-- Here, the witness is very expensive to compute.
31-- We add a recursive argument to prevent Idris from inlining the function.
32g : (r, n : Nat) -> Exists (\k : Nat => k `represents` n)
33g Z n = Evidence (qib n) (axiom n)
36fmt : qib n `represents` n -> String
37fmt (axiom n) = "axiom " ++ show n
41 n <- map (const (the Nat 10000)) (putStrLn "*oink*")
42 putStrLn . show $ getWitness (f 4 n)
43 putStrLn . fmt $ getProof (g 4 n)
keysesc to close
- j k
- move down, up
- enter
- open
- esc
- back, or up a level
- 1 2 3 4
- readme, files, commits, refs
- /
- filter
- y
- copy the clone command
- c
- compare the chosen commit with another (or shift-click both)
- ?
- show or hide this list