Introduction
This release ("MELTDOWN") aims to handle as many planned breaking changes as possible, to ease the upgrade path before 1.0. It is necessary to upgrade almost all PureScript code to compile with this release.
The latest versions of the core libraries have all been updated to compile with this release. Older versions of the core libraries will not work with this release, and the latest versions of libraries will not build with older compiler releases.
Detailed instructions for those who need to migrate their code can be found on the wiki.
As usual, many thanks go to all of the contributors who helped with this release!
Breaking changes
- The
psc
executable has been replaced withpsc-make
, which has been renamed topsc
(in an effort to standardize on CommonJS module output). Features which were previously only available in oldpsc
(dead code elimination, bundling code for the browser) are now handled by the new executablepsc-bundle
, which works with the output of the newpsc
(for faster, incremental builds). - There are now
Int
andNumber
literals. To disambiguate the two, integerNumber
values must now be written with a decimal place (3.0
rather than3
). - The
Prelude
module is no longer imported automatically, and must be imported the same way as any other module. - No modules are included with the compiler now, they have been broken out into their own libraries:
Debug.Trace
has been renamed toControl.Monad.Eff.Console
, andtrace
has been renamed tolog
.[]
syntax for array types has been removed. It is still possible to use[]
array literals however.[]
should now be written asArray
, and[a]
asArray a
.
- Cons patterns for arrays have been removed.
- Declaring operators in classes will now produce a warning. Changes will be coming to operators in PureScript 0.8, and moving to named members in classes with operators as aliases (e.g.
(<$>) = map
) should make the transition easier in the future. - JavaScript for the FFI can no longer be provided inline.
- Values must instead be provided in a separate
.js
file, and passed to the compiler with the-ffi
flag. - Values should be provided in the form
exports.foo = ...
, similar to a CommonJS module - The file should have a comment
// module X.Y.Z
whereX.Y.Z
is the name of the module the JS values are for. - See here for an example
- Values must instead be provided in a separate
Enhancements
- Module exports (@andyarvanitis). Currently, only full module exports are supported, but imported modules can be re-exported using the following syntax:
purescript module M1 (module M2) where import M2
- Documentation improvements (@hdgarrood):
psc-docs
can now generate multiple output files, allowing documentation to be collected into functional groups.- A new tool
psc-publish
has been added, which generates module documentation in a JSON format required by Pursuit 2 (coming soon)
- @hdgarrood has worked on improving the quality of code completion inside
psci
, and generally tidying up and refactoring that code. - @puffnfresh has worked on dramatically increasing the performance of incremental builds, with improvements up to 10x compared to the previous release.
- The new
--require-path
option allows the syntax of module imports in generated CommonJS modules to be customized (@garyb). - @etrepum has added support for building with Stack.
- PSCi now supports computations in the
Eff
monad. (@paf31) - The compiler now emits warnings in the following cases:
- Operator name used in type class definition (@garyb)
- Type wildcard used (@nicodelpiano)
- Shadowed variable name (@paf31)
- @balajirrao has improved the appearance of unknown and rigid types appearing in error messages.
- @puffnfresh has added position information to pattern match errors.
- @puffnfresh has added some new optimizations (inlining
<<<
and$
)
Bug Fixes
psc
,psc-docs
andpsc-bundle
now support file globs as command-line arguments, fixing a bug related to the command length on Windows machines (@paf31)- @wuzzeb has fixed some issues in the pretty printer.
- @mjgpy3 has improved error messages related to incorrect pattern matches on data constructors.
Tools
- Pulp has been updated:
- The new
psc
andpsc-bundle
binaries are supported - FFI modules are now identified and compiled based on a convention
pulp docs
now generates individual Markdown files for each source module
- The new
gulp-purescript
has been updated:- The new
psc
andpsc-bundle
binaries are supported - FFI modules are now supported
- The new
Libraries
- The following libraries have been moved into the core library set:
purescript-lists
- Strict and lazy linked list data structurespurescript-assert
- Low level assertion library for testspurescript-parallel
- An applicative functor for parallel composition of asynchronous computations.purescript-arrows
- Arrow type classes and standard instances.purescript-tailrec
- A type class for stack-safe monadic tail recursion.
- The requirements for libraries in the
purescript-contrib
organization have been tightened, to try to ensure that libraries stay maintained.