Idris 0.9.18 released

A new version of Idris, 0.9.18, has been released. You can find this on hackage, or from the download page. Documentation is available from docs.idris-lang.org. Updates are detailed below.

Thanks as always to everyone who has contributed, either with code, documentation or by testing and reporting issues. You can find the names of all contributors in the CONTRIBUTORS file in the source repository.

Idris is still research software, so we expect there to be bugs. Please don’t keep them to yourself! If you find any problem, please report it on the github issue tracker. It is very helpful if you can also provide a small test case which reproduces your problem.

Also, do let us know how you get on in general either via the mailing list or the #idris channel on irc.freenode.net.

Language changes

  • There is a new syntax for records, corresponding to type class syntax (which is also a record-like structure). See dependent records in the documentation
  • Records can now be coinductive, using the corecord keyword
  • Type class constructors can be given user accessible names (corresponding to the new record syntax)
  • if...then...else is now built in syntax rather than a syntax macro, desugaring to ifThenElse. This is for cleaner overloading and better error messages in domain specific languages.
  • Pattern matching lambdas and case expressions can now be labelled impossible, in
    the same way as top level patterns
  • Added a %hint function annotation, which allows functions to be used in proof search for auto arguments. Only functions which return instances of a data or record type are allowed as hints
  • Strings are now UTF8 encoded, and Idris source is assumed to be UTF8 encoded
  • Some reorganisation of primitives:
    • Buffer and BitVector removed (due to insufficient testing and lack of a maintainer)
    • Float renamed to Double
    • Externally defined primitives now supported with %extern directive
    • Ptr and ManagedPtr removed and replaced with external primitives
  • New quotation syntax `{n} for a quotation of the reflected representation of the name n. If n is lexically bound, then the resulting quotation will be for it, whereas if it is not, then it will succeed with a quotation of the unique global name that matches
  • As usual, lots of improvements and fixes in elaboration, especially with type class resolution
    and name disambiguation

Library changes

  • The default Semigroup and Monoid instances for Maybe are now prioritised choice, keeping the first success as Alternative does. The version that collects successes is now a named instance
  • The return types of Vect.findIndex, Vect.elemIndex and Vect.elemIndexBy were changed from Maybe Nat to Maybe (Fin n)

Tool changes

  • :exec REPL command now takes an optional expression to compile and run/show
  • A new :browse command shows the contents of a namespace
  • Agda-style semantic highlighting is supported over the IDE protocol

Idris 0.9.17 released

A new version of Idris, 0.9.17, has been released. You can find this on hackage, or from the download page. Documentation is available from docs.idris-lang.org.

Thanks as always to everyone who has contributed, either with code, documentation or by testing and reporting issues. You can find the names of all contributors in the CONTRIBUTORS file in the source repository.

Idris is still research software, so we expect there to be bugs. Please don’t keep them to yourself! If you find any problem, please report it on the github issue tracker. It is very helpful if you can also provide a small test case which reproduces your problem.

Also, do let us know how you get on in general either via the mailing list or the #idris channel on irc.freenode.net.

The main new features and updates are:

  • Library operators have been renamed for consistency with corresponding operators in Haskell. In particular, Applicative.(<$>) is now Applicative.(<*>) and (<$>) is now an alias for Functor.map. Correspondingly, ($>) and (<$) have been renamed to (<*) and (*>). The cascading effects of this rename are that Algebra.(<*>) has been renamed to Algebra.(<.>) and Matrix.(<.>) is now Matrix.(<:>).
  • Types errors have been improved, now giving the provenance of incorrect types
  • Documentation has been updated and moved to docs.idris-lang.org, hosted by Read the Docs.
  • Web documentation is now available for packages, from the Documentation page.
  • A new package contrib has been added to the libraries. This is for things which are less mature or less used than the contents of base.contrib is not available by default, so you may need to add -p contrib to your .ipkg file or Idris command line.
  • Instances and type providers can now be given documentation strings.
  • Lots of issues relating to type class resolution have been resolved. In particular:
    • Arguments are now checked for injectivity, since this is assumed throughout unification
    • Multi-parameter type classes can now be given determining parameters, which are the parameters used to resolve class instances. Only determining parameters are assumed and checked to be injective.
  • Binding forms in dsl notation are now given an extra argument: a reflected representation of the name that the user chose. Specifically, the rewritten lambda, pi, and let binders will now get an extra argument of type TTName. This allows more understandable dynamic errors in DSL code and more readable code generation results.
  • The Foreign Function Interface has been updated to support multiple back end descriptions.
  • A new FFI_Export type has been added, supporting export of functions to be called by foreign code. Details of the FFI and its interaction with back ends are given in this draft paper.

Idris 0.9.16 released

A new version of Idris, 0.9.16, has been released. You can find this on hackage, or from the download page.

The tutorial has also been updated.

Thanks as always to everyone who has contributed, either with code, documentation or by testing and reporting issues. You can find the names of all contributors in the CONTRIBUTORS file in the source repository.

Idris is still research software, so we expect there to be bugs. Please don’t keep them to yourself! If you find any problem, please report it on the github issue tracker. It is very helpful if you can also provide a small test case which reproduces your problem.

Also, do let us know how you get on in general either via the mailing list or the #idris channel on irc.freenode.net.

The main new features and updates are:

  • Inductive-inductive definitions are now supported (i.e. simultaneously defined types where one is indexed by the other)
  • Implicits and type class constraints can now appear in scopes other than the top level
  • Importing a module no longer means it is automatically reexported. A new public modifier has been added to import statements, which will reexport the names exported from that module
  • Implemented @patterns. A pattern of the form x@p on the left hand side matches p, with x in scope on the right hand side with value p
  • Vect, Fin and So moved out of prelude into base, in modules Data.Vect, Data.Fin and Data.So respectively
  • A new tactic sourceLocation that fills the current hole with the current source code span, if this information is available. If not, it raises an error
  • :search and :apropos commands can now be given optional package lists to search
  • Better Unicode support for the JavaScript/Node codegen
  • Modules can now have API documentation strings

Additionally, several long-standing issues have been resolved, particularly with pattern matching and coverage checking.

Idris 0.9.15.1 released

A new version of Idris, 0.9.15.1, has been released. You can find this on hackage, or from the download page.

The tutorial has also been updated.

Thanks as always to everyone who has contributed, either with code, documentation or by testing and reporting issues. You can find the names of all contributors in the CONTRIBUTORS file in the source repository.

Idris is still research software, so we expect there to be bugs. Please don’t keep them to yourself! If you find any problem, please report it on the github issue tracker. It is very helpful if you can also provide a small test case which reproduces your problem.

Also, do let us know how you get on in general either via the mailing list or the #idris channel on irc.freenode.net.

The main new features and updates are:

  • Naming of data and type constructors is made consistent across the standard library.
    • Note: This change will break existing code!
    • Data and Type Constructors now consistently begin with a capital letter, which means in particular we have Refl, FZ and FS for refl, fZ and fS.
    • The empty type is now called Void, and its eliminator void.
  • EXPERIMENTAL support for Uniqueness Types
  • EXPERIMENTAL support for Partial Evaluation, as described in Scrapping your Inefficient Engine.
  • The Java and LLVM backends have been factored out into separate projects, idris-java and idris-llvm.

There are several minor updates and improvements:

  • More efficient representation of the proof state, leading to faster elaboration of large expressions.
  • Two new tactics: skip and fail. skip does nothing, and fail takes a string as an argument and produces it as an error, with corresponding reflected tactics.
  • Improved display in the interactive prover.
  • Unary negation now desugars to `negate`, which is a method of the `Neg` type class. This allows instances of `Num` that can’t be negative, like `Nat`, and it makes correct IEEE Float operations easier to encode. Additionally, unary negation is now available to DSL authors.
  • New REPL command `:printdef` displays the internal definition of a name.
  • New REPL command `:pprint` pretty-prints a definition or term with LaTeX or HTML highlighting.
  • Terms in code blocks in documentation strings are now parsed and type checked. If this succeeds, they are rendered in full colour in documentation lookups, and with semantic highlighting for IDEs.
  • Fenced code blocks in docs defined with the “example” attribute are rendered as code examples.
  • Fenced code blocks declared to be Idris code that fail to parse or type check now provide error messages to IDE clients.

Idris 0.9.14 released

A new version of Idris, 0.9.14, has been released. You can find this on hackage, or from the download page.

The tutorial has also been updated.

This release is primarily to improve robustness and efficiency, and solves several long-standing issues. There is also a new, improved, JavaScript backend and better syntactic support for reflection.

Thanks as always to everyone who has contributed, either with code, documentation or by testing and reporting issues. You can find the names of all contributors in the CONTRIBUTORS file in the source repository.

Idris is still research software, so we expect there to be bugs. Please don’t keep them to yourself! If you find any problem, please report it on the github issue tracker. It is very helpful if you can also provide a small test case which reproduces your problem.

Also, do let us know how you get on in general either via the mailing list or the #idris channel on irc.freenode.net.

The main new features and updates are:

  • Tactic for case analysis in proofs
  • Induction and case tactic now work on expressions
  • Support for running tests for a package with the tests section of .ipkg files and the --testpkg command-line option
  • Clearly distinguish between type providers and postulate providers at the use site
  • Allow dependent function syntax to be overridden in dsl blocks, similarly to functions and let. The keyword for this is pi.
  • Updated effects library, with simplified API
  • All new JavaScript backend (avoids callstack overflows)
  • Add support for %lib directive for NodeJS
  • Quasiquotes and quasiquote patterns allow easier work with reflected terms.`(EXPR) quasiquotes EXPR, causing the elaborator to be used to produce a reflected version of it. Subterms prefixed with ~ are unquoted – on the RHS, they are reflected terms to splice in, while on the LHS they are patterns. A quasiquote expression can be given a goal type for the elaborator, which helps with disambiguation. For instance, `(() : ()) quotes the unit constructor, while `(() : Type) quotes the unit type. Both goal types and quasiquote are typechecked in the global environment.
  • Better inference of unbound implicits.

Idris 0.9.13.1 released

A new version of Idris, 0.9.13.1, has been released. You can find this on hackage, or from the download page.

This is a bug fix release: it fixes a problem with the interaction between lazy values and the new implementation of erasure introduced in 0.9.13, and slightly improves unification error messages.

Idris 0.9.13 released

A new version of Idris, 0.9.13, has been released. You can find this on hackage, or from the download page.

The tutorial has also been updated.

This release primarily improves robustness and efficiency, and more in-depth documentation. In particular, there is a new implementation of erasure by usage analysis.

Thanks as always to everyone who has contributed, either with code, documentation or by testing and reporting issues. You can find the names of all contributors in the CONTRIBUTORS file in the source repository.

Being research software, we expect there to be bugs. Please don’t keep them to yourself! If you find any problem, please report it on the github issue tracker. It is very helpful if you can also provide a small test case which reproduces your problem.

Also, do let us know how you get on in general either via the mailing list or the #idris channel on irc.freenode.net.

Aside from erasure, the new features and updates are:

  • New (first class) nested record update/access syntax:
    • record { a->b->c = val } x sets field accessed by c (b (a x)) to val
    • record { a->b->c } x accesses field, equivalent to c (b (a x))
  • IDE support for retrieving structured information about metavariables
  • Experimental Bits support for JavaScript
  • IdrisDoc: a Haddock- and JavaDoc-like HTML documentation generator
  • Command line option -e (or --eval) to evaluate expressions without loading the REPL. This is useful for writing more portable tests.
  • Many more of the basic functions and datatypes are documented
  • Primitive types such as Int and String are documented
  • Removed javascript lib in favor of idris-hackers/iQuery
  • Specify codegen for :compile REPL command (e.g. :compile javascript program.js)
  • Remove :info REPL command, subsume and enhance its functionality in the :doc command.
  • The banner at startup can be suppressed by adding :set nobanner to the initialisation script.
  • :apropos now accepts space-delimited lists of query items, and searches for the conjunction of its inputs. It also accepts binder syntax as search strings – for instance, -> finds functions.
  • Totality errors are now treated as warnings until code generation time, when they become errors again. This allows users to use the interactive editing features to fix totality issues, but no programs that violate the stated assumptions will actually run.
  • Added :makelemma command, which adds a new top level definition to solve a metavariable.
  • Extend :addclause to add instance bodies as well as definitions
  • Reverse parameters to BoundedList — now matches Vect, and is easier to instantiate classes.
  • Move foldl into Foldable so it can be overridden.
  • Experimental :search REPL command for finding functions by type

Idris 0.9.12 released

A new version of Idris, 0.9.12, has been released. You can find this on hackage, or from the download page.

The tutorial has also been updated.

There are some changes in this release which may break old code, specifically laziness, codata and the effects library have been significantly updated. Full details are in the new tutorial, and in the Effects tutorial.

Thanks as always to everyone who has contributed, either with code, documentation or by testing and reporting issues. You can find the names of all contributors in the CONTRIBUTORS file in the source repository.

Being research software, we expect there to be bugs. Please don’t keep them to yourself! If you find any problem, please report it on the github issue tracker. It is very helpful if you can also provide a small test case which reproduces your problem.

Also, do let us know how you get on in general either via the mailing list or the #idris channel on irc.freenode.net.

Details of the new feature and updates follow.

Laziness

Laziness is now implemented via the type system, using the following constructs:

Lazy : Type -> Type
Delay : a -> Lazy a
Force : Lazy a -> a

Both Delay and Force may be left implicit, so laziness is usually silent apart from an explicit Lazy in a type, e.g.

boolCase : (b : Bool) -> (t : Lazy a) -> (e : Lazy a) -> a
boolCase True  t e = t
boolCase False t e = e

Codata

Similarly, codata is now implemented via the type system, using the following constructs:

Inf : Type -> Type
Delay : a -> Inf a
Force : Inf a -> a

Again, both Delay and Force may be left implicit. Data types may mix data and codata. Old style codata declarations are still supported, where Inf is added implicitly. The following declarations are therefore equivalent:

codata Stream : Type -> Type where
  (::) : a -> Stream a -> Stream a

data Stream : Type -> Type where
  (::) : a -> Inf (Stream a) -> Stream a

Lazy and Inf are closely related (in fact, the underlying implementation uses the same type). The only difference in practice is in totality checking, where Lazy is erased (i.e. terms are checked for termination normally, ignoring laziness annotations), and Inf uses a productivity checker, where any use of Delay must be constructor guarded.

Metavariables in types

Proof search now works for metavariables in types, giving some interactive type inference. For example:

vec : ?vtype
vec = with Vect ["a","b","c"]

This can either be solved interactively, using :ps at the REPL, or the appropriate vim mode or emacs mode commands. e.g. assuming it is defined on line 37 of vtest.idr:

*vtest> :ps 37 vtype
Vect 3 String

Alternatively, it can be solved explicitly in code:

vec : ?vtype
vec = with Vect ["a","b","c"]

vtype = proof search

Documentation comments

There is a new syntax for inline documentation. Documentation starts with |||, and
arguments are documented by preceding their name with @. For example:

||| Add two natural numbers
||| @ n the first number (examined by the function)
||| @ m the second number (not examined)
plus (n, m : Nat) -> Nat

Other changes

There have been several improvements in robustness and efficiency. Other changes are:

  • JavaScript and Node codegen now understand the %include directive.
  • Concept of null is now understood in the JavaScript and Node codegen.
  • Lots of performance patches for generated JavaScript.
  • New commands :eval (:e) and :type (:t) in the prover, which either normalise or show the type of expressions.
  • Allow type providers to return postulates in addition to terms.
  • Syntax for dealing with match failure in <- and pattern matching let.
  • Allow the auto-solve behaviour in the prover to be disabled, for easier debugging of proof automation. Use :set autosolve and :unset autosolve.
  • Updated effects library.
  • New :apropos command at REPL to search documentation, names, and types.
  • Unification errors are now slightly more informative.
  • Add covering function option, which checks whether a function and all descendants cover all possible inputs (subset of total).

Idris 0.9.11.1 released

A new version of Idris, 0.9.11.1, has been released. You can find this on hackage, or from the
download page.

The tutorial has also been updated.

This release mostly improves robustness and efficiency. The user visible changes are:

  • Agda-style equational reasoning (in Syntax.PreorderReasoning)
  • case construct now abstracts over the scrutinee in its type
  • Added label type 'name (equivalent to the empty type). This is intended for field/effect disambiguation. name can be any valid identifier. Two labels are definitionally equal if they have the same name.
  • General improvements in error messages, especially %error_reverse annotation, which allows a hint as to how to display a term in error messages
  • --ideslave mode now transmits semantic information about many of the strings that it emits, which can be used by clients to implement semantic highlighting like that of the REPL. This has been implemented in the Emacs mode and the IRC bot, which can serve as examples.
  • New expression form: with [name] [expr] privileges the namespace name when disambiguating overloaded names. For example, it is possible to write with Vect [1,2,3] at the REPL instead of the (Vect _ _) [1,2,3], because the Vect constructors are defined in a namespace called Vect.
  • assert_smaller internal function, which marks an expression as smaller than a pattern for use in totality checking. e.g. assert_smaller (x :: xs) (f xs) asserts that f xs will always be structurally smaller than (x :: xs).
  • assert_total internal function, which marks a subexpression as assumed to be total, e.g assert_total (tail (x :: xs)).
  • Terminal width is automatically detected if Idris is compiled with curses support. If curses is not available, automatic mode assumes 80 columns.
  • Changed argument order for Prelude.Either.either.
  • Experimental neweffects library, intended to replace effects in the next release.

Internal changes are:

  • Faster parsing and elaboration
  • Smaller .ibc files
  • Pretty-printer now used for all term output

Thanks, as ever, to everyone who has helped put this release together. You can find their names in the CONTRIBUTORS file in the source repository.

Being research software, we expect there to be bugs. Please don’t keep them to yourself! If you find any problem, please report it on the github issue tracker. It is very helpful if you can also provide a small test case which reproduces your problem.

Also, do let us know how you get on in general either via the mailing list or the #idris channel on irc.freenode.net.