This CHANGELOG describes the history of already-released versions. Please see CHANGELOG_NEXT for changes merged into the main branch but not yet released.
-
The
idris2 --list-packagescommand now outputs information about the location and available TTC versions for each package it finds. It also shows the current Idris2 TTC version so you can spot packages that do not have a compatible TTC install. The TTC version tracks breaking changes to the compiled binary format of Idris2 code and it is separate from Idris2's semantic version (e.g. 0.7.0). A library without the correct TTC version installed will be ignored by the compiler when it tries to use that library as a dependency for some other package. -
The
idris2 --help pragmacommand now outputs the%hintpragma. -
The
idris2 --initcommand now ensures that package names are valid Idris2 identifiers. -
A new
idris2 --dump-installdir {ipkg-filename}command outputs the file path where Idris2 will install the given package ifidris2 --install {ipkg-filename}is called. -
Remove reference to column number parameter in help menu for
refinecommand. -
CLI errors will now be printed to
stderrinstead ofstdout. -
The
idris2 --execcommand now takes an arbitrary expression, not just the function name. -
Command-line arguments beginning with
--which are not a known flag now produce an error.
-
The Nix flake's
buildIdrisfunction now returns a set withexecutableandlibraryattributes. These supersede the now-deprecatedbuildandinstallLibraryattributes.executableis the same asbuildandlibraryis a function that takes an argument determining whether the library should be installed with sourcecode files or not; other than that,libraryfunctionally replacesinstallLibrary. -
The Nix flake's
buildIdrisexecutableproperty (previouslybuild) has been fixed in a few ways. It used to output a non-executable file for NodeJS builds (now the file has the executable bit set). It used to output the default Idris2 wrapper for Scheme builds which relies on utilities not guaranteed at runtime by the Nix derivation; now it rewraps the output to only depend on the directory containing Idris2's runtime support library. -
The Nix flake now exposes the Idris2 API package as
idris2Apiand Idris2's C support library assupport. -
A new
idris2 --dump-ipkg-jsonoption (requires either--find-ipkgor specifying the.ipkgfile) dumps JSON information about an Idris package. -
Support for macOS PowerPC added.
-
Multiline comments
{- text -}are now supported in ipkg files.
-
Autobind and Typebind modifier on operators allow the user to customise the syntax of operator to look more like a binder. See #3113.
-
Fixity declarations without an export modifier now emit a warning in peparation for a future version where they will become private by default.
-
Elaborator scripts were made to be able to access the visibility modifier of a definition, via
getVis. -
The language now has a
%foreign_implpragma to add additional languages to a%foreignfunction. -
Bind expressions in
doblocks can now have a type ascription. See #3327. -
Added syntax to specifying quantity for proof in with-clause.
-
Old-style parameter block syntax is deprecated in favor of the new one. In Idris1 you could write
parameters (a : t1, b : t2)but this did not allow for implicits arguments or quantities, this is deprecated. Use the new Idris2 syntax instead where you can writeparameters {0 t : Type} (v : t)to indicate if arguments are implicit or erased. -
Elaborator scripts were made to be able to get pretty-printed resugared expressions.
-
Fixed unification and conversion of binders with different
PiInfo. -
failingstatements with multi-line strings must now use"""for the string.
-
The compiler now differentiates between "package search path" and "package directories." Previously both were combined (as seen in the
idris2 --pathsoutput for "Package Directories"). Now entries in the search path will be printed under an "Package Search Paths" entry and package directories will continue to be printed under "Package Directories." TheIDRIS2_PACKAGE_PATHenvironment variable adds to the "Package Search Paths." Functionally this is not a breaking change. -
The compiler now supports
impossiblein a non-case lambda. You can now write\ Refl impossible. -
The compiler now parses
~x.funas unquotingxrather thanx.funand~(f 5).funas unquoting(f 5)rather than(f 5).fun. -
Totality checking will now look under data constructors, so
Just xswill be considered smaller thanJust (x :: xs). -
LHS of
with-applications are parsed asPWithAppinstead ofPApp. As a consequence,IWithAppappears inTTImpvalues in elaborator scripts instead ofIApp, as it should have been. -
MakeFutureprimitive is removed. -
Typst files can be compiled as Literate Idris.
-
minwas renamed toleftMostinLibraries.Data.Sorted{Map|Set}in order to be defined as inbase. -
Reflected trees now make use of
WithFCto replicate the new location tracking in the compiler. -
Constructors with certain tags (
CONS,NIL,JUST,NOTHING) are replaced with_builtin.<TAG>(eg_builtin.CONS). This allows the identity optimisation to optimise conversions between list-shaped things. -
Djot files can now be compiled as CommonMark style Literate Idris files.
-
Fixed a bug that caused
ttcsize to grow exponentially. -
Removes
prim__voidprimitive. -
Fixed
assert_totaloperation with coinductive calls -
IBindVarsupports arbitrary names.Stringin the signature is replaced byName. -
Fixes an issue where a local function defined in
whereorlettakes precedence over pattern variables in subsequent definitions.
-
Compiler can emit precise reference counting instructions where a reference is dropped as soon as possible. This allows you to reuse unique variables and optimize memory consumption.
-
Fix invalid memory read in
strSubStr. -
Fix memory leaks of
IORef. Now thatIORefholds values by itself,global_IORef_Storageis no longer needed. -
Pattern matching generates simpler code. This reduces
malloc/freeand memory consumption. It also makes debugging easier. -
Stopped useless string copying in the constructor to save memory. Also, name generation was stopped for constructors that have tags.
-
Special constructors such as
NilandNothingwere eliminated and assigned toNULL. -
Unbox
Bits32,Bits16,Bits8,Int32,Int16,Int8. These types are now packed into Value*. Now, RefC backend requires at least 32 bits for pointers. 16-bit CPUs are no longer supported. And we expect the address returned bymallocto be aligned with at least 32 bits. Otherwise it cause a runtime error. -
Rename C function to avoid confliction. But only a part.
-
Suppress code generation of
_arglistwrappers to reduce code size and compilation time. -
Removed
Value_Arglistto reduce Closure's allocation overhead and make code simply. -
Switch calling conventions based on the number of arguments to avoid limits on the number of arguments and to reduce stack usage.
-
Values that reference counters reaching their maximum limit are immortalized to prevent counter overflow. This can potentially cause memory leaks, but they occur rarely and are a better choice than crashing. Since overflow is no longer a concern, changing
refCounterfrominttouint16reduces the size ofValue_Header. -
Values often found at runtime, such as integers less than 100 are generate statically and share.
-
Constant
String,Int64,Bits64andDoublevalues are allocated statically as immortal and shared. -
A constant string for the representation of Pi type constructor is defined in the support library. Code that creates or pattern-matches on Pi types at runtime will now build instead of being rejected by the C compiler.
-
Fixed CSE soundness bug that caused delayed expressions to sometimes be eagerly evaluated. Now when a delayed expression is lifted by CSE, it is compiled using Scheme's
delayandforceto memoize them. -
More efficient
collect-request-handleris used. -
Add a codegen directive called
lazy=weakMemoto makeLazyandInfvalues weakly memoised. That is, once accessed, they are allowed to be not re-evaluated until garbage collector wipes them. -
Fixed the "cannot collect when multiple threads are active" error at the end of a program by using the thread-safe function
collect-rendezvousto pause all threads before starting the final GC.
-
Fixed CSE soundness bug that caused delayed expressions to sometimes be eagerly evaluated. Now when a delayed expression is lifted by CSE, it is compiled using Scheme's
delayandforceto memoize them. -
Add a codegen directive called
lazy=weakMemoto makeLazyandInfvalues weakly memoised. That is, once accessed, they are allowed to be not re-evaluated until garbage collector wipes them.
- The NodeJS executable output to
build/exec/now has its executable bit set. That file already had a NodeJS shebang at the top, so now it is fully ready to go after compilation.
-
Added pipeline operators
(|>)and(<|). -
The
voidhas been made pure.
-
Data.Vect.Views.Extrawas moved fromcontribtobase. -
Data.List.Lazywas moved fromcontribtobase. -
Added an
Interpolationimplementation for primitive decimal numeric types andNat. -
Added append
(++)forListversion ofAll. -
Moved helpers and theorems from contrib's
Data.HVectinto base'sData.Vect.Quantifiers.Allnamespace. Some functions were renamed and some already existed. Others had quantity changes -- in short, there were some breaking changes here in addition to removing the respective functions from contrib. If you hit a breaking change, please take a look at the PR and determine if you simply need to update a function name or if your use-case requires additional code changes in the base library. If it's the latter, open a bug ticket or start a discussion on the Idris Discord to determine the best path forward. -
Deprecate
bufferDatain favor ofbufferData'. These functions are the same with the exception of the latter dealing inBits8which is more correct thanInt. -
Added an alternative
TTImptraversal functionmapATTImp'taking the originalTTImpat the input along with already traversed one. ExistingmapATTImpis implemented through the newly added one. The similar alternative formapMTTImpis added too. -
Removed need for the runtime value of the implicit argument in
succNotLTEpred. -
Added utility functions
insertWith,insertFromWithandfromListWithforSortedMap. -
Implemented
leftMostandrightMostforSortedSet. -
Added
funExt0andfunExt1, functions analogous tofunExtbut for functions with quantities 0 and 1 respectively. -
SortedSet,SortedMapandSortedDMapmodules were extended with flipped variants of functions likelookup,contains,updateandinsert. -
Moved definition of
Data.Vect.nubByto the global scope asnubByImplto allow compile time proofs onnubByandnub. -
Removed need for the runtime value of the implicit length argument in
Data.Vect.Elem.dropElem. -
Some pieces of
Data.Fin.Extrafromcontribwere moved tobaseto modulesData.Fin.Properties,Data.Fin.ArithandData.Fin.Split. -
Decidable.Decidable.decisonis nowpublic export. -
Functoris implemented forPiInfofromLanguage.Reflection.TT. -
Quantity of the argument for the type being searched in the
searchfunction fromLanguage.Reflectionwas changed to be zero. -
Added
fromRightandfromLeftfor extracting values out ofEither, equivalent tofromJustforJust. -
Export
System.Signal.signalCodeandSystem.Signal.toSignal. -
Added implementations of
FoldableandTraversableforControl.Monad.Identity -
Added
Data.IORef.atomicallyfor the chez backend. -
Data.Nat.NonZerowas made to be an alias forData.Nat.IsSucc.SIsNonZerowas made to be an alias forItIsSucc, was marked as deprecated, and won't work on LHS anymore. -
Deprecated
toListfunction in favor ofPrelude.toListinData.SortedSet. -
Several functions like
pop,differenceMapandtoSortedMapwere added toData.Sorted{Map|Set} -
Added
kvListfunction toData.SortedMapandData.SortedMap.Dependentto have an unambiguoustoListvariant. -
Refactored
Uninhabitedimplementation forData.List.Elem,Data.List1.Elem,Data.SnocList.Elem, andData.Vect.Elemso it can be used for homogeneous (===) and heterogeneous (~=~) equality. -
Added
System.Concurrency.channelGetNonBlockingfor the chez backend. -
Added
System.Concurrency.channelGetWithTimeoutfor the chez backend. -
Added
System.Concurrency.getThreadIdfor the chez backend. -
unrestricted, for unpacking a!* a, now uses its argument once -
Added default definitions for
zipWith3andunzipWith3inZippableinterface. -
Quantifiersmodules forList,Vect,LazyList,List1andSnocListare harmonised among each other. Also, several existing functions related only toAllwere moved to appropriate namespace. Couple new functions forAnywere added. -
Add a function
altAllconnectingAlltoAnyusingAlternativeto allQuantifiersmodules. -
Fixed
blodwen-channel-get-with-timeoutimplementation with proper recursive call on loop and so that it now tracks time spent while attempting to acquire the mutex.
-
Data.Vect.Views.Extrawas moved fromcontribtobase. -
Data.List.Lazywas moved fromcontribtobase. -
Existing
System.Console.GetOptwas extended to support errors during options parsing in a backward-compatible way. -
Moved helpers from
Data.HVectto base library'sData.Vect.Quantifiers.Alland removedData.HVectfrom contrib. See the additional notes in the CHANGELOG under theLibrary changes/Basesection above. -
Some pieces of
Data.Fin.Extrafromcontribwere moved tobaseto modulesData.Fin.Properties,Data.Fin.ArithandData.Fin.Split. -
Function
invFinfromData.Fin.Extrawas deprecated in favour ofData.Fin.complementfrombase. -
The
Control.Algebralibrary fromcontribhas been removed due to being broken, unfixed for years, and on several independent occasions causing confusion with people picking up Idris and trying to use it.- Detailed discussion can be found in Idris2#72.
- For reasoning about algebraic structures and proofs, please see Frex and idris2-algebra.
-
Since they depend on
Control.Algebra, the followingcontriblibraries have also been removed:Control/Monad/Algebra.idrData/Bool/Algebra.idrData/List/Algebra.idrData/Morphisms/Algebra.idrData/Nat/Algebra.idr
-
prim__makeFuturefromSystem.Futureis reimplemented as%foreigninstead of using now removedMakeFutureprimitive -
The documentation for
Data.Validated.ValidatedLhas been corrected to reflect that it uses aList1as an error accumulator, not aList.
- Add a missing function parameter (the flag) in the C implementation of
idrnet_recv_bytes - Merge callbacks in linear
newSocketinto one single, linear callback, and allow the callback to produce any value
- Replaced
Requirementdata type with a new record that can be used to create any requirement needed. The constructors for the oldRequirementtype are now functions of the same names that return values of the new record type so in most situations there should be no compatibility issues.
- Module docstrings are now displayed for namespace indexes when documentation
is built via
--mkdoc. - Generated documentation are now removed via
--clean. - Module docstrings are now limited to the first paragraph in the
--mkdoc-generated documentation'sindex.htmlpage.
- New magic constants
__LOC__,__FILE__,__LINE__,__COL__substituted at parsing time with a string corresponding to the location, filename, line or column number associated to the magic constant's position. - The termination checker is now a faithful implementation of the 2001 paper on size-change termination by Lee, Jones and Ben-Amram.
- New function option
%unsafeto mark definitions that are escape hatches similar to the builtinsbelieve_me,assert_total, etc. - Elaborator scripts were made be able to record warnings.
- Rudimentary support for defining lazy functions (addressing issue #1066).
%hidedirectives can now hide conflicting fixities from other modules.- Fixity declarations can now be kept private with export modifiers.
- Forward-declarations whose visibility differ from their actual definition now emit a warning, unless the definition has no specified visibility (addressing Issue #1236).
- New
fromTTImp,fromName, andfromDeclsnames for customTTImp,Name, andDeclsliterals. - Call to
%macro-functions do not require theElabReflectionextension. - Default implicits are supported for named implementations.
- Elaborator scripts were made to be able to access project files, allowing the support for type providers and similar stuff.
- Elaborator scripts were made to be able to inspect which definitions are referred to by another definitions, and in which function currently elaborator is. These features together give an ability to inspect whether particular expressions are recursive (including mutual recursion).
- Adds documentation for unquotes
~( ). - Adds documentation for laziness and codata primitives:
Lazy,Inf,Delay, andForce. - Adds
--no-csecommand-line option to disable common subexpression elimination for code generation debugging. - Fixes a confusion between data and type constructors in the
:dicommand.
- Adds support for
CFLAGS,CPPFLAGS,LDFLAGSandLDLIBSto facilitate building on systems with non-standard installation locations of libraries (e.g. GMP). Versions of the flags with theIDRIS2_prefix can also be used and take precedence.
- Non-recursive top-level constants are compiled to eagerly evaluated constants in Chez Scheme.
- FFI declarations can now specify which
requireto perform, i.e. which library to load before executing the FFI. The syntax isscheme,racket:my-function,my-library.
- Generated JavaScript files now include a shebang when using the Node.js backend
- NodeJS now supports
popen/pclosefor theReadmode. getCharis now supported on Node.js andputCharis supported on both JavaScript backends.- Integer-indexed arrays are now supported.
-
If
IAlternativeexpression withFirstSuccessrule fails to typecheck, compiler now prints all tried alternatives, not only the last one. -
The elaboration of records has been changed so that the unbound implicits in the parameters' types become additional parameters e.g.
record HasLength (xs : List a) (n : Nat) where constructor MkHasLength 0 prf : length xs === nis now correctly elaborated to
record HasLength {0 a : Type} (xs : List a) (n : Nat) where constructor MkHasLength 0 prf : length xs === ninstead of failing with a strange error about (a) vs (a .rec).
-
Elaboration of datatypes now respects the totality annotations: defining a
coveringorpartialdatatype in a%default totalfile will not lead to a positivity error anymore. -
Fixed a bug in the positivity checker that meant
Lazycould be used to hide negative occurrences. -
Made sure that the positivity checker now respects
assert_totalannotations. -
We now raise a warning for conflicting fixity declarations. They are dangerous as Idris will pick an arbitrary one and so the meaning of an expression can depend e.g. on the order in which modules are imported.
- Additionally some conflicting fixity declarations in the Idris 2 compiler and libraries have been removed.
-
Constructors mentioned on the left hand side of functions/case alternatives are now included in the
Refers to (runtime)section of functions debug info. -
The Lifted IR Representation now has a
HasNamespacesimplementation inCompiler.Separateso Compilation Units at that stage can be generated. -
Added the
compile.casetree.missinglog topic, along with its use inTTImp.ProcessDef.genRunTime. This allows us to track when incompletecaseblocks get the runtime error added. -
Constant folding of trivial let statements and
believe_me. -
Fixed a bug that caused holes to appear unexpectedly during quotation of dependent pairs.
-
Fixed a bug that caused
fto sometimes be replaced byfxafter matchingfx = f x. -
Fixed a bug in the totality checker that missed indirect references to partial data.
-
Refactor the idris2protocols package to depend on fewer Idris2 modules. We can now export the package independently. To avoid confusing tooling about which
.ipkgto use, the package file is under the newly addedipkgsub-directory. -
Added
Libraries.Data.WithDefaultto facilitate consistent use of a default-if-unspecified value, currently forprivatevisibility.
-
Improved performance of functions
isNL,isSpace, andisHexDigit. -
Implements
FoldableandTraversablefor pairs, right-biased asFunctor. -
Added a constructor (
MkInterpolation) toInterpolation. -
Added an
Interpolationimplementation forVoid. -
Added
Composeinstances forBifunctor,BifoldableandBitraversable.
-
Deprecates
setByteandgetBytefromData.Bufferfor removal in a future release. UsesetBits8andgetBits8instead (withcastif you need to convert aBits8to anInt), as their values are limited, as opposed to the assumption insetBytethat the value is between 0 and 255. -
Adds RefC support for 16- and 32-bit access in
Data.Buffer. -
Add
Showinstance toData.Vect.Quantifiers.Alland add a few helpers for listy computations on theAlltype. -
Add an alias for
HVecttoAll idinData.Vect.Quantifiers.All. This is the approach to getting a heterogeneousVectof elements that is general preferred by the community vs. a standalone type as seen incontrib. -
Add
Data.List.HasLengthfrom the compiler codebase slash contrib library but adopt the type signature from the compiler codebase and some of the naming from the contrib library. The type ended up beingHasLength n xsrather thanHasLength xs n. -
Moved
Data.SortedMapandData.SortedSetfrom contrib to base. -
Added missing buffer primitives (chezscheme only):
setInt8,getInt8,getInt16,setInt64,getInt64 -
Added new buffer (set/get) functions for built-in types
Bool,Nat,Integer. -
Tightened the types of:
setInt16(now takes anInt16instead of anInt),setInt32(now takes anInt32instead of anInt),getInt32(now returns anInt32instead of anInt) -
Adds left- and right-rotation for
FiniteBits. -
Adds
Vect.permutefor applying permutations toVects. -
Adds
Vect.kSplitsandVect.nSplitsfor splitting aVectwhose length is a known multiple of twoNats (k * n) into k vectors of length n (and vice-versa). -
Adds
Vect.allFinsfor generating all theFinelements as aVectwith matching length to the number of elements. -
Add
withRawMode,enableRawMode,resetRawModefor character at a time input on stdin. -
Adds extraction functions to
Data.Singleton. -
TTImpreflection functions are nowpublic export, enabling use at the type-level. -
Implemented
Eq,Ord,Semigroup, andMonoidforData.List.Quantifiers.All.AllandData.Vect.Quantifiers.All.All. -
Generalized
imapPropertyinData.List.Quantifiers.All.AllandData.Vect.Quantifiers.All.All. -
Add
zipPropertyWith,traverseProperty,traversePropertyRelevant,mapPropertyRelevant,(++),tabulateandremembertoData.Vect.Quantifiers.All.All. -
Add
anyToFintoData.Vect.Quantifiers.Any, converting theAnywitness to the index into the corresponding element. -
Implemented
OrdforLanguage.Reflection.TT.Name,Language.Reflection.TT.NamespaceandLanguage.Reflection.TT.UserName. -
Adds
leftmostandrightmosttoControl.Order, a generalisation ofminandmax. -
Adds
evenandoddtoData.Integral. -
EqandOrdimplementations forFin nnow run in constant time. -
Adds
getTermColsandgetTermLinesto the base library. They return the size of the terminal if either stdin or stdout is a tty. -
The
Data.List1functionsfoldr1andfoldr1Byare nowpublic export. -
Added
uncons' : List a -> Maybe (a, List a)tobase. -
Adds
infixOfByandisInfixOfByintoData.List. -
Adds
WithDefaultintoLanguage.Reflection.TTImp, mirroring compiler addition. -
Adds updating functions to
SortedMapandSortedDMap. -
Adds
groupedfunction toData.Listfor splitting a list into equal-sized slices. -
Implements
OrdforCountfromLanguage.Reflection. -
Implements
MonadStateforData.Refwith a named implementation requiring a particular reference. -
Adds implementations of
ZippabletoEither,Pair,Maybe,SortedMap. -
Adds a
ComposeandFromApplicativenamed implementations forZippable. -
Adds
Semigroup,Applicative,TraversableandZippableforData.These. -
Adds bindings for IEEE floating point constants NaN and (+/-) Inf, as well as machine epsilon and unit roundoff. Speeds vary depending on backend.
-
A more generalised way of applicative mapping of
TTImpexpression was added, calledmapATTImp; the originalmapMTTimpwas implemented through the new one. -
Adds
Data.Vect.foldrImplGoLemma. -
Refinterface fromData.RefinheritsMonadand was extended by a function for value modification implemented through reading and writing by default.
-
Changes
getNProcessorsto return the number of online processors rather than the number of configured processors. -
System'sdienow prints the error message on stderr rather than stdout -
Adds
popen2to run a subprocess with bi-directional pipes. -
A function
popen2Waitwas added to wait for the process started withpopen2function and clean up all system resources (to not to leave zombie processes in particular). -
Function
getStringAndFreefromSystem.File.ReadWritewas given an extra argument of typeFileto return an empty string if no error happened.
-
Adds
Data.List.Sufficient, a small library defining a structurally inductive view of lists. -
Remove
Data.List.HasLengthfromcontriblibrary but add it to thebaselibrary with the type signature from the compiler codebase and some of the naming from thecontriblibrary. The type ended up beingHasLength n xsrather thanHasLength xs n. -
Adds an implementation for
Functor Text.Lexer.Tokenizer.Tokenizer. -
Adds
modFinandstrengthenModtoData.Fin.Extra. These functions reason about the modulo operator's upper bound, which can be useful when working with indices (for example). -
Existing specialised variants of functions from the
TraversableforLazyListwere made to be indeed lazy by the effect, but their requirements were strengthened fromApplicativetoMonad. -
Implements
SizedforData.Seq.SizedandData.Seq.Unsized.
-
In
Control.DivideAndConquer: a port of the paper "A Type-Based Approach to Divide-And-Conquer Recursion in Coq" by Pedro Abreu, Benjamin Delaware, Alex Hubers, Christa Jenkins, J. Garret Morris, and Aaron Stump. https://doi.org/10.1145/3571196 -
Ports the first half of "Deferring the Details and Deriving Programs" by Liam O'Connor as
Data.ProofDelay. https://doi.org/10.1145/3331554.3342605 http://liamoc.net/images/deferring.pdf
- The
datasubfolder of an installed or local dependency package is now automatically recognized as a "data" directory by Idris 2. See the documentation on Packages for details. - The compiler no longer installs its own C support library into
${PREFIX}/lib. This folder's contents were always duplicates of files installed into${PREFIX}/idris2-${IDRIS2_VERSION}/lib. If you need to adjust any tooling or scripts, point them to the latter location which still contains these installed library files. - Renamed
support-cleanMakefile target toclean-support. This is in line with most of theinstall-<something>andclean-<something>naming. - Fixes an error in the
Makefilewhere settingIDRIS2_PREFIXcaused bootstrapping to fail. - Updates the docs for
envvarsto match the changes introduced in #2649. - Both
make installandidris2 --install...now respectDESTDIRwhich can be set to install into a staging directory for distro packaging. - Updates the docs for
envvarsto categorise when environment variables are used (runtime, build-time, or both). - Fixed build failure occuring when
make -jis in effect. - Add
clean_namesfunction totestutils.shto normalise machine names
- New experimental Scheme based evaluator (only available if compiled via
Chez scheme or Racket). To access this at the REPL, set the evaluator mode to
the scheme based evaluator with
:set eval scheme. - New option
evaltimingto time how long an evaluation takes at the REPL, set with:set evaltiming. - Renames
:lp/loadpackageto:package. - Adds
:import, with the same functionality as:module. - Adds the ability to request detailed help via
:help <replCmd>, e.g.:help :helpor:help :let. This also works with the:?and:haliases.
-
There were two versions of record syntax used when updating records:
record { field = value } rand
{ field := value } rThe former is now deprecated in favour of the latter syntax. The compiler will issue a warning when using the
recordkeyword. -
Interpolated strings now make use of
concatwhich is compiled intofastConcat. The interpolated slices now make use of theInterpolationinterface available in the prelude. It has only one methodinterpolatewhich is called for every expression that appears within an interpolation slice."hello \{world}"is desugared into
concat [interpolate "hello ", interpolate world]
This allows you to write expressions within slices without having to call
showbut for this you need to implement theInterpolationinterface for each type that you intend to use within an interpolation slice. The reason for not reusingShowis thatInterpolationandShowhave conflicting semantics, typically this is the case forStringwhich adds double quotes around the string. -
Adds a
failingblock that requires its body to fail with a compile error. Optionally this block may contain a string which is checked to be contained in the error message. -
Bodies of
mutual,failing,usingandparametersblocks are required to be indented comparing to the position of the keyword. -
%nomanglehas been deprecated in favour of%export. -
Records now support DataOpts, i.e. we can write things like
record Wrap (phantom : Type) (a : Type) where [search a] -- this was previously not supported constructor MkWrap unWrap : a
-
Adds ability to forward-declare interface implementations, e.g.:
implementation IsOdd Nat -- forward declare for use in `IsEven` implementation IsEven Nat where isEven 0 = True isEven (S k) = not $ isOdd k implementation IsOdd Nat where isOdd 0 = False isOdd (S k) = not $ isEven k
-
Adds ability to forward-declare records, e.g.:
record B record A where b : B record B where a : A
- Removes deprecated support for
voidprimitive. Nowvoidis supported viaprim__void. - Adds
%deprecatepragma that can be used to warn when deprecated functions are used. - Package files now support a
langversionfield that can be used to specify what versions of Idris a package supports. As with dependency versions,>,<,>=, and<=can all be used.- For example,
langversion >= 0.5.1.
- For example,
- Alternatives for primitive types of the
Core.TT.Constantare moved out to a separate data typePrimTypes. Signatures of functions that were working withConstantare changed to usePrimTypeswhen appropriate. - Codegens now take an additional
Ref Syn SyntaxInfoargument. This empowers compiler writers to pretty print core terms e.g. to add comments with the original type annotations in the generated code. Refc.showcCleanStringCharforgot some symbols which have now been added, ensuring the string is properly cleaned.- Constant-folds all casts and integral expressions (with the exception of type
Int), leading to improved performance. - Increases accuracy of error reporting for keywords.
- Adds the
eval.stuck.outofscopelog topic in order to be able to spot when we get stuck due to a function being out of scope. - Improves the error reporting for syntactically incorrect records.
IPragmanow carries anFCwith it for better error reporting.- Adds the number of enum constructors to enum types during codegen, to allow
for trivial conversion to, e.g.,
Bits32. - Adds constant-folding for
Natliterals. - Fixes
CyclicMetainTTImp.ProcessDefbeing considered a recoverable error.
-
The IDE protocol and its serialisation to S-Expressions are factored into a separate module hierarchy Protocol.{Hex, SExp, IDE}.
-
File context ranges sent in the IDE protocol follow the same convention as Bounds values in the parser:
- all offsets (line and column) are 0-based.
- Lines: start and end are within the bounds
- Column:
- start column is within the bounds;
- end column is after the bounds.
This changes behaviour from previous versions of the protocol. Matching PRs in the emacs modes:
-
The IDE protocol now supports specifying a socket and hostname via the
--ide-mode-socketflag, allowing multiple IDE server instances to run on the same machine.
- Case-split no longer generates syntactically invalid Idris when splitting on auto-implicits.
- Case-split no longer shadows the function name when an internal named argument has the same name as the function.
- Case-split now avoids using upper-case names for pattern variables.
elemByandelemare now defined for anyFoldablestructure. The specialised versions defined inData.(List/SnocList/Vect)have been removed.filterandmapMaybefunctions forListwere moved topreludefrombase.- Basic functions of
SnocList((++),length,filter,mapMaybe) and implementations ofEqandOrdwere moved topreludefrombase. This may lead to a need to qualifying functions (e.g.List.filter) due to possible ambiguity. - "Fish" and "chips" operators of
SnocListwere moved toPrelude.TypesfromPrelude.Basics. - Adds
contrafor returning the opposite of a givenOrdering. - Fix
pow, using backend implementations. - Add
subtractalias for(-)
- Adds
System.run, which runs a shell command, and returns the stdout and return code of that run. - Adds escaped versions of
System.system,Systen.File.popen, andSystem.run, which take a list of arguments, and escapes them. - Adds the
Injectiveinterface in moduleControl.Function. - Changes
System.pcloseto return the return code of the closed process. - Deprecates
base'sData.Nat.Order.decideLTEin favor ofData.Nat.isLTE. - Removes
base's deprecatedSystem.Directory.dirEntry. UsenextDirEntryinstead. - Removes
base's deprecatedData.String.fastAppend. UsefastConcatinstead. System.File.Buffer.writeBufferDatanow returns the number of bytes that have been written when there is a write error.System.File.Buffer.readBufferDatanow returns the number of bytes that have been read into the buffer.- Adds the
Data.List.Quantifiers.InterleavingandData.List.Quantifiers.Splitdatatypes, used for provably splitting a list into a list of proofs and a list of counter-proofs for a given property. - Properties of the
List1type were moved fromData.List1toData.List1.Properties. Syntax.PreorderReasoningwas moved tobasefromcontrib.- Move the types and functions in
Data.Vect.Quantifiersto their respective namespaces (Allfor all-related things, andAnyfor any-related things) to make the code consistent with the other quantifiers (ListandSnocList). - Set the
allandanyfunctions for proof-quantifiers topublic exportinstead ofexport, allowing them to be used with auto-implicitIsYes. - Legacy duplicating type
Given(with constructorAlways) is removed from theDecidable.Decidable. Use the typeIsYes(with constructorItIsYes) from the same module instead. - Adds
Data.List1.Elem, ported fromData.List.Elem. - Adds
Data.List1.Quantifiers, ported fromData.List.Quantifiers. - Changes the order of arguments in
RWSTtransformer's runners functions (runRWST.evalRWST,execRWST), now transformer argument is the last, as in the other standard transformers, likeReaderTandStateT. - Adds
Data.Fin.finToNatEqualityAsPointwise, which takes a witness offinToNat k = finToNat land provesk ~~~ l. - Drop first argument (path to the
nodeexecutable) fromSystem.getArgson the Node.js backend to make it consistent with other backends. - Adds
Uninhabitedinstances forFZ ~~~ FS kandFS k ~~~ FZ. - Change behavior of
channelPuton the Racket backend to match the behavior on the Chez backend. fGetLinehas been marked ascoveringinstead oftotal.- Adds the ability to derive
FunctorandTraversableusing%runElab derivein the implementation definition. - Fixes memory leaks in
currentDir,fGetLine, andfGetChars. - Fixes
natToFinLTbeing O(n) by proving thatSo (x < n)impliesLT x n, allowing the compiler to optimisenatToFinLTaway. - Fixes
SnocList.foldrandSnocList.foldMapto be performant and stack-safe. - Add
insertAt,deleteAtandreplaceAtforList - Add
scanr,scanr1andunsnocforVect - Implement
DecEqforSnocList
- Refactors
Test.Golden.runTestto useSystem.Concurrencyfrom the base libraries instead ofSystem.Futurefromcontrib. In addition to reducing the dependency oncontribin the core of Idris2, this also seems to provide a small performance improvement formake test. - Splits
runnerintorunnerWithfor processing the options and configuring the test pools, and a newrunnerfunction for reading options from the command-line.
System.Randomsupport forIntchanged toInt32; it already limited itself to 32 bits but now that is codified. JavaScript backends are now supported.- Removes
contrib's deprecatedData.Num.Implementationsmodule. SeePrelude.Interfacesinstead. - Implements
Show tok => Show (ParsingError tok)forText.Parser.Core. Control.Linear.LIOhas been moved fromcontribstolinearto guarantee that idris2 does not need to rely on contribs anymore.
Control.Linear.Networknow supportsconnectin the linear environment, and can also access thesendBytes,recvBytesandrecvAllBytesfunctions of the underlyingSocketmodule.
-
Creates the
papersandlinearlibraries to remove bits of type theory and pl propaganda fromcontriband instead clearly have them as implementations of their respective papers. -
Creates
Data.Linear.{Notation,LEither,LMaybe,LVect,Pow}. -
Moves
Data.Container, based on the papers "Categories of Containers" by Michael Abbott, Thorsten Altenkirch, and Neil Ghani, and "Derivatives of Containers" by Michael Abbott, Thorsten Altenkirch, Neil Ghani, and Conor McBride, topapers. https://doi.org/10.1007/3-540-36576-1_2 https://doi.org/10.1007/3-540-44904-3_2 -
Moves the implementation of "Indexed induction-recursion" by Dybjer and Setzer to
papers. https://doi.org/10.1016/j.jlap.2005.07.001 -
Ports "How to Take the Inverse of a Type" by Daniel Marshall and Dominic Orchard as
Data.Linear.{Communications,Diff,Inverse}. https://doi.org/10.4230/LIPIcs.ECOOP.2022.5 -
Moves
Data.OpenUnion, inspired by the paper "Freer monads, more extensible effects" by Oleg Kiselyov and Hiromi Ishii, topapers. https://doi.org/10.1145/2887747.2804319 -
Moves
Data.Recursion.Free, partially based on "Turing-Completeness Totally Free" by Conor McBride, topapers. https://doi.org/10.1007/978-3-319-19797-5_13 -
Moves
Data.Tree.Perfecttopapers. -
Moves
Data.Vect.Binary, taken from the paper "Heterogeneous Binary Random-access Lists" by Wouter Swierstra, topapers. https://doi.org/10.1017/S0956796820000064 -
Ports "Applications of Applicative Proof Search" by Liam O'Connor as
Search.{Generator,HDecidable,Negation,Properties,CTL,GCL}. https://doi.org/10.1145/2976022.2976030 -
Implements "Dependent Tagless Final" by Nicolas Biri as
Language.Tagless. https://doi.org/10.1145/3498886.3502201 -
Ports Todd Waugh Ambridge's Agda blog post series "Search over uniformly continuous decidable predicates on infinite collections of types" as
Search.Tychonoff. https://www.cs.bham.ac.uk/~txw467/tychonoff/InfiniteSearch1.html -
Ports "Auto in Agda - Programming proof search using reflection" by Wen Kokke and Wouter Swierstra as
Search.Auto. https://doi.org/10.1007/978-3-319-19797-5_14 -
Ports "Computing with Generic Trees in Agda" by Stephen Dolan as
Data.W. https://doi.org/10.1145/3546196.3550165
- Adds docstrings for the lambda-lifted IR.
- Package files are now installed along-side build artifacts for installed
packages. This means all transitive dependencies of packages you specify with
the
dependsfield are added automatically. - No longer builds
contribandpapersduring bootstrap, as these may rely on new features not yet present in the bootstrap version of Idris2.
- Missing methods in implementations now give a compile time error. This was always the intended behaviour, but until now had not been implemented!
- Records now work in
parametersblocks andwhereclauses. - Implementations of interfaces now work in
parametersblocks andwhereclauses - The syntax for Name reflection has changed, and now requires a single brace
instead of a double brace, e.g.
`{x} - Raw string literals allows writing string while customising the escape
sequence. Start a string with
#"in order to change the escape characters to\#, close the string with"#. Remains compatible with multiline string literals. - Interpolated strings allows inserting expressions within string literals
and avoid writing concatenation explicitly. Escape a left curly brace
\{to start an interpolation slice and close it with a right curly brace}to resume writing the string literal. The enclosed expression must be of typeString. Interpolated strings are compatible with raw strings (the slices need to be escaped with\#{instead) and multiline strings. - We now support ellipses (written
_) on the left hand side of awithclause. Ellipses are substituted for by the left hand side of the parent clause i.e.
filter : (p : a -> Bool) -> List a -> List a
filter p [] = []
filter p (x :: xs) with (p x)
_ | True = x :: filter p xs
_ | False = filter p xsmeans
filter : (p : a -> Bool) -> List a -> List a
filter p [] = []
filter p (x :: xs) with (p x)
filter p (x :: xs) | True = x :: filter p xs
filter p (x :: xs) | False = filter p xs- Added incremental compilation, using either the
--incflag or theIDRIS2_INC_CGSenvironment variable, which compiles modules incrementally. In incremental mode, the final build step is much faster than in whole program mode (the default), at the cost of runtime performance being about half as good. The--whole-programflag overrides incremental compilation, and reverts to whole program compilation. Incremental compilation is currently supported only by the Chez Scheme back end. This is currently supported only on Unix-like platforms (not yet Windows)- Note that you must set
IDRIS2_INC_CGSwhen building and installing all libraries you plan to link with an incremental build. - Note also that this is experimental and not yet well tested!
- Note that you must set
- The type checker now tries a lot harder to avoid reducing expressions where it is not needed. This can give a huge performance improvement in programs that potentially do a lot of compile time evaluation. However, sometimes reducing expressions can help in totality and quantity checking, so this may cause some programs not to type check which previously did - in these cases, you will need to give the reduced expressions explicitly.
- Added
--list-packagesCLI option. - Added
--totalCLI option.
Changed
- Removed
Data.Strings. UseData.Stringinstead.
- Reimplement the
Channelsprimitive in the Chez-Scheme backend since it had some non-deterministic properties (see issue #1552). NOTE: Due to complications with race-conditions, Chez not having channels built-in, etc, the reimplementation changes the semantics slightly:channelPutno longer blocks until the value has been received under thechezbackend, but instead only blocks if there is already a value in the channel that has not been received. With thanks to Alain Zscheile (@zseri) for help with understanding condition variables, and figuring out where the problems were and how to solve them.
- The old system of interfaces for defining order relations (to say,
for instance, that LTE is a partial order) is replaced with a new
system of interfaces. These interfaces defines properties of binary
relations (functions of type
ty -> ty -> Type), and orders are defined simply as bundles of these properties.
- Added a new makefile target to install Idris 2 library documentation. After
make install, typemake install-libdocsto install it. After that, the index file can be found here:idris2 --libdir`/docs/index.html`.
- Desugar non-binding sequencing in do blocks to (
>>) (#1095) - Multiline Strings with
"""as delimiters (#1097) - Force strict indentation after usage of
withkeyword (#1107) - The syntax for parameter blocks has been updated. It now allows to declare implicit parameters and give multiplicities for parameters. The old syntax is still available for compatibility purposes but will be removed in the future.
- Add support for SnocList syntax:
[< 1, 2, 3]desugars intoLin :< 1 :< 2 :< 3and their semantic highlighting. - Underscores can be used as visual separators for digit grouping purposes in
integer literals:
10_000_000is equivalent to10000000and0b1111_0101_0000is equivalent to0b111101010000. This can aid readability of long literals, or literals whose value should clearly separate into parts, such as bytes or words in hexadecimal notation.
- Added more optimisations and transformations, particularly on case blocks, list-shaped types, and enumerations, so generated code will often be slightly faster.
- Added
--profileflag, which generates profile data if supported by a back end. Currently supported by the Chez and Racket backends. - New
%builtinpragma for compiling user defined natural numbers to primitiveIntegers (see the docs) - The
versionfield in.ipkgfiles is now used. Packages are installed into a directory which includes its version number, and dependencies can have version number ranges using<=,<,>=,>,==to express version constraints. Version numbers must be in the form of integers, separated by dots (e.g.1.0,0.3.0,3.1.4.1.5etc) - Idris now looks in the current working directory, under a subdirectory
dependsfor local installations of packages before looking globally. - Added an environment variable
IDRIS2_PACKAGE_PATHfor extending where to look for packages. - Added compiler warnings flags (
-Wprefix):-Wno-shadowing: disable shadowing warnings.-Werror: treat warnings as errors.
- Experimental flag (
-Xcheck-hashes) to check hashes instead of filesystem times to determine if files should be recompiled. Should help with CI/CD caching.
- Added
:searchcommand, which searches for functions by type :load/:land:cdcommands now only accept paths surrounded by double quotes- Added a timeout to "generate definition" and "proof search" commands,
defaulting to 1 second (1000 milliseconds) and configurable with
%search_timeout <time in milliseconds>
Added
BifoldableandBitraversableinterfaces.FoldableaddfoldlM,foldMap, andtoList.Monadinterface>=>,<=<(Kleisli Arrows), and flipped bind (=<<).PairApplicative and Monad implementations.SnocListdatatype (fliped cons of a linked list).(.:)function "blackbird operator" (Composition of a two-argument function with a single-argument one.)onfunction (Eg,((+) `on` f) x y = f x + f y)
Changed
===,~=~, and<+>operator precedence- Exctracted
Castinterface and implementations fromPrelude.TypestoPrelude.Cast - Renamed
Data.StringstoData.String
Hidden
countFrom
Added
Control.Applicative.Const.- New
Control.MonadMonad Transformers types. Data.Bits, an interface for bitwise operations.Data.ColistandData.Colist1.Data.Contravariantinterface for contravariant functors.Data.Listunzipfunction.Data.List1zip*andunzip*functions.Data.SnocList.Data.StreamunzipWithandunzipWith3fuctions.Data.VectunzipWithandunzipWith3functions.System.FilewithFileand total read functions.
Changed:
- Restructured Monad Transformers in
Control.Monad zipprecedence
Added
Control.Validation, a library for dependent types input validation.System.Console.GetOpt, a library for specifying and parsing command line options.
- Moved
tests/Lib.idrto package asTest/Golden.idr. - Removed
contrib/Test/Golden.idrwhich duplicated the test framework now in thetestpackage.
- Now always uses
blodwen-sleepinstead ofidris2_sleepin order to not block the Racket runtime whensleepis called. - Redid condition variables in the Racket codegen based on page 5 of the
Microsoft Implementing CVs paper.
Previously, they were based on an implementation using semaphores and
asynchronous channels, which worked apart from
broadcast. The rework fixesbroadcastat the cost of losingwait-timeoutdue to increased complexity of their internals and interactions between their associated functions.
- Now use
Numberto represent up to 32 bit precision signed and unsigned integers.Int32still goes viaBigIntfor multiplication to avoid precision issues when getting results larger thanNumber.MAX_SAFE_INTEGER.Bits32goes viaBigIntfor multiplication for the same reason as well as for all bitops, sinceNumberuses signed 32 bit integers for those. - Now use
Numberinstead ofBigIntto represent up to 32 bit fixed precision signed and unsigned integers. This should make interop with the FFI more straight forward, and might also improve performance.
- This code generator produces many Chez Scheme files and compiles them separately instead of producing one huge Scheme program. This significantly reduces the amount of memory needed to build large programs. Since this backend will skip calling the Chez compiler on modules that haven't changed, it also leads to shorter compilation times in large codebases where only some files have changed -- for example when developing Idris2 code generators. The codegen has a large parallelisation potential but at the moment, it is significantly slower for a full rebuild of a large codebase (the code generation stage takes about 3x longer).
- The API now exposes
Compiler.Separate.getCompilationUnits, which can be used for separate code generation by any backend. - New fixed precision signed integer types
Int8,Int16,Int32, andInt64where added. In addition, all integral types now properly support all arithmetic and bitwise operations. - The compiler now provides primitive cast operations for all combinations
of primitives with the exception of going from
DoubletoCharand back, and going fromStringtoChar. - A new pragma
%doubleLitto support overloaded floating point literals was added.
- Lots of small performance improvements, some of which may be especially noticeable in programs that do a lot of type level evaluation.
- Added HTML documentation generation, using the
--mkdocflag - Support for auto-completion in bash-like shells was added.
- Fixed case-splitting to respect any indentation there may be in the term being case-split and the surrounding symbols, instead of filtering out the whitespace and putting it back as indentation.
Library changes:
-
Overhaul of the concurrency primitives:
-
Renamed
System.Concurrency.RawtoSystem.Concurrency. -
Modified the implementation of
Prelude.IO.forkin the Chez Scheme RTS, which now returns a semaphore instead of a thread object. This allows the main thread to wait for the child thread to finish (see next bullet). The Racket implementation already returned a thread descriptor, which could be used to wait for the thread to finish. -
Added
Prelude.IO.threadWaitwhich waits for a thread, identified by aThreadID, to finish. This operation is supported by both the Chez Scheme and the Racket RTS'es. -
Added semaphores to
System.Concurrency, supported by both the Chez Scheme and Racket RTS'es. -
Added barriers to
System.Concurrency, supported by both the Chez Scheme and Racket RTS'es. -
Added synchronous channels to
System.Concurrency, supported by both the Chez Scheme and Racket RTS'es. -
Fixed the support for mutexes in the Racket RTS. Formerly, they were implemented with semaphores, and calling
mutexReleasemultiple times would increment the internal counter multiple times, allowing multiple concurrentmutexAcquireoperations to succeed simultaneously. Currently,mutexReleasefails when called on a mutex which isn't owned. (However,mutexReleasedoes not check whether the mutex is in fact owned by the current thread, which may be a bug.) -
Modified the support for condition variables in the Racket RTS. Formerly, they were implemented using synchronous channels, meaning that: +
conditionSignalwas a blocking operation; and + callingconditionSignalon a condition variable on which no thread was waiting would wake the next thread to callconditionWait, whereas condition variables are supposed to be stateless, and only wake threads already in the queue. The implementation was replaced with an implementation based on asynchronous channels and mutexes, based on the following paper: Implementing Condition Variables with Semaphores by Andrew Birrell -
Removed
threadIDandblodwen-thisthread. Formerly, in the Chez Scheme backend, this function returned "the thread ID of the current thread" as a value of typeThreadID. However,forkreturned a "thread object" as a value of typeThreadID. These are different kinds of values in Chez Scheme. As there was nothing one could do with a value of typeThreadID, I chose to removethreadID, as it allowed me to implementthreadWaitmore easily. -
Renamed
blodwen-lockandblodwen-unlocktoblodwen-mutex-acquireandblodwen-mutex-releasefor consistency, as these functions are referred to with acquire and release both in Chez Scheme and in the Idris2 concurrency module.
-
-
Added
Data.HVectincontrib, for heterogeneous vectors. -
Various other library functions added throughout
baseandcontrib
Command-line options changes:
- Added
--colorand--no-coloroptions for colored terminal output. Color is enabled by default. - Added
--console-width <auto|n>option for printing margins. By default theautooption is selected, the result is that the compiler detects the current terminal width and sets it as the option value, otherwise a user value can be provided. An explicit0has the effect of simulating a terminal with unbounded width.
Language and compiler changes:
-
Removed multiplicity subtyping, as this is unsound and unfortunately causes more problems than it solves. This means you sometimes now need to write linear versions of functions as special cases. (Though note that the 1 multiplicity is still considered experimental, so hopefully this will change for the better in the future!)
-
Added new syntax for named applications of explicit arguments:
f {x [= t], x [= t], ...}f {x [= t], x [= t], ..., _} -
Added syntax for binding all explicit arguments (in the left hand side);
f {} -
Added new syntax for record updates (without the need for the
recordkeyword):{x := t, x $= t, ...} -
Local implementations of interfaces (in
letorwhereblocks) now work, along with%hintannotations on local definitions, meaning that local definitions can be searched in auto implicit search.- Note, though, that there are still some known limitations (with both local hints and local implementations) which will be resolved in the next version.
-
New experimental
refccode generator, which generates C with reference counting. -
Added primitives to the parsing library used in the compiler to get more precise boundaries to the AST nodes
FC.
REPL/IDE mode changes:
- Added
:color (on|off)option for colored terminal output. - Added
:consolewidth (auto|n)option for printing margins. Mirrors the command-line option.
Language changes:
Bits8,Bits16,Bits32andBits64primitive types added, with:Num,Eq,OrdandShowimplementations.- Casts from
Integer, for literals - Casts to
Int(except forBits64which might not fit),IntegerandString - Passed to C FFI as
unsigned - Primitives added in
Data.Buffer
- Elaborator reflection and quoting terms
- Requires extension
%language ElabReflection - API defined in
Language.Reflection, including functions for getting types of global names, constructors of data types, and adding new top level declarations - Implemented
%macrofunction flag, to remove the syntactic noise of invoking elaborator scripts. This means the function must always be fully applied, and is run under%runElab
- Requires extension
- Add
import X as Y- This imports the module
X, adding aliases for the definitions in namespaceY, so they can be referred to asY.
- This imports the module
donotation can now be qualified with a namespaceMyDo.doopens adoblock where the>>=operator used isMyDo.(>>=)
Library changes:
IOoperations in thepreludeandbaselibraries now use theHasIOinterface, rather than usingIOdirectly.- Experimental
Data.Linear.Arrayadded tocontrib, supporting mutable linear arrays with constant time read/write, convertible to immutable arrays with constant time read.- Anything in
Data.Linearincontrib, just like the rest ofcontrib, should be considered experimental with the API able to change at any time! Further experiments inData.Linearare welcome :).
- Anything in
- Experimental
Control.Linear.LIOadded tocontrib, supporting computations which track the multiplicities of their return values, which allows linear resources to be tracked. - Added
Control.Monad.ST, for update in-place viaSTRef(which is likeIORef, but can escape fromIO). Also addedData.Refwhich provides an interface to bothIORefandSTRef. - Added
Control.ANSIincontrib, for usage of ANSI escape codes for text styling and cursor/screen control in terminals.
Command-line options changes:
- Removed
--ide-mode-socket-withoption.--ide-mode-socketnow accepts an optionalhost:portargument. - Added options to override source directory, build directory and output
directory:
--source-dir,--build-dir,--output-dir.- These options are also available as fields in the package description:
sourcedir,builddir,outputdir.
- These options are also available as fields in the package description:
Compiler changes:
- It is now possible to create new backends with minimal overhead.
Idris.Driverexposes the functionmainWithCodegensthat takes a list of codegens. The feature in documented here. - New code generators
nodeandjavascript.
REPL/IDE mode changes:
- Implemented
:modulecommand, to load a module during a REPL session. - Implemented
:doc, which displays documentation for a name. - Implemented
:browse, which lists the names exported by a namespace. - Added
:psnext, which continues the previous proof search, looking for the next type correct expression- Correspondingly, added the IDE mode command
proof-search-next(which takes no arguments)
- Correspondingly, added the IDE mode command
- Added
:gdnext, which continues the previous program search, looking for the next type correct implementation- Correspondingly, added the IDE mode command
generate-def-next(which takes no arguments)
- Correspondingly, added the IDE mode command
- Improved program search to allow deconstructing intermediate values, and in simple cases, the result of recursive calls.
The implementation is now self-hosted. To initialise the build, either use
the bootstrapping version of Idris2
or build from the generated Scheme, using make bootstrap.
Language changes:
total,coveringandpartialflags on functions now have an effect.%default <totality status>has been implemented. By default, functions must be at leastcovering- That is,
%default coveringis the default status.
- That is,
- Fields of records can be accessed (and updated) using the dot syntax,
such as
r.field1.field2orrecord { field1.field2 = 42 }. For details, see the "records" entry in the user manual - New function flag
%tcinlinewhich means that the function should be inlined for the purposes of totality checking (but otherwise not inlined). This can be used as a hint for totality checking, to make the checker look inside functions that it otherwise might not. - %transform directive, for declaring transformation rules on runtime expressions. Transformation rules are automatically added for top level implementations of interfaces.
- A %spec flag on functions which allows arguments to be marked for partial evaluation, following the rules from "Scrapping Your Inefficient Engine" (ICFP 2010, Brady & Hammond)
- To improve error messages, one can use
with NS.name <term>orwith [NS.name1, NS.name2, ...] <term>to disable disambiguation for the given names in<term>. Example:with MyNS.(>>=) do ....
Library additions:
- Additional file management operations in
base - New module in
basefor time (System.Clock) - New modules in
contribfor JSON (Language.JSON.*); random numbers (System.Random)
Compiler updates:
- Data types with a single constructor, with a single unerased arguments,
are translated to just that argument, to save repeated packing and unpacking.
(c.f.
newtypein Haskell)- A data type can opt out of this behaviour by specifying
noNewtypein its options list.noNewtypeallows code generators to apply special handling to the generated constructor/deconstructor, for a newtype-like data type, that would otherwise be optimised away.
- A data type can opt out of this behaviour by specifying
- 0-multiplicity constructor arguments are now properly erased, not just given a placeholder null value.
Other improvements:
- Various performance improvements in the typechecker:
- Noting which metavariables are blocking unification constraints, so that they only get retried if those metavariables make progress.
- Evaluating
fromIntegerat compile time.
- Extend Idris2's literate mode to support reading Markdown and OrgMode files. For more details see: "literate" in the user manual.
Everything :). For full details, see: updates