Changelog History
Page 5
-
v0.10.2 Changes
November 07, 2016Major Changes
Type-directed search (@kRITZCREEK)
This extends the typed holes error messages to include suggested replacements for a typed hole, by using type subsumption to determine which identifiers in scope are appropriate replacements.
A blog post will accompany this feature soon.
📦
psc-package
(@paf31)📦 This is an experimental package manager for PureScript packages. It supports the following commands:
- 📦
init
- create a new project using the package set for the current compiler version - ⚡️
update
- sync the local package collection with the package set - 📦
install
- install a specific package from the current set and add it to the package config - 🏗
build
- runpsc
on any active packages - 📦
sources
- list source globs for active package versions dependencies
- list transitive dependencies of the current project
For example:
$ psc-package init $ psc-package install transformers $ psc-package build
📦 Eventually,
psc-package
might replace the use of Bower, but that will require support from tools like Pulp. For now, package authors should continue to publish packages using Bower and Pursuit.Data.Generic.Rep.Generic
Deriving (@paf31)👀 This is an alternative generic programming implementation based on
GHC.Generics
. It should allow deriving of more interesting classes, such asSemigroup
. See thepurescript-generics-rep
package for examples.✨ Enhancements
- #2323: Sort IDE-generated explicit imports (@bbqbaron)
- #2374: Add error message for ambiguous type variables in inferred contexts (@bbqbaron)
- 🚚 #934 Add paste mode, remove --multi-line option (@paf31)
- 👍 Allow symbols in data constructors (@brandonhamilton)
- 🛠 Fix inliner for integer bitwise operators (@brandonhamilton)
- 👉 Use SSL for pursuit queries (@guido4000)
🐛 Bug Fixes
- #2370, allow rows in instance contexts (@paf31)
- #2379, add error message for unknown classes (@paf31)
- 👍 Better error messages for bad indentation (@paf31)
- 🛠 Fix inliner for
Data.Array.unsafeIndex
(@brandonhamilton) - 🛠 Fix issue with typed holes in inference mode (@paf31)
- 🛠 Fix scope traversal for do-notation bind. (@LiamGoodacre)
- 🖐 Handle
TypeLevelString
when checking orphans (@joneshf) - 🚚 Move unsafeIndex to Data.Array (@brandonhamilton)
- 🖨 Pretty-print suggested types differently (@paf31)
- Traversal should pick up bindings in all value declarations. (@LiamGoodacre)
- Treat type annotations on top-level expressions as if they were type declarations (@paf31)
Other
- 🔨 Refactor subsumes function (@paf31)
- 🔨 Refactor to use
lens
(@kRITZCREEK) - Small cleanup to
Language.PureScript.Interactive.IO
(@phiggins) - 📜 Speeds up parsing by reading files as
Text
(@kRITZCREEK) - ⚡️ Update outdated comments about Prim types (@rightfold)
- 📦
-
v0.10.1 Changes
October 02, 2016💥 Breaking Changes
🛠 The new functional dependencies feature fixes type inference in some cases involving multi-parameter type classes. However, due to a bug in the compiler, some of those expressions were previously type checking where they should not have. As a result, it is necessary to add functional dependencies to some classes in order to make previous code type-check in some cases. Known examples are:
MonadEff
andMonadAff
- 💅
MonadState
,MonadReader
, and the rest of the MTL-style classes intransformers
🆕 New Features
Data.Newtype
Deriving(@garyb)
It is now possible to derive the
Newtype
class for any data declaration which is anewtype
, using the existingderiving instance
syntax:newtype Test = Test String derive instance newtypeTest :: Newtype Test _
Note that the second type argument should be specified as a wildcard, and will be inferred.
➕ Added type level string functions
(@FrigoEU)
🏗 The
Prim
module now defines theTypeString
andTypeConcat
type constructors, which can be used to build more descriptive error messages which can depend on types, using theFail
constraint:instance cannotShowFunctions :: Fail ("Function type " <> TypeString (a -> b) <> " cannot be shown.") => Show (a -> b) where show _ = "unreachable" infixl 6 type TypeConcat as <>
--dump-corefn
(@rightfold)
👍 The compiler now supports the
--dump-corefn
option, which causes the functional core to be dumped inoutput/**/corefn.json
. This should be useful for implementing new backends which interpret the functional core.🆕 Newtype Deriving
(@paf31)
It is now possible to derive type class instances for
newtype
s, by reusing the instance for the underlying type:newtype X = X String derive newtype instance showX :: Show X
Note that it is possible to derive instances for multi-parameter type classes, but the newtype must only appear as the last type argument.
👍 Allow anonymous accessor chains (
_.a.b
)(@rvion)
Anonymous record accessor syntax has been extended to work with chains of one or more accessors:
getBaz = _.foo.bar.baz
Functional Dependencies (@paf31)
👍 The type class solver now supports functional dependencies. A multi-parameter type class can define dependencies between its type arguments by using the
->
operator:class Stream el s | s -> el where cons :: el -> (Unit -> s) -> s uncons :: s -> { head :: el, tail :: s }
Here, the
s
andel
type arguments are related by a single functional dependency, which ensures that there is at most one instance for any given types
. Alternatively, the types
determines the typeel
, i.e. there is an implicit function from typess
to typesel
. This information can be used by the solver to infer types where it was previously not possible.👀 See the following examples for more information:
✨ Enhancements
- Return qualifier from explicit/hiding imports (@nwolverson)
- 👌 Verify entry points exist in
psc-bundle
(@kRITZCREEK) - 👌 Improved error messages for record subsumption (@FrigoEU)
psc-ide
- Resolve types/kinds for operators (@kRITZCREEK)
- Unify Completion Commands (@kRITZCREEK)
- 📜 Parse type annotations from source files (@kRITZCREEK)
- ⚡️ Update pursuit JSON parsing (@nwolverson)
- ✂ Remove a pursuit workaround (@kRITZCREEK)
- ➕ Add a suggestion to the
UnusedDctorImport
warning (@FrigoEU) - Return JSON errors for cycles in module dependencies (@kRITZCREEK)
🐛 Bug Fixes
- 🛠 Fix usage detection for operators (@garyb)
- 🛠 Fix handling of duplicate module imports in JS codegen (@garyb)
- 🛠 Fix a small bug in the type pretty-printer (@paf31)
- 🛠 Fix function application judgment (@paf31)
- 🛠 Fix inlining for
$
and#
operators (@garyb) - 🛠 Fix
everywhereOnTypesTopDown
(@ianbollinger) - 🛠 Fix unification of string literals (@paf31)
Infrastructure
- 👌 Support
aeson-1.0
(@phadej) - 👌 Support
http-client-0.5
(@phadej) - Safer installation from source in INSTALL.md (@hdgarrood)
Implementation
- 🛠 Fix most HLint warnings (@ianbollinger)
- 🛠 Fixing imports (@charleso)
- Export
desugarDecl
fromSugar.ObjectWildcards
(@rvion) - ✂ Remove legacy
ObjectGetter
and update doc (@rvion)
-
v0.9.3 Changes
August 01, 2016✨ Enhancements
- 👍 Better context information for typed hole errors (@paf31)
- 👌 Improved error messages in the constraint solver. Type class errors now include better contextual information, including smaller source spans. (@paf31)
🐛 Bug Fixes
- Decode externs with correct encoding (@natefaubion)
- 🛠 Fix bad codegen for empty string fields (@LiamGoodacre, #2244)
- Instantiate types in array literals before unification (@paf31, #2252)
Other
- ⬆️ Upgrade to protolude 0.1.6 (@ilovezfs)
- ✅ Use latest LTS (@paf31, #2241)
- ➕ Add upper bound to http-client (@paf31, #2237)
- 🚀 Combine the sdist and coverage builds. Avoid .tix files during deployment. (@paf31)
-
v0.9.2 Changes
July 11, 2016✨ Enhancements
Goto Definition
@kRITZCREEK has added the ability to return position information for expressions in
psc-ide
. This can be used to implement a Goto Definition feature in IDEs which usepsc-ide-server
as the backend.💻 Evaluate PSCi expressions in the browser
(@paf31)
💻 PSCi now features an alternative backend, which can run commands in the browser via a websocket. To use this mode, simply pass the
--port
option on the command line:$ pulp psci --port 9000
💻 and open your web browser to
localhost
on that port.👀 See https://github.com/paf31/psci-experiment for a demonstration.
psc-ide
architecture changes@kRITZCREEK has worked on changing the architecture of
psc-ide
generally, to load data in multiple phases and asynchronously. This enables new features like Goto Definition above.Other
- 👍 Allow
pipes
version 4.2 (@felixonmars) - Elaborate re-exports (@garyb)
🐛 Bug Fixes
psc-ide
- 🛠 Fix unicode encoding of json responses (@kRITZCREEK)
- 👌 Improved handling of reexports (@kRITZCREEK)
Other
- ⚡️ Update Data.Function constant for prelude 1.0 (@felixSchl)
- ⚠ Include position info in ScopeShadowing warning (@garyb)
- 👍 Allow
-
v0.9.1 Changes
June 01, 2016🚀 PureScript 0.9.1 is a major stable release of the compiler. It removes features which were deprecated in the 0.8.x series, and contains several useful enhancements and bug fixes.
🚀 This release will be accompanied by new releases of the core libraries and a compatible version of Pulp, which have been updated to work with this version.
⚡️ Due to the relatively large number of breaking changes, library authors are advised that they will probably need to update their libraries to maintain compatibility. Users may prefer to continue using version 0.8.5 until their dependencies have been updated.
💥 Breaking Changes
Name resolving
(@garyb)
⚡️ The way names are resolved has now been updated in a way that may result in some breakages. The short version is: now only names that have been imported into a module can be referenced, and you can only reference things exactly as you imported them.
Some examples:
Import statement Exposed members import X
A
,f
import X as Y
Y.A
Y.f
import X (A)
A
import X (A) as Y
Y.A
import X hiding (f)
A
import Y hiding (f) as Y
Y.A
🌲 Qualified references like
Control.Monad.Eff.Console.log
will no longer resolve unless there is a correspondingimport Control.Monad.Eff.Console as Control.Monad.Eff.Console
. Importing a module unqualified does not allow you to reference it with qualification, soimport X
does not allow references toX.A
unless there is also animport X as X
.Although the new scheme is stricter it should be easier to understand exactly what the effect of any given import statement is. The old resolution rules for qualified names were obscure and unexpected results could arise when locally-qualified module names overlapped with "actual" module names.
Module re-exports have also been tightened up as a result of these rules. Now if module
X
is only importedas Y
, the re-export must listmodule Y
also. If a module is imported without being re-qualified then the original name is used.Partial Constraints
(@garyb, @paf31)
⚠ The compiler will now generate an error for a missing
Partial
constraints, where it would previously have issued a warning.Module Restrictions
(@garyb, @paf31)
- Imports must now appear before other declarations in a module.
- A source file must now contain exactly one module.
🏗 These restrictions will allow us to improve incremental build times in future, since we will only need to parse a small prefix of each file in order to figure out what needs to be rebuilt. Right now, we need to parse every file fully.
Foreign Function Interface Changes
(@paf31)
Foreign modules are now found by filename rather than by searching for a custom JavaScript comment. The foreign module is found by changing the extension of the corresponding PureScript module from
.purs
to.js
.This change was made to be more consistent with
psc-ide
, and also to adopt a simple convention which will port well to other backends.Operator Aliases
(@garyb)
👍 All operators must be defined as aliases from now on. That is, it is no longer valid to define an operator as a name in local scope (e.g.
let (#) x y = x y in ...
). This change makes it possible to generate better JavaScript code for operators, by desugaring them to the functions they alias.Other
- 🚚 Deprecated class import/export syntax has been removed (@LiamGoodacre). Classes are now imported using the
class
keyword, and exported similarly:
import Prelude (class Show, show)
- ✂ Remove support for
=
in record binders (@paf31).
Record binders such as
f { x = 0 } = true
are no longer supported. Record binders must now use
:
instead:f { x: 0 } = true
Prim.Object
has been renamed toPrim.Record
(#1768, @paf31)
✨ Enhancements
Programmable Type Errors
(@paf31)
Constraints can now contain type-level strings which can be used as custom error messages using the
Fail
constraint. For example, one can now document the fact that foreign types such asJSDate
cannot be made instances ofGeneric
:instance dateIsNotGeneric :: Fail "JSDate is not Generic. Consider using Int with toEpochMilliseconds instead." => Generic JSDate where fromSpine = crashWith "fromSpine: unreachable" toSpine = crashWith "toSpine: unreachable" toSignature = crashWith "toSignature: unreachable"
Attempting to derive a
Generic
instance for a type containingJSDate
will then result inA custom type error occurred while solving type class constraints: JSDate is not Generic. Consider using Int with toEpochMilliseconds instead.
Typed Hole Improvements
(#2070, @paf31)
Typed hole error messages now include the types of any names in scope, to assist with type-driven development:
> :t \x -> maybe 0 ?f x Error found: in module $PSCI at line 1, column 8 - line 1, column 22 Hole 'f' has the inferred type t0 -> Int in the following context: it :: Maybe t0 -> Int x :: Maybe t0 in value declaration it where t0 is an unknown type
👍 Editor Support
- 🔌 The results of the last rebuild are now cached by
psc-ide
, which improves completion support for editor plugins. (@kRITZCREEK) - A
reset
command was added topsc-ide
(@kRITZCREEK) - ⚠ The compiler will now suggest replacements to address
MissingTypeDeclaration
andTypeWildCard
warnings (@nwolverson)
PSCi Improvements
(@paf31)
- 🐎 The design of PSCi has been changed to improve performance. PSCi now precompiles all dependencies and uses the same incremental rebuilding approach as
psc-ide
. This means that the:load
and:foreign
commands have been removed, since dependencies are fixed and pre-compiled when PSCi loads. - 👍 PSCi now supports alternative base libraries such as Neon, by depending on
purescript-psci-support
for its supporting code.
Colors in Error Messages
🍎 Types and values will now be highlighted in error messages, when the terminal supports it (MacOS and Linux for now) (@soupi).
Type Names
Prime characters are now allowed in type names. (@garyb)
🐛 Bug Fixes
- 📜 Parser error messages inside type class and instance declarations were improved (#2128, @bmjames)
- Editor suggestions for imports now use
(..)
(@garyb) - Source-spans to token end position (@nwolverson)
- 🖨 Some pretty printing issues related to string literals in records were fixed (@LiamGoodacre)
- 🛠 Some presentation bugs in PSCi's
:show import
were fixed (@LiamGoodacre) - ⚡️ Parsec was updated to the latest version to fix an issue with literal parsing (#2115, @hdgarrood)
- 🛠 Fixed a bug related to certain typed binders which would cause the compiler to crash (#2055, @paf31)
- As-patterns now bind less tightly (@paf31)
- 📜 More identifiers can now be parsed in FFI imports (@michaelficarra)
- 🛠 Fixed a performance issue which manifested under certain conditions in
psc-ide
(#2064, @kika) - 🛠 Fixed a test which contained an unreliable comparison (#2093, @andyarvanitis)
- The precedence of type application was corrected (#2092, @paf31)
- 📜 An indentation bug in the parser was fixed (@DavidLindbom)
- License errors from
psc-publish
were improved (@hdgarrood)
Other
- ✅ The test suite now exercises various compiler warnings (@garyb)
- 🐎 The test suite performance was improved by using incremental rebuilds (@paf31)
- ✅ The test suite now tests that passing tests contain a
main
function (@hdgarrood) - ✅ The test suite now supports tests which use multiple files (@garyb)
- ✅ Portability of the core library test suite was improved (@bmjames)
- 🐎 Performance of import elaboration was improved (@garyb)
- 🚀 We now use Stack for our CI builds and release builds (#1974, @hdgarrood)
- We now use
NoImplicitPrelude
and enable some global extensions (@garyb) - Type-safety in the source-level AST was improved (@garyb)
- ✅ Use HSpec for the compiler tests (@garyb)
- 🆕 New Prelude names in 0.9 (@garyb)
-
v0.9.0 Changes
May 22, 2016🚀 This is pre-release software
🚀 This release is provided so that library developers can test the new compiler features.
-
v0.8.5 Changes
April 21, 2016🆕 New Features
- Fast recompilation for single files in
psc-ide-server
#1712 (@kRITZCREEK, @paf31)
The
pscid
project makes use of this to watch files as you work and raise errors and warnings when they occur with near instant feedback.- Operator aliases can now be declared for types #416 (@garyb)
infixr 6 type Natural as ~>
- Underscore wildcards can now be used in
case
andif
expressions #1558 (@garyb)
case _ of Something -> ...
-- underscores can optionally be used in any part of an `if` expression cond = if _ then _ else _ picker = if _ then "x" else "y"
- Typed holes #1283 (@garyb)
example :: forall a. Maybe a -> Unit example ma = ?umm
Hole 'umm' has the inferred type Unit in value declaration example
You can use any identifier name after the question mark and that will be used to label the hole in the raised error message.
💥 Breaking changes
- 📜 Type annotations may need parentheses in some situations that they previously did not due to the introduction of type operators. For example,
x :: a == y
will be now parsed asx :: (a == y)
instead of(x :: a) == y
.
✨ Enhancements
- 👌 Improved error messages for invalid FFI identifiers #2011 (@hdgarrood)
- 📦
psc-publish
now allows publishing of packages with a valid SPDX license field inbower.json
#1985 (@hdgarrood) - Haddock markdown fix #2001 (@trofi)
psc-ide
now creates theoutput
folder on startup if it is missing #2030 (@kRITZCREEK)
🐛 Bug Fixes
- 🛠 Fixed an issue with incorrect suggestions when re-exporting modules #1862 (@garyb)
- 🛠 Fixed an issue with invalid redundant import warnings #1823 (@garyb)
- 🛠 Fixed an issue where
DuplicateSelectiveImport
would not fire when it should #2004 (@garyb) - 🛠 Fixed the error that occurs when an invalid newtype is created that belongs to a data binding group #1895 (@garyb)
- 🛠 Fixed a case where re-exports included unintended exports #1872 (@garyb)
- Operator aliases can now be declared for qualified data constructors #2015 (@LiamGoodacre)
- A single
hiding
import will no longer raise an "unspecified imports" error #2017 (@garyb) - 🛠 Fixed a case where cycles in modules were being detected when they do not occur #2018 (@garyb)
- 🏁 Various cases where files were not being read as UTF-8 on Windows were fixed #2027, #2031 (@garyb, @kRITZCREEK)
- 🛠 Fixed some issues in pretty printing of records #2043 (@LiamGoodacre)
psci
now shows qualified imports correctly #2040 (@LiamGoodacre)- 📜 Parser errors are now returned as JSON during IDE rebuild #2042 (@paf31)
- Fast recompilation for single files in
-
v0.8.4 Changes
April 06, 2016🚀 This is an interim bug fix release before 0.9.0.
✨ Enhancements
- Check that FFI imports match with implementations (@hdgarrood)
This is technically a breaking change, since some existing code might fail to compile if it has missing FFI code (
purescript-dom
is an example), but these libraries should be fixed soon.- Import helper commands in psc-ide (@kRITZCREEK)
🐛 Bug Fixes
- Disallow constraint generalization for recursive functions. (#1978, @paf31)
- 🛠 Fix #1991, instantiate polymorphic types before unification (@paf31)
- 👉 Use UTF8 when writing to stdout and stderr (@garyb)
- 🛠 Fix for rendered constrained types needing parens. (@LiamGoodacre)
- everythingWithScope improperly traversing binary ops (@LiamGoodacre)
Other
- ⚡️ Update to use language-javascript 0.6.x (@nwolverson)
-
v0.8.3 Changes
March 26, 2016💥 Breaking Changes
- 👍 We have dropped support for GHC 7.8 and older (@hdgarrood)
✨ Enhancements
- Infer types with class constraints (@paf31)
For example, this simple code would previously have failed with a confusing
NoInstanceFound
error:add x y = x + y
The compiler will now infer the most general type, namely
forall a. (Semiring a) => a -> a -> a
.Note that constraints can only be inferred if they only mention type variables; inference of arbitrary types in constraints is not (yet) supported. So, for example, you would still have to write a type signature for a function which had a constraint such as
(MonadEff (console :: CONSOLE | eff) m)
.- 0️⃣ Default require path to
../
(@nwolverson)
The previous default behavior was no require path prefix, which was confusing for some workflows. The new default is
../
, which is the prefix used inpurs-loader
. This option will be removed completely in 0.9.- 🔦 Expose hiding import suggestion in JSON (@nwolverson)
- Error on missing
LICENSE
file or missing license field inbower.json
(@faineance)
🐛 Bug Fixes
- 🛠 Fix #1916 (@bagl)
- 🛠 Fix detection of single open import (@garyb)
- 🛠 Fix
true
not being treated as an infallible guard (@garyb) - 🛠 Fix pretty printer spinning (@garyb)
- 🛠 Fix Windows build script (@garyb)
- 🛠 Fix #1889, improve performance by avoiding whitespace operations on large strings (@paf31)
psc-ide
- 🛠 Fix a crash related to error messages in the case splitting command (@kRITZCREEK)
- Escape regex characters when using the flex matcher (@kRITZCREEK)
- ➕ Adds
--help
commands to thepsc-ide
executables (@kRITZCREEK) - Catches EOF exceptions thrown in
acceptCommand
(@kRITZCREEK)
Other
- Switched to Trusty distribution for Travis (@garyb)
- 🔨 @kRITZCREEK and @faineance worked on refactoring the compiler.
- ⚡️ The
optparse-applicative
dependency was updated to>= 0.12.1
(@stevejb71) - The
bower-json
dependency was bumped (@hdgarrood) - 👍 Better error message for
psc-publish
tests (@kRITZCREEK) - 👉 Use generic Literal in the AST (@garyb)
-
v0.8.2 Changes
February 29, 2016💥 Breaking Changes
None
✨ Enhancements
psc-ide
is now distributed with the compiler! (@kRITZCREEK)
The
psc-ide-server
andpsc-ide-client
executables are now maintained and distributed alongside the compiler. This will ensure that the externs file format used bypsc-ide-server
is kept in sync with changes in the compiler.- Source maps (@nwolverson)
Source maps can be generated using the
--source-maps
flag. See the example repository for a full demonstration of source maps using Webpack.- Operator aliases for data constructors (@garyb)
Aliases can now be defined for data constructors. For example:
data List a = Nil | Cons a (List a) infixr 6 Cons as :
Here, the
:
operator can be used as a function to replace theCons
constructor, and also in binders.Eq
andOrd
deriving (@paf31)
Eq
andOrd
instances can now be derived, using thederive instance
syntax:derive instance eqList :: (Eq a) => Eq (List a) derive instance ordList :: (Ord a) => Ord (List a)
- 📄 Types are now inferred in
psc-docs
andpsc-publish
(@hdgarrood)
If type annotations are missing in source files, they will be inferred by
psc-docs
andpsc-publish
before documentation generation.- 🎉 Initial version of new syntax for operator sections (#1846, @paf31)
Operator sections can now be written using underscores. For example:
decrementAll :: Array Int -> Array Int decrementAll = map (_ - 1)
which is equivalent to:
decrementAll :: Array Int -> Array Int decrementAll = map (\x -> x - 1)
🐛 Bug Fixes
- 👍 Allow one open import without warning (@garyb)
Warnings for open imports were a pain point for some users after the 0.8 release. This change allows a single open import without a warning. This is still safe in the presence of dependency updates, and does not lead to ambiguity for editor plugins searching for declaration sites.
Other
- ⚡️ @phadej has updated the Stack build to use the latest LTS and nightly builds.
- 🔨 @izgzhen has refactored the PSCi code to be more readable.
- 🔨 @hdgarrood has refactored the test suite.