A strongly-typed language that compiles to JavaScript
OTHER License
Bot releases are visible (Hide)
Add better positions for UnknownName errors for types/kinds (#3515, @colinwahl)
Previously an UnknownName error (arising from e.g. referring to a non-existent type, or a type which you forgot to import) would have a span covering the whole type annotation. Now, the error span only covers the relevant part of the type.
Boost performance of purs docs
by simplifying re-export handling (#3534, @hdgarrood)
purs docs
(#3414, @hdgarrood)Published by garyb almost 6 years ago
Named type wildcards (#3500, @natefaubion)
It's now possible to use ?hole
style syntax in type signatures where you want the compiler to tell you the missing type. This was previously possible by using _
in a type signature, but now _
can be used without raising a warning, as long as it does not appear in a top level declaration.
Boolean
kind to Prim.Boolean
(#3389, @justinwoo)row:column
printing for source positions in error messages (#3473, @justinwoo):print
directive for customizable repl printing (#3478, @hdgarrood)do
(#3373, @pkamenarsky)*
and !
(#3458, @LiamGoodacre)Partial
can foil TCO optimizations (#3218, @matthewleon)Type
and Kind
(#3484, @natefaubion)Type
/Kind
(#3496, @natefaubion)Type
(#3498, @natefaubion)Published by garyb almost 6 years ago
Prim.TypeError.QuoteLabel
for pretty printing labels in custom type errors (#3436, @dariooddenino)purs ide
accepts codegen targets for the rebuild command (#3449, @kRITZCREEK)CannotFindDerivingType
(#3425, @kRITZCREEK)ObjectNestedUpdate
was surviving desugaring (#3388, @natefaubion)bind
or discard
(#3418, @natefaubion):browse
environment after :reload
(#3001, @rndnoise)microlens-platform
instead of lens
(#3400, @joneshf)Data.ByteString.Lazy.toStrict
(#3433, @coot)Published by garyb over 6 years ago
ado
is now a keyword. An full explanation of the behaviour and usage of ado
is available in a comment on the issue. (#2889, @rightfold)purescript-generics
. purescript-generics-rep
is still supported. (#3007, @paf31)CoreFn
json representation. This change enables use of the Zephyr tree shaking tool for PureScript. (#3049, #3342, @coot)Eq
and Ord
deriving will now rely on Eq1
and Ord1
constraints as necessary where sometimes previously Eq (f _)
would be required. Eq1
and Ord1
instances can also be derived. (#3207, @garyb)Prim
type classes have been renamed/moved, so will require explicit importing (#3176, @parsonsmatt):
RowCons
is now Prim.Row.Cons
Union
is now Prim.Row.Union
Fail
is now Prim.TypeError.Fail
Warn
is now Prim.TypeError.Warn
Prim
namespace (#3291, @parsonsmatt)TypeConcat
and TypeString
have been replaced because they were in kind Symbol
but weren't literals. The Prim.TypeError.Doc
kind and related constructors (Text
, Quote
, Beside
, Above
) have been added in their place. The Fail
and Warn
type classes now accept a Doc
instead of a Symbol
.--dump-corefn
and --source-maps
arguments to purs compile
have been removed. There is now a --codegen
argument that allows the specific codegen targets to be specified - for example, --codegen corefn
will not produce JS files, --codgen js,corefn
will produce both. If the sourcemaps
target is used js
will be implied, so there's no difference between --codegen js,sourcemaps
and --codegen sourcemaps
). If no targets are specified the default is js
. (#3196, @garyb, @gabejohnson)purs ide
due to lack of use and editor tooling implementing the features instead (#3355, @kRITZCREEK)Cons
compiler-solved type class for Symbol
(#3054, @kcsongor)Append
compiler-solved type class for Symbol
can now be run in reverse (#3025, @paf31)purs ide
(#3206, @kRITZCREEK)purs ide
treats hiding
imports the same as open imports when sorting (#3069, @kRITZCREEK)runEffFn/mkEffFn
(#3026, @nwolverson)UnusableDeclaration
error (#3088, #3304, @i-am-tom)We can now express an explicit ordering on instances that would previously have been overlapping.
For example we could now write anIsEqual
type class to compute if two types are equal or apart:class IsEqual (l :: Type) (r :: Type) (o :: Boolean) | l r -> o instance isEqualRefl :: IsEqual x x True else instance isEqualContra :: IsEqual l r False
Note the
else
keyword that links the two instances together.
TheisEqualContra
will only be up for selection once the compiler knows it couldn't possible selectisEqualRefl
- i.e thatl
andr
are definitely not equal.
purs ide
now provide documentation comments (#2349, @nwolverson)Record
row (#3143, @paf31)(..)
for constructors now (#3142, @nwolverson)purs repl
(#3227, @rndnoise)Eq
, Ord
for binders (#3265, @bitemyapp)purs repl
when parens and brackets are involved (#3236, @rndnoise)purs repl
after :kind
and :type
(#3237, @rndnoise)Effect
type (Control.Monad.Eff
is still supported) (#3289, @kRITZCREEK, #3301, @garyb)Prim.Row.Nub
type class (#3293, @natefaubion)Prim.Row.Cons
and Prim.Row.Union
(#3292, @vladciobanu)Functor
can now be derived when quantifiers are used in constructors (#3232, @i-am-tom)purs repl
will now complete types after ::
(#3239, @rndnoise)Prim.Row.Lacks
type class (#3305, @natefaubion)purs ide
(#3311, @rgrinberg).purs-repl
(#3248, @rndnoise)require
in generated JavaScript now includes full index.js
file paths (#2621, @chexxor)Prim
:
Prim.Ordering
module with kind Ordering
, type LT
, type EQ
, type GT
Prim.RowList
module with class RowToList
, kind RowList
, type Nil
, type Cons
Prim.Symbol
module with class Compare
, class Append
, class Cons
purs --help
message to include hint about using --help
with commands (#3344, @hdgarrood)IncorrectConstructorArity
error message now includes a hint of how many arguments are expected for the constructor (#3353, @joneshf)purs ide
now uses absolute locations for file paths for better experience in some editors (#3363, @kRITZCREEK)Prim
always being imported unqualified (#2197, @LightAndLight)TypeClassDeclaration
errors (#3109, @b123400)purs ide
inserting conflicting imports for types (#3131, @nwolverson)__unused
no longer breaks codegen (#3187, @matthewleon)ShadowedName
warning (#3213, @garyb)UnusedTypeVar
warning (#3214, @garyb)MissingClassMember
, ExtraneousClassMember
, ExpectedWildcard
errors (#3216, @garyb)ExportConflict
errors (#3217, @garyb)ctags
and etags
generation when explicit exports are involved (#3204, @matthewleon)ScopeShadowing
warning (#3219, @garyb)CycleInModule
and DuplicateModule
errors (#3273, @garyb)IntOutOfRange
errors (#3277, @garyb, @kRITZCREEK)purs repl
now shows results for :browse Prim
(#2672, @rndnoise)ErrorParsingFFIModule
(#3307, @nwolverson)ScopeConflict
cause by exports (#3318, @garyb)purs docs
command (#3343, @hdgarrood)purs docs
issue with re-exporting from Prim
submodules (#3347, @hdgarrood)purs ide
imports for Prim
submodules (#3352, @kRITZCREEK)purs bundle
failing to bundle in the 0.12-rc1 (#3359, @garyb):browse
for Prim
submodules in purs repl
(#3364, @kRITZCREEK)repl
test suite (#3234, @rndnoise)let
pattern desugaring to be less brittle (#3268, @kRITZCREEK)ghcid
and testing commands to makefile (#3290, @parsonsmatt)MultipleFFIModules
error (#3308, @nwolverson)mod
and div
for Int
are no longer inlined as their definition has changed in a way that makes their implementation more complicated - purescript/purescript-prelude#161 (#3309, @garyb)let
and where
clauses (#3317, @joneshf)CoreFn
was added (#3319, @matthewleon)purs ide
docs about the behaviour of --editor-mode
(#3350, @chexxor)psc-bundle
(a leftover from before the unified purs
binary) (#3356, @Cmdv)Published by garyb over 6 years ago
ado
is now a keyword. An full explanation of the behaviour and usage of ado
is available in a comment on the issue. (#2889, @rightfold)purescript-generics
. purescript-generics-rep
is still supported. (#3007, @paf31)CoreFn
json representation (#3049, @coot)Eq
and Ord
deriving will now rely on Eq1
and Ord1
constraints as necessary where sometimes previously Eq (f _)
would be required. Eq1
and Ord1
instances can also be derived. (#3207, @garyb)Prim
type classes have been renamed/moved, so will require explicit importing (#3176, @parsonsmatt):
RowCons
is now Prim.Row.Cons
Union
is now Prim.Row.Union
Fail
is now Prim.TypeError.Fail
Warn
is now Prim.TypeError.Warn
Prim
namespace (#3291, @parsonsmatt)TypeConcat
and TypeString
have been replaced because they were in kind Symbol
but weren't literals. The Prim.TypeErrer.Doc
kind and related constructors (Text
, Quote
, Beside
, Above
) have been added in their place. The Fail
and Warn
type classes now accept a Doc
instead of a Symbol
.--dump-corefn
and --source-maps
arguments to purs compile
have been removed. There is now a --codegen
argument that allows the specific codegen targets to be specified - for example, --codegen corefn
will not produce JS files, --codgen js,corefn
will produce both. If the sourcemaps
target is used js
will be implied, so there's no difference between --codegen js,sourcemaps
and --codegen sourcemaps
). If no targets are specified the default is js
. (#3196, @garyb, @gabejohnson)Cons
compiler-solved type class for Symbol
(#3054, @kcsongor)Append
compiler-solved type class for Symbol
can now be run in reverse (#3025, @paf31)purs ide
(#3206, @kRITZCREEK)purs ide
treats hiding
imports the same as open imports when sorting (#3069, @kRITZCREEK)runEffFn/mkEffFn
(#3026, @nwolverson)UnusableDeclaration
error (#3088, #3304, @i-am-tom)We can now express an explicit ordering on instances that would previously have been overlapping.
For example we could now write anIsEqual
type class to compute if two types are equal or apart:class IsEqual (l :: Type) (r :: Type) (o :: Boolean) | l r -> o instance isEqualRefl :: IsEqual x x True else instance isEqualContra :: IsEqual l r False
Note the
else
keyword that links the two instances together.
TheisEqualContra
will only be up for selection once the compiler knows it couldn't possible selectisEqualRefl
- i.e thatl
andr
are definitely not equal.
purs ide
now provide documentation comments (#2349, @nwolverson)Record
row (#3143, @paf31)(..)
for constructors now (#3142, @nwolverson)purs repl
(#3227, @rndnoise)Eq
, Ord
for binders (#3265, @bitemyapp)purs repl
when parens and brackets are involved (#3236, @rndnoise)purs repl
after :kind
and :type
(#3237, @rndnoise)Effect
type (Control.Monad.Eff
is still supported) (#3289, @kRITZCREEK, #3301, @garyb)Prim.Row.Nub
type class (#3293, @natefaubion)Prim.Row.Cons
and Prim.Row.Union
(#3292, @vladciobanu)Functor
can now be derived when quantifiers are used in constructors (#3232, @i-am-tom)purs repl
will now complete types after ::
(#3239, @rndnoise)Prim.Row.Lacks
type class (#3305, @natefaubion)purs ide
(#3311, @rgrinberg).purs-repl
(#3248, @rndnoise)require
in generated JavaScript now includes full index.js
file paths (#2621, @chexxor)Prim
:
Prim.Ordering
module with kind Ordering
, type LT
, type EQ
, type GT
Prim.RowList
module with class RowToList
, kind RowList
, type Nil
, type Cons
Prim.Symbol
module with class Compare
, class Append
, class Cons
Prim
always being imported unqualified (#2197, @LightAndLight)TypeClassDeclaration
errors (#3109, @b123400)purs ide
inserting conflicting imports for types (#3131, @nwolverson)__unused
no longer breaks codegen (#3187, @matthewleon)ShadowedName
warning (#3213, @garyb)UnusedTypeVar
warning (#3214, @garyb)MissingClassMember
, ExtraneousClassMember
, ExpectedWildcard
errors (#3216, @garyb)ExportConflict
errors (#3217, @garyb)ctags
and etags
generation when explicit exports are involved (#3204, @matthewleon)ScopeShadowing
warning (#3219, @garyb)CycleInModule
and DuplicateModule
errors (#3273, @garyb)IntOutOfRange
errors (#3277, @garyb, @kRITZCREEK)purs repl
now shows results for :browse Prim
(#2672, @rndnoise)ErrorParsingFFIModule
(#3307, @nwolverson)ScopeConflict
cause by exports (#3318, @garyb)repl
test suite (#3234, @rndnoise)let
pattern desugaring to be less brittle (#3268, @kRITZCREEK)ghcid
and testing commands to makefile (#3290, @parsonsmatt)MultipleFFIModules
error (#3308, @nwolverson)mod
and div
for Int
are no longer inlined as their definition has changed in a way that makes their implementation more complicated - purescript/purescript-prelude#161 (#3309, @garyb)let
and where
clauses (#3317, @joneshf)CoreFn
was added (#3319, @matthewleon)Published by paf31 almost 7 years ago
Unsafe.Coerce.unsafeCoerce
(@coot)purs ide
inserts conflicting imports for types (#3131, @nwolverson)purs ide
Add an "editor mode" (@kRITZCREEK)
When the editor-mode
flag is specified at startup the server will not start afile watcher process any more. Instead it only reloads after successful rebuild commands. This is a lot less fragile than relying on the file system APIs, but will mean that a manual load needs to be triggered after builds that didn't go through purs ide
.
purs ide
now groups hiding
imports with implicit ones (@kRITZCREEK)
Return documentation comments in purs ide
completions (@nwolverson)
Add an actualFile
parameter to the rebuild command (@kRITZCREEK)
Add qualified explicit import (@nwolverson)
Fixed case-splitting on local non-exported datatypes (@LightAndLight)
Make the filters
parameter in the type
command optional (@b123400)
purs docs
purs repl
:complete
directive to purs repl
to support completion in more editors (@actionshrimp)purs ide
. (@kRITZCREEK)PROTOCOL.md
docs for purs ide
(@BjornMelgaard)blaze-html-0.9
(@felixonmars)Glob
dependency (@mjhoy)Hspec
in TestDocs
(@hdgarrood)master
and versioned tags in AppVeyor (@hdgarrood)Published by paf31 over 7 years ago
RowToList
support(@LiamGoodacre)
There is a new type class in typelevel-prelude
called RowToList
, which turns
a row of types into a type-level list. This allows us to work with closed
rows in more ways at the type level. The compiler will now solve these constraints
automatically for closed rows of types.
:reload
(@hdgarrood)purescript.cabal
and add to .gitignore
(@garyb)aeson
in package.yaml
(@garyb)Published by paf31 over 7 years ago
(@cdepillabout)
Type class instances can now include type signatures for class members, as documentation:
data MyType = MyType String
instance showMyType :: Show MyType where
show :: MyType -> String
show (MyType s) = "(MyType " <> show s <> ")"
purs repl
with --port
(@dgendill)forall
within constraints (#2874, @sectore)\r\n
into \n
after reading files (@kRITZCREEK)purs
command line help message issues (@Cmdv)let
properly when generating docs (@paf31)RowCons
type class in documentation (@tslawler)TypesDoNotUnify
involving duplicate labels (#2820, @thoradam)package.yaml
(@sol)purs
(@noraesae)build
command to run tests (@sectore)directory
(@kRITZCREEK)core-tests
to psc-package
(#2830, @matthewleon)CONTRIBUTING.md
for "new contributor" label (@thoradam)purs ide
A new filter, which restricts query results to the value, type and/or kind namespaces, which allows improvements to the completion and import commands.
This empowers editor plugins to add imports for qualified identifiers, for example in the Emacs plugin.
Editors can now choose to let purs ide
group reexports for the same value, to reduce noise when completing values like Data.Functor.map
which are reexported a lot and show up that many times in the completion list.
This can yield significant speedups in the initial load times. For example a full load of slamdata/slamdata
improves from 11 to 6 seconds
-h
/--help
to ide
subcommands (@simonyangme)Published by paf31 over 7 years ago
purs
executable will now display help text by default (@matthewleon)-h
/--help
to ide
subcommands (@simonyangme)purs ide
list import command (@kRITZCREEK)purs ide
now reads files in text mode for adding imports (@kRITZCREEK)aeson
lower bound to 1.0 (@hdgarrood)purs
command line help message fixes (@Cmdv)psc-package
(#2830, @matthewleon)CONTRIBUTING.md
notes (@thoradam)Published by paf31 over 7 years ago
directory >=1.2.3.0
for XDG support (@bergmark)hpack
to generate the .cabal
file (@kRITZCREEK)psci_history
(@legrostdg)Published by paf31 over 7 years ago
(@paf31)
A new RowCons
constraint has been added to Prim
. RowCons
is a 4-way relation between
which appends a new label (1) with the specified type (2) onto the front of the input row (3), to generate a new output row (4). The constraint can also be run backwards to subtract a label from an output row.
This allows us to quantify types over labels appearing at the front of a row type, by quantifying over the corresponding symbol/type pair. This gives us a limited form of polymorphic labels which enables things like writing a single lens for any record accessor.
psci_history
file (@legrostdg)purs ide
(@kRITZCREEK)hpack
to generate the .cabal
file (@kRITZCREEK)Published by paf31 over 7 years ago
This release includes several breaking changes, in preparation for the 1.0 release, as well as many enhancements and bug fixes.
Most users will probably want to wait until all aspects of the release have been finalized. Progress on libraries and tools is being tracked here.
Many thanks to the contributors who helped with this release!
(@garyb, @paf31)
=>
now acts like a binary type operatorIt was previously possible to specify many constraints in the same context by
separating them with commas inside parentheses on the left of the =>
:
runFreeT :: ∀ m f. (Functor f, Monad m) => ...
This is no longer allowed. Instead, =>
now acts like a binary operator, with a
constraint on the left and a type on the right. Multiple constraints must be
introduced using currying, as with regular function arguments:
runFreeT :: ∀ m f. Functor f => Monad m => ...
This is in preparation for adding constraint kinds, at which point =>
will become
an actual binary type operator, defined in Prim
.
*
and !
kinds have been removedThe kind symbols *
(for the kind of types) and !
(for the kind of effects) have been
removed from the parser. Instead of *
, use Type
, which is defined in Prim
.
Instead of !
, use Effect
, which can now be imported from Control.Monad.Eff
.
The #
symbol, which is used to construct a row kind, is still supported. We cannot move this kind into Prim
(because it is polykinded, and we do not support kind polymorphism).
The various psc-*
executables have been replaced with a single executable called purs
.
The various subcommands are documented on the --help
page:
bundle Bundle compiled PureScript modules for the browser
compile Compile PureScript source files
docs Generate Markdown documentation from PureScript source files
hierarchy Generate a GraphViz directed graph of PureScript type classes
ide Start or query an IDE server process
publish Generates documentation packages for upload to Pursuit
repl Enter the interactive mode (PSCi)
Wrapper scripts will be provided in the binary distribution.
psc-package
was removedpsc-package
has been removed from the main compiler distribution. It will still
be maintained along with the package sets repo, but will not be bundled with the compiler.
A binary distribution which is compatible with this release is available.
do
blocks now raise errorsCode which discards the result of a computation in a do
block:
duplicate :: Array a -> Array a
duplicate xs = do
x <- xs
[true, false] -- the result here is discarded
pure x
will now raise an error. The compiler allows values of certain types to be discarded,
based on the Discard
class in Control.Bind
. The only type which can be discarded is
Unit
, but the feature was implemented using a type class to enable support for
alternative preludes.
In addition to removing psc-package
from the compiler distribution, we have also
removed any explicit dependency on the Bower executable. The compiler will not assume
use of any particular package manager, but will aim to provide generic support for
package managers generally, via command line options and hooks.
purs publish
will continue to use the Bower JSON formats. The bower.json
format
is now referred to as the "manifest file", while the output of bower list --json
,
which is used by purs publish
internally, is referred to as the "resolutions file".
(@alexbiehl)
In addition to regular guards:
foo x | condition x = ...
the compiler now supports pattern guards, which let the user simultaneously
test a value against a pattern, and bind names to values.
For example, we can apply a function fn
to an argument x
, succeeding only if
fn
returns Just y
for some y
, binding y
at the same time:
bar x | Just y <- fn x = ... -- x and y are both in scope here
Pattern guards can be very useful for expressing certain types of control flow when
using algebraic data types.
(@hdgarrood)
The --format html
option has been added to purs docs
. The HTML format uses
the Pursuit template, and is very useful for rendering documentation for offline
use.
Here is an example of the generated HTML.
(@paf31)
Row types now support duplicate labels, which can be useful when using the Eff
monad. For example, we could not previously use the catchException
function if
the resulting action also required the EXCEPTION
effect, since otherwise the
type of the inner action would contain a duplicate label.
Rows are now unordered collections (of labels and types) with duplicates. However,
the collection of types for a specific label within a row is ordered.
Conceptually, a row can be thought of as a type-level Map Label (NonEmptyList Type)
.
A type constructor (such as Record
) which takes a row of types as an argument should
define what its meaning is on each row. The meaning of a value of type Record r
is a JavaScript object where the type of the value associated with each label is given
by the head element of the non-empty list of types for that label.
(@doolse, @paf31)
A new constraint called Union
has been added to Prim
. Union
is a three-way relation between
rows of types, and the compiler will solve it automatically when it is possible to do so.
Union
is a left-biased union of rows which takes into account duplicate labels. If the same label appears in rows l
and r
, and Union l r u
holds, then the label will appear twice in u
.
Union
makes it possible to give a type to the function which merges two records:
merge :: forall r1 r2 r3. Union r1 r2 r3 => Record r1 -> Record r2 -> Record r3
Note that this is a left-biased merge - if the two input record contain a common label, the type of the
label in the result will be taken from the left input.
let
expressions(@noraesae)
Let expressions and where
clauses can now use binders on the left hand side of
a declaration:
map f xs =
let { head, tail } = uncons xs
in [f head] <> map f tail
Unlike in Haskell, declarations with these patterns cannot appear in dependency cycles, and bound names can only be used in declarations after the one in which they are brought into scope.
(@kRITZCREEK)
Type-directed search will now include results for record accessors. This can
be very useful when working with extensible records with a type-driven programming
workflow.
Prim
(@hdgarrood)_
instead of false
case for if then else
to improve optimizations (@rightfold)InvalidDerivedInstance
error to improve errors for derived instances (@paf31)purs ide
purs ide
now uses a new import parser, which allows purs ide
to handle any(@kRITZCREEK)
purs ide
will now no longer leave empty output/ directories behind when it is
started in a directory that is not a PureScript project.
(@kRITZCREEK)
purs ide
collects instances and stores them with their respective type class.
There's no way to retrieve these yet, but we will extend the protocol soon.
psc-ide
shouldn't crash when building a non-existent file) (@kRITZCREEK)purs ide
imports list (@nwolverson)--debug
option (@kRITZCREEK)purs repl
.purs-repl
file support (@paf31):clear
(@noraesae)let
(@noraesae)everythingWithScope
traversal bug #2718 (@paf31)Generic
deriving with synonyms (@paf31)--dump-corefn
(@paf31)purs publish
(@mcoffin)purs publish --dry-run
(@hdgarrood)keepImp
(@paf31)nub
with ordNub
(@matthewleon)HasCallStack
to internalError (@alexbiehl)Published by paf31 over 7 years ago
Release candidate. Use 0.11.0 instead.
Published by paf31 over 7 years ago
This release contains a bug fix for a bug in psc-bundle
which was introduced in 0.10.6.
Published by paf31 over 7 years ago
Warn
type class (@LiamGoodacre, blog post)unsafePartial
(@paf31)bind
is brought into scope inside do
(@paf31)--dump-corefn
(@paf31)TypeLevelString
/TypeConcat
should not be quoted (@michaelficarra)negateInt
(@paf31)psc-ide
psc-ide
imports list (@nwolverson)psc-publish
psc-publish --dry-run
(@hdgarrood)psc-publish
(@hdgarrood)psc-publish
JSON (@hdgarrood)Docs.Bookmarks
(@hdgarrood)Map.foldlWithKey'
instead of foldl
(@hdgarrood)Language.PureScript.Docs
(@hdgarrood)HasCallStack
to internalError
(@alexbiehl)psc-package
to use turtle 1.3 (@taktoa)JSAccessor
; replace with JSIndexer
(@michaelficarra)RenderedCode
(@hdgarrood)Published by paf31 almost 8 years ago
PSString
(@hdgarrood)bower-json
to 1.0.0.1 (@hdgarrood)Published by paf31 almost 8 years ago
Functor
(@LiamGoodacre, #2515)
The Functor
type class can now be derived using the standard derive instance
syntax:
newtype F a = F { foo :: Array a, bar :: a }
derive instance functorF :: Functor F
(@LiamGoodacre, #2486)
Custom kinds can now be defined using the foreign import kind
syntax:
foreign import kind SymbolList
Custom kinds can be ascribed to types using foreign import data
declarations, as usual:
foreign import data Nil :: SymbolList
foreign import data Cons :: Symbol -> SymbolList -> SymbolList
Note that kind arguments are not supported.
User defined kinds can be imported/exported using the kind
prefix, for example:
import Type.SymbolList (kind SymbolList)
psc-bundle
(@nwolverson)
psc-bundle
will now generate source maps if the--source-maps
flag is used.
CompareSymbol
and AppendSymbol
(@LiamGoodacre, #2511)
Support for the new purescript-typelevel-prelude
library has been added to the compiler. CompareSymbol
and AppendSymbol
constraints will now be solved automatically for literal symbols.
psc-package
Features(@paf31)
Two new commands have been added to psc-package
to support library authors and package set curators.
updates
command (#2510) is used to update packages in the set.verify-set
command (#2459) is used to verify the health of a package set. This command replicates the work done by the package-sets
CI job, and can be used to test modifications to the package set locally before making a pull request.--node-path
option to PSCi to modify the path to the Node executable (#2507, @paf31)Prim
docs to the library (#2498, @hdgarrood)KindedType
when instance solving (@LiamGoodacre)psc-ide
tests on windows (@kRITZCREEK)Text
in the Docs
modules (#2502, @hdgarrood)turtle
, fixes #2472, (@hdgarrood)language-javascript
(@hdgarrood)Published by paf31 almost 8 years ago
IsSymbol
instances(@LiamGoodacre)
The compiler will now derive Data.Symbol.IsSymbol
instances for type-level string literals.
This enables interesting type-level programming features, such as deriving Show
instances using Data.Generics.Rep
.
(@LiamGoodacre)
The compiler now allows rows to appear in type class instance heads, but only in type arguments which are fully determined by some functional dependency.
This allows instances like
MonadState { field :: Type } MyAppMonad
and also Newtype
instances for newtypes which contain records.
(@kRITZCREEK)
The use of String
has been replaced by Text
in the compiler, resulting in some non-trivial performance improvements.
psc-docs
output(@soupi, #2439)
psc-docs
now includes functional dependency information when rendering type classes.
psc-package
Commandsavailable
command (@andyarvanitis) shows all available packages in the current package setuninstall
command (@joneshf) removes a package from the set of active packages and updates the package configuration file.A warning was added for shadowed type variables in type class declarations.
psc-package
: display full path in 'packages.json does not exist' error messsage (@andyarvanitis)writeUTF8File
in psc-bundle
(@hdgarrood)ErrorInDataBindingGroup
to include participating identifiers (@LiamGoodacre)psc-ide
psc
tests to file (@andyarvanitis, #2453)psc-package
to release bundle (@marsam)language-javascript
(@tmcgilchrist)CONTRIBUTING.md
(@osa1)Published by paf31 almost 8 years ago
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 versionupdate
- sync the local package collection with the package setinstall
- install a specific package from the current set and add it to the package configbuild
- run psc
on any active packagessources
- list source globs for active package versionsdependencies
- list transitive dependencies of the current projectFor 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 as Semigroup
. See the purescript-generics-rep
package for examples.
Data.Array.unsafeIndex
(@brandonhamilton)TypeLevelString
when checking orphans (@joneshf)lens
(@kRITZCREEK)Language.PureScript.Interactive.IO
(@phiggins)Text
(@kRITZCREEK)