purescript

A strongly-typed language that compiles to JavaScript

OTHER License

Downloads
10.2K
Stars
8.4K
Committers
200

Bot releases are visible (Hide)

purescript - v0.7.4

Published by paf31 about 9 years ago

Breaking Changes

  • The type class instance search algorithm has changed. The search will now eagerly match an instance for each subgoal based on the instance head, or fail. This makes certain instances in previous versions of purescript-transformers invalid, so users of this release should upgrade to the latest transformers.
  • A module must be imported to be re-exported.

Enhancements

  • RedefinedModule errors now include position info #1024 (@garyb)
  • Multiple imports of the same module are now resolved correctly, allowing for combinations of qualified and unqualified importing #817 #1112 (@garyb)
  • Errors for unresolvable imports and exports have been clarified #1232 (@garyb)
  • A warning is emitted when importing Type(..) when Type is a synonym or has no constructors. #1391 (@garyb)
  • Superclass constraints can now be relied upon when resolving instances #421 (@paf31)
  • A serious performance regression was partially addressed, memory usage should now be drastically reduced #1297 (@garyb)
  • Module re-export handling has been much improved. If a module is partially imported, only the specifically imported members are re-exported. Qualified modules can also be re-exported. #291 #1244 (@garyb)
  • Parser error messages are now formatted in a manner more consistent with other errors #1098 (@epost)
  • Using -ffi to specify JavaScript FFI files is now optional, files with a .js extension will be detected as FFI files automatically when encountered. #1268 (@mjgpy3)

Bug fixes

  • Fixed an error when attempting to derive for Void #1380 (@nicodelpiano)
  • "The impossible happened in desugarDo" should no longer occur #386 (@paf31)

Other

@zudov, @phadej and @erdeszt made more updates and improvements to the CI build.

purescript - v0.7.3

Published by paf31 about 9 years ago

Major Features

  • @gbaz has implemented generic deriving. This allows instances for the Generic class in the purescript-generics package to be derived by the compiler.

    A Generic instance can be derived as follows:

    data Example = Foo String | Bar Int | Baz Boolean
    
    derive instance genericExample :: Generic Example
    

    purescript-generics provides examples of usage, such as gShow, gEq and gCompare, for printing, equality tests and comparison respectively.

    See #1138.

  • @garyb has implemented a test for orphan instances which will now cause the build to fail with an error. See #1247

Enhancements

  • @mjgpy3 has added a warning when an input glob does not match any files.

Bug Fixes

  • The psc: <<loop>> has been fixed. This was due to a bug in the error pretty printer. (@paf31)
  • An issue with unicode characters in string literals was fixed by @michaelficarra.
  • Compiler errors are now pretty printed in psc-publish (@paf31)
  • Modules are no longer linted if they are not being rebuilt (@paf31)
  • FFI bindings are now reloaded when changed, in PSCi (@paf31)

Other

  • @phadej and @zudov have improved our CI process, so that PureScript now compiles against three versions of GHC and two LTS Stackage releases, as well as the nightly stackage releases.
  • @phadej and @lukerandall have worked on supporting PureScript in Stackage.
purescript - v0.7.2.1

Published by paf31 about 9 years ago

Functionally equivalent to v0.7.2. This release fixes a version incompatibility with Stackage.

purescript - v0.7.2

Published by garyb about 9 years ago

Bug fixes

  • Fixed haddock for the Language.PureScript.Bundle module #1262 (@wuzzeb)
  • Some erroneous error positions were fixed for kind and missing instance errors #1086 (@garyb)
  • The number of warnings printed for exhaustivity checks was limited to 5 #1281 (@nicodelpiano)
  • Home directory is checked for .psci file after the current working directory #883 (@mjgpy3)
  • Line numbers now show for shadowed name warnings #1165 (@nicodelpiano)
  • Cabal file was fixed for Nix packaging #1302 (@MasseGuillaume)
  • Kind query for types defined in psci now works #1235 (@mjgpy3)
  • Boolean operations are now being inlined again #1312 (@garyb)
  • Int operations are now being inlined again #1330 (@garyb)
  • "Writing..." and "Compiling..." messages are no-longer printed in psci #1276 (@paf31)

Enhancements

  • Exhaustivity checker was extended to report errors about redundant cases #1289 (@nicodelpiano)
  • Improved triggering of suggestion for errors about using (<<<) instead of (.) #1284 (@mjgpy3)
  • Only show the module name rather than the filename for pattern errors #1296 (@nicodelpiano)
  • Error reporting in psc-bundle was improved #1307 (@hdgarrood)
  • psc-publish code is now part of the library module #1304 (@hdgarrood)
  • psc-publish now has --version and --help options #1300 (@garyb)
  • psc-publish now has a --dry-run option for checking whether the module can be published #1308 (@hdgarrood)
  • psc-publish now requires a clean working tree #1306 (@hdgarrood)
  • psc-publish can now find bower on Windows machines #1317 (@hdgarrood)
  • psc-publish now uses OS-specific path delimiters to fix another bug on Windows #1326 (@hdgarrood)
  • Error list heading was made emacs-friendly #1327 (@epost)
purescript - v0.7.1

Published by paf31 over 9 years ago

Minor fixes after 0.7.0:

  • @hdgarrood has worked on improvements to psc-publish to support the new Pursuit website.
  • @mjgpy3 has improved warning messages
  • @wuzzeb has improved the pretty printers
  • @hdgarrood has added CI builds for GHC 7.10 and 7.6

Enhancements

  • @nicodelpiano has added exhaustivity checking as a new warning type. Incomplete pattern matches will now generate warnings like this:

    Warning in module Data.Either.Unsafe:
      Warning in value declaration fromRight:
      Warning at src/Data/Either/Unsafe.purs line 14, column 1 - line 15, column 1:
    Pattern could not be determined to cover all cases.
        The definition has the following uncovered cases:
          (Data.Either.Left _)
      See https://github.com/purescript/purescript/wiki/Error-Code-NotExhaustivePattern for more information, or to contribute content related to this error.
    
purescript - v0.7.0 - "MELTDOWN"

Published by paf31 over 9 years ago

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 with psc-make, which has been renamed to psc (in an effort to standardize on CommonJS module output). Features which were previously only available in old psc (dead code elimination, bundling code for the browser) are now handled by the new executable psc-bundle, which works with the output of the new psc (for faster, incremental builds).
  • There are now Int and Number literals. To disambiguate the two, integer Number values must now be written with a decimal place (3.0 rather than 3).
  • 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 to Control.Monad.Eff.Console, and trace has been renamed to log.
  • [] syntax for array types has been removed. It is still possible to use [] array literals however.
    • [] should now be written as Array, and [a] as Array 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 where X.Y.Z is the name of the module the JS values are for.
    • See here for an example

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 and psc-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 and psc-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
  • gulp-purescript has been updated:
    • The new psc and psc-bundle binaries are supported
    • FFI modules are now supported

Libraries

  • The following libraries have been moved into the core library set:
    • purescript-lists - Strict and lazy linked list data structures
    • purescript-assert - Low level assertion library for tests
    • purescript-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.
purescript - v0.7.0-rc.1

Published by paf31 over 9 years ago

Important note

This release should be used with the latest versions of the core libraries, which are also tagged as -rc.1.

Breaking changes

  • There are now Int and Number literals. To disambiguate the two, integer Number values must now be written with a decimal place (3.0 rather than 3).
  • 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:
  • [] syntax for array types has been removed. It is still possible to use [] array literals however.
    • [] should now be written as Array, and [a] as Array 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 coment // module X.Y.Z where X.Y.Z is the name of the module the JS values are for.
    • See here for an example

Full release notes coming soon

purescript - v0.6.9.5

Published by paf31 over 9 years ago

This release contains two patches:

  • Case statements were generating incorrect function name arguments #1008 (@paf31)
  • Comments and verbose error flags were mixed up #991 (@garyb)
purescript - v0.6.9.3

Published by paf31 over 9 years ago

Breaking Changes

  • refEq and refIneq are no longer exported from the Prelude.

Bug Fixes

  • Instances can now be defined before the corresponding class declaration (@paf31)
  • A bug related to imports in psci was fixed. (@paf31)
  • A typechecker bug related to type class dictionaries was fixed. (@garyb)
  • A bug related to operator precedence in codegen was fixed. (@garyb)

Enhancements

  • psci now supports long-form directives (@mrhania)
  • Syntax for imports and other declaration types in psci was improved. (@hdgarrood)
  • Markdown comments can now be included at the module level (@joneshf)
  • Error messages are now represented internally as an algebraic data type, and pretty printing has been improved by using the boxes library. Errors now link to the wiki. (@paf31)
  • psc-docs can now generate tags files for Vim and Emacs (@jacereda)
  • psci now supports a --node-opts flag for passing options to the Node executable. (@MichaelXavier)
  • Code gen now preserves names of more function arguments in case statements (@andyarvanitis)
  • There is now a Semigroup instance for Ordering (@pseudonom)

Documentation

  • The Prelude now has Markdown documentation (various contributors - thank you!)
  • The Pursuit website has been updated with new versions of libraries, including Markdown documentation (@hdgarrood)

Libraries

  • The following libraries are now core libraries:
    • purescript-tailrec - A type class for monadic tail recursion
    • purescript-monad-eff - A type class for monads supporting native effects
    • purescript-integers - Integer numeric type
    • purescript-invariant - Invariant functors
    • purescript-parallel - An applicative functor for parallel composition of asynchronous computations

Other

  • There is an experimental C++11 backend for PureScript called pure11.
purescript - v0.6.8

Published by paf31 over 9 years ago

Breaking Changes

  • The Num type class has been refined to allow more interesting instances. The Semiring, ModuloSemiring, Ring and DivisionRing classes have been introduced. Most code should continue to compile, since Number was one of only a handful of instances, but library developers will need to break up their Num instances.

Enhancements

  • @garyb has improved the readability of psc-docs output.

Notes

  • All uses of the deprecated ErrorT have been replaced with ExceptT and the transformers and mtl dependencies bumped accordingly.
purescript - v0.6.7.1

Published by paf31 over 9 years ago

Bug Fixes

  • A fix for a bug in the type class instance resolution code (#870, @paf31)
purescript - v0.6.7

Published by paf31 over 9 years ago

Enhancements

Scoped Type Variables

(#347, @paf31)

This feature allows type variables which are bound by a forall keyword to be used inside type annotations in the body of the function. For example, suppose we want to define a map function on a List type:

data List a = Nil | Cons a (List a)

map :: forall a b. (a -> b) -> List a -> List b
map f = go
  where
  go Nil = Nil
  go (Cons x xs) = Cons (f x) (map f xs) 

To give a type to go, we could previously use type wildcards:

go :: List _ -> List _

Now, we can refer to the types a and b inside the type of go, giving a more precise type:

go :: List a -> List b

Rows In Instance Contexts

(@paf31, @apsk)

This feature allows rows to appear on the left of a => in a type signature. For example, given a MonadEff class:

class MonadEff eff m where
  liftEff :: forall a. Eff eff a -> m a

we can now write the following function which works in any Monad supporting Trace actions:

logging :: forall m a eff. (Monad m, MonadEff (trace :: Trace | eff) m) => String -> m a -> m a
logging s action = do
  liftEff $ trace $ "Starting: " <> s
  a <- action
  liftEff $ trace $ "Done: " <> s
  return a

Improved let bindings in psci

(#782, @paf31)

Any declaration can now be used inside a let binding in psci. For example, we can define data types or foreign imports:

> let data Foo = Foo | Bar | Baz

> let foreign import foo :: Foo -> String

The general form of a let statement in psci now contains one or more declarations of any type, and these declarations simply get added to the current module.

As a bonus, polymorphic functions bound using let now work at multiple type instantiations in psci:

> let f x = x

> if f true then f "true" else f "False"
"true"

Markdown Support in psc-docs

(#802, @paf31)

Markdown can now be used for documentation purposes by using pipe characters to align content. For example:

-- | Create a copy of the array without its first element.
-- |
-- | Running time: `O(n)`, where `n` is the length of the array.
-- |
-- | This function is partial. Specifically, `tail []` is undefined.
tail :: forall a. [a] -> [a]

psc-docs will insert this markdown content verbatim into your generated documentation.

Bug Fixes

  • Modules are rebuilt before a command is executed in psci, to avoid situations where compiled code becomes out-of-date (@paf31)
  • @ is a valid operator name again (#815, @paf31)
  • Reserved module names are now properly escaped (@garyb)
purescript - v0.6.6

Published by paf31 over 9 years ago

Breaking Changes

  • The syntax of record getters was changed to _.prop (@garyb)

Enhancements

  • The record part of a record updater can now be made into a wildcard, e.g. _ { foo = 1 } (@garyb)

  • Extended infix expressions are now supported, (@paf31) e.g.

    [1, 2, 3] `zipWith (+)` [4, 5, 6]
    

Bug Fixes

  • Newline issues were fixed in executables (@michaelficarra)
purescript - v0.6.5

Published by paf31 over 9 years ago

Enhancements

  • Lightweight record constructors are now supported (@garyb):

    person :: Maybe String -> Maybe Number -> Maybe Address -> Maybe Person
    person = { name: _, age: _, location: _ } <$> name <*> age <*> location
    
  • Field accessor sections are now supported (@garyb):

    getPersonName :: Maybe String
    getPersonName = (.name) <$> getPersonInfo
    
  • Syntactic sugar has been introduced for object update functions:

    updateName :: Person -> String -> Person
    updateName person = person { name = _ }
    
  • Operator sections are now supported (@garyb)

Bug Fixes

  • Some command line options were fixed in psc-make (@paulyoung)
  • Some module import errors were fixed (@garyb)
  • A typechecker bug related to row synonyms was fixed (#795, @paf31)
purescript - v0.6.4.1

Published by paf31 over 9 years ago

Various small bug fixes.

purescript - v0.6.4

Published by paf31 over 9 years ago

  • Fix some precedence issues in the code generator.
  • Tighten the bounds on utf8-string.
  • Fixed a bug in the typechecker.
purescript - v0.6.3

Published by paf31 almost 10 years ago

Breaking Changes

Bug Fixes

  • Case statement at end of Eff block not being executed. (#759, @paf31)
  • A bug related to dead code elimination was fixed. (@garyb)
  • Wildcards can now appear in row endings. (@RossMeikleham)

Enhancements

  • There is a new "core functional representation", which will enable certain optimizations, and new features such as rewrite rules. (#710, @garyb)
  • Record pattern matches now allow field names to be separated from binders using : instead of =, to match record construction (#760, @leighman)
  • Some improvements needed for the Pursuit tool (@hdgarrood)
  • The lexer was separated from the parser, and now supports explicit comments in the AST. Documentation generated by psc-docs now contains any inline comments which precede the corresponding declaration, and generated code preserves the same comments. (@paf31)
  • PureScript now builds on GHC 7.6.* again. (@dylex)
  • Proper names can now contain underscores. (@dylex)
  • Several auto-completion improvements and fixes in PSCI. (@vkorablin)

Libraries

  • The Prelude now contains a pureST function to run ST computations in a pure context. (@KMahoney)

Tools

  • The Pursuit tool now runs on the community server, and integrates with Bower. Libraries can be added by submitting a pull request. (@hdgarrood)
purescript - v0.6.2

Published by paf31 almost 10 years ago

Breaking Changes

  • Command line options with multiplicity 1 now require an equals symbol, e.g.

    psc --main=Main --browser-namespace=PS
    

    The Grunt and Gulp plugins already support this format.

Enhancements

  • Use optparse-applicative instead of cmdtheline (@anthoq88)

Libraries

  • Move STArray out of Prelude. (@paf31)
purescript - v0.6.1.2

Published by paf31 almost 10 years ago

purescript -

Published by paf31 almost 10 years ago

Breaking Changes

  • The pipe symbol is now a reserved operator.
  • The operators in the Bits type class have been renamed.

Enhancements

  • Fix build on GHC 7.6.* (@dylex)
  • Relax indentation requirements (@paf31)