Idris eager evaluation

We say Idris has strict evaluation, but this is for its run-time semantics. Being a fully dependently typed language, Idris has two phases where it evaluates things, compile-time and run-time. At compile-time it will only evaluate things which it knows to be total (i.e. terminating and covering all possible inputs) in order to keep type … Read more

Are Lists Inductive or Coinductive in Haskell?

Due to laziness, Haskell types are both inductive and coinductive, or, there is no formal distinguishment between data and codata. All recursive types can contain an infinite nesting of constructors. In languages such as Idris, Coq, Agda, etc. a definition like ones = 1 : ones is rejected by the termination checker. Laziness means that … Read more

Difference between Haskell and Idris: Reflection of Runtime/Compiletime in the type universes

Yes, you’re right to observe that the types versus values distinction in Idris does not align with the compiletime-only versus runtime-and-compiletime distinction. That’s a good thing. It is useful to have values which exist only at compiletime, just as in program logics we have “ghost variables” used only in specifications. It is useful also to … Read more

Practical examples of Idris

Edwin Brady has a repo full of demos at https://github.com/edwinb/idris-demos. Among other things, it has a playable space invaders game, written using SDL bindings, Effects, and the !-effect syntax (basically an alternate syntax to do-notation / >>=). Also, we attempt to maintain a listing of some available libraries on the wiki: https://github.com/idris-lang/Idris-dev/wiki/Libraries

Where to start with dependent type programming? [closed]

I would highly recommend Software Foundations. This book is quite good at introducing you to Coq one step at a time. There is a lot of theorem proving, yes, but that’s part of the deliciousness of dependent types. It’s a great feeling when the line between “programming” and “proving” starts to blur. I’m lacking in … Read more

Dependent types can prove your code is correct up to a specification. But how do you prove the specification is correct?

This is the static, type-system version of, How do you tell that your tests are correct? The only answer I can honestly give is, yes, the more complex and unwieldy your specification, the more likely you are to have made a mistake. You can mess up in writing something in a type theoretic formalism just … Read more

tech