Questions tagged [idris]

Idris is a general purpose pure functional programming language with dependent types.

Idris is a general-purpose purely functional programming language with dependent types, strict or optional lazy evaluation and features such as a totality checker.


Useful links:

785 questions
7
votes
0 answers

Problems with equational proofs and interface resolution in Idris

I'm trying to model Agda style equational reasoning proofs for Setoids (types with an equivalence relation). My setup is as follows: infix 1 :=: interface Equality a where (:=:) : a -> a -> Type interface Equality a => VerifiedEquality a where …
Rodrigo Ribeiro
  • 3,198
  • 1
  • 18
  • 26
7
votes
1 answer

If Idris thinks things may be total that are not, can Idris be used for proofs?

http://docs.idris-lang.org/en/v0.99/tutorial/theorems.html#totality-checking-issues states that: Secondly, the current implementation has had limited effort put into it so far, so there may still be cases where it believes a function is total which…
redfish64
  • 565
  • 3
  • 10
7
votes
1 answer

Struggling with rewrite tactic in Idris

I'm going through Terry Tao's real analysis textbook, which builds up fundamental mathematics from the natural numbers up. By formalizing as many of the proofs as possible, I hope to familiarize myself with both Idris and dependent types. I have…
user1502040
  • 451
  • 3
  • 13
7
votes
2 answers

Limits of dependent typing in Idris

I have been writing Haskell for a while now but wanted to try some experiments with the Idris language, and dependent typing. I have played around a bit, and read the basic doc, however I want to express a certain style of function, and do not know…
44701
  • 397
  • 4
  • 10
7
votes
2 answers

Idris: proof that specific terms are impossible

Idris version: 0.9.16 I am attempting to describe constructions generated from a base value and an iterated step function: namespace Iterate data Iterate : (base : a) -> (step : a -> a) -> a -> Type where IBase : Iterate base step base …
LiamGoodacre
  • 502
  • 3
  • 9
7
votes
1 answer

Proof assistant for mathematics only

Most proof assistants are functional programming languages with dependent types. They can proof programs/algorithms. I'm interested, instead, in proof assistant suitable best for mathematics and only (calculus for instance). Can you recommend one? I…
Yury
  • 1,169
  • 2
  • 16
  • 29
7
votes
2 answers

Testing if a type is a function type in Idris

I want to have a function that determines if a type is a function type, like this: isFunction : Type -> Bool isFunction (a -> b) = True isFunction _ = False This returns True for all inputs, however. How can I make this work?
Adrian
  • 14,931
  • 9
  • 45
  • 70
7
votes
1 answer

Custom prover tactics in Idris

If I understand it correctly (mainly from existence of the applyTactic function), it is possible to write custom tactics for the theorem prover in Idris. What (or where) are some examples I could use for learning how to do that?
Arets Paeglis
  • 3,856
  • 4
  • 35
  • 44
6
votes
1 answer

On defining "multivariable" functions by partial application in Haskell-like languages

So. I'm actually tinkering with the Idris language, by somewhat following Brady's Type-Driven Development with Idris. I don't think what I written here is that tied to a specific programing language (and I don't know any Haskell, for that matter).…
user13383731
6
votes
1 answer

Defining groups in Idris

I defined monoid in Idris as interface Is_monoid (ty : Type) (op : ty -> ty -> ty) where id_elem : () -> ty proof_of_left_id : (a : ty) -> ((op a (id_elem ())) = a) proof_of_right_id : (a : ty) -> ((op (id_elem ())a) = a) …
Arka
  • 249
  • 1
  • 8
6
votes
1 answer

Why we cannot pattern match on Set/Type in Coq/Agda/Idris?

Think about a function which accepts a Set, and returns its byte length, named byteLength: byteLength : Set -> Maybe Nat and if I want to implement this function directly, I need to pattern match on the type argument: byteLength Char = Just…
luochen1990
  • 3,689
  • 1
  • 22
  • 37
6
votes
1 answer

Can Idris support row-polymorphism?

Whereby I could construct an anonymous, ad-hoc record; that's editable, appendable, modifiable, where each value can have different heterogenous type, and where the compiler checks that the consumers type expectations unify with the types of the…
Wizek
  • 4,854
  • 2
  • 25
  • 52
6
votes
2 answers

fat arrow in Idris

I hope this question is appropriate for this site, it's just about the choice of concrete syntax in Idris compared to Haskell, since both are very similar. I guess it's not that important, but I'm very curious about it. Idris uses => for some cases…
user9309163
6
votes
1 answer

Can I prove (s : Stream a) -> (head s :: tail s = s) in Idris?

The following Idris proof doesn’t typecheck. hts : (s : Stream a) -> (head s :: tail s = s) hts (x::xs) = Refl The error I get is: Type mismatch between x :: Delay xs = x :: Delay xs and x :: Delay (tail (x :: Delay…
Lynn
  • 10,425
  • 43
  • 75
6
votes
1 answer

Idiomatic way of listing elements of a sum type in Idris

I have a sum type representing arithmetic operators: data Operator = Add | Substract | Multiply | Divide and I'm trying to write a parser for it. For that, I would need an exhaustive list of all the operators. In Haskell I would use deriving (Enum,…
blouerat
  • 692
  • 4
  • 12