A strongly-typed language that compiles to JavaScript
OTHER License
Bot releases are visible (Hide)
Published by JordanMartinez over 2 years ago
Bugfixes:
Fix name clash in guard clauses introduced in #4293 (#4385 by @PureFunctor)
As a consequence, a problem with the compiler not being able to see
imported names if they're shadowed by a guard binder is also solved.
import Data.Foldable (fold)
import Data.Maybe (Maybe(..))
import Data.Monoid.Additive (Additive(..))
test :: Maybe Int -> Int
test = case _ of
m | Just fold <- m -> fold
-- Previously would complain about `fold` being undefined
| otherwise -> case fold [] of Additive x -> x
Internal:
Guard
handler for the everywhereWithContextOnValuesM
traversal. (#4385 by @PureFunctor)Published by JordanMartinez over 2 years ago
New features:
Float compiler-synthesized function applications (#3915 by @rhendric)
This is a limited implementation of common subexpression elimination for
expressions created by the compiler in the process of creating and using
typeclass dictionaries. Users can expect code that heavily uses typeclasses
to produce JavaScript that is shorter, simpler, and faster.
Common subexpression elimination is not applied to any expressions explicitly
written by users. If you want those floated to a higher scope, you have to do
so manually.
Add support for optional shebang lines (#4214 by @colinwahl and @JordanMartinez)
One or more shebang line are only allowed as the first lines of a file
#! a shebang line
#! another shebang line
-- | module doc comment
-- other comment
module MyModule where
#! Using a shebang here will fail to parse
foo :: String
foo = ""
Bugfixes:
Stop requiring bower.json
devDependencies
when publishing (#4332 by @JordanMartinez)
Stop emitting source spans with negative line/column numbers (#4343 by @j-nava and @JordanMartinez)
Internal:
Accommodate internally-generated identifiers that start with digits (#4334 by @rhendric)
Enable -Wincomplete-uni-patterns
and -Wincomplete-record-updates
by default (#4336 by @hdgarrood)
Update purescript.cabal
so that the PureScript compiler is built with the
flags -Wincomplete-uni-patterns
and -Wincomplete-record-updates
enabled by default.
Setup infrastructure for testing source maps (#4335 by @JordanMartinez)
Removed a couple of unused SimpleErrorMessage
constructors (#4344 by @hdgarrood)
Compare json files through aeson
in tests (#4354 by @PureFunctor)
This fixes the tests for the graph and source map outputs, as the
ordering is inconsistent between stack test
and cabal test
.
Add version bounds to the test suite's build-depends
. (#4354 by @PureFunctor)
Update GHC to 9.2.3 (#4351 by @hdgarrood and @JordanMartinez)
Add qualification for locally-bound names (#4293 by @PureFunctor)
This change makes it so that Qualified
names can now be qualified by either
a ModuleName
for module-level declarations or the starting SourcePos
for
bindings introduced locally. This makes disambiguation between references to
local bindings much easier in AST-driven analysis.
Published by github-actions[bot] over 2 years ago
This is an automated preview release. Get the latest stable release here.
Published by JordanMartinez over 2 years ago
New features:
Check for partially applied synonyms in kinds, ctors (#4169 by @rhendric)
This check doesn't prevent any programs from compiling; it just makes
sure that a more specific PartiallyAppliedSynonym
error is raised
instead of a KindsDoNotUnify
error, which could be interpreted as
implying that a partially applied synonym has a valid kind and would be
supported elsewhere if that kind is expected.
Support deriving instances for type synonyms (#4315 by @rhendric)
Bugfixes:
Do not emit warnings about type wildcards used in binders (patterns). (#4309 by @fsoikin)
Type wildcards in the following examples no longer trigger a warning:
f :: Int
f = 42 # \(x :: _) -> x
g :: Maybe Int
g = do
x :: _ <- getX
pure $ x + 5
Fix issue with unnamed instances using type operators (#4311 by @rhendric)
Fix incorrect Prim.Int (class Compare)
docs: Int
& Ordering
, not Symbol
(#4313 by @JordanMartinez)
Fix bad interaction between module renaming and inliner (#4322 by @rhendric)
This bug was triggered when modules that the compiler handles specially
are shadowed by local constructors. For example, a constructor named
Prim
could have caused references to Prim_1["undefined"]
to be
produced in the compiled code, leading to a reference error at run time.
Less severely, a constructor named Control_Bind
would have caused the
compiler not to inline known monadic functions, leading to slower and
less readable compiled code.
Update Prim
docs for Boolean, Int, String/Symbol, Number, Record, and Row (#4317 by @JordanMartinez)
Fix crash caused by polykinded instances (#4325 by @rhendric)
A polykinded instance is a class instance where one or more of the type
parameters has an indeterminate kind. For example, the kind of a
in
instance SomeClass (Proxy a) where ...
is indeterminate unless it's somehow used in a constraint or functional
dependency of the instance in a way that determines it.
The above instance would not have caused the crash; instead, instances needed
to be of the form
instance SomeClass (f a) where ...
in order to cause it.
Fix bad interaction between newtype deriving and type synonyms (#4315 by @rhendric)
See #3453.
Fix bad interaction between instance deriving and type synonyms (#4315 by @rhendric)
See #4105.
Fix spurious kind unification error triggered by newtype deriving, type synonyms, and polykinds (#4315 by @rhendric)
See #4200.
Internal:
Deploy builds continuously to GitHub and npm (#4306 and #4324 by @rhendric)
(Builds triggered by changes that shouldn't affect the published package are
not deployed.)
Fix incomplete type traversals (#4155 by @rhendric)
This corrects oversights in some compiler internals that are not known to be
the cause of any user-facing issues.
Drop dependency on microlens libraries (#4327 by @rhendric)
Published by JordanMartinez over 2 years ago
Release skipped; use 0.15.2
instead.