purescript

A strongly-typed language that compiles to JavaScript

OTHER License

Downloads
10.2K
Stars
8.4K
Committers
200

Bot releases are hidden (Show)

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)
purescript - v0.6.1

Published by paf31 almost 10 years ago

Breaking Changes

  • The body of a guarded expression must now be indented past the guard. For example, this is valid:
positive n | n > 0 = true
positive _ = false

but this is not:

positive n | n > 0 
  = true
positive _ = false

New Features

  • Type wildcards are now supported (#287, @paf31)

Enhancements

  • Allow unquoted keywords as key names in record literals (#606, @michaelficarra)
  • Import instances when referencing qualified values (#667, @garyb)
  • Multiple guard clauses are now supported (#294, @paf31)
  • Type check let declarations immediately in psci (#615, @garyb)
purescript -

Published by paf31 almost 10 years ago

  • Prevent psci and psc-make from rebuilding everything on every build #692
purescript - v0.6.0 - "Holoship"

Published by paf31 almost 10 years ago

For more information on PureScript, see the purescript.org website.

Breaking Changes

  • The Alternative type class hierarchy was refactored. See here.
  • --runtime-type-checks has been removed. The recommended approach is to use purescript-foreign. (@garyb)
  • The Unit type is now used in the Prelude and core libraries to represent values containing no data. (@garyb)
  • The Prelude is no longer distributed as a separate file, but is embedded in the compiler executables. (@paf31)
  • docgen is now called psc-docs.

New Features

  • Newtypes are now supported using the newtype keyword. The runtime representation of a newtype is identical to that of the contained type. (@garyb)
  • Multiline string literals are now supported via triple-quote syntax, making FFI declarations much neater. (@phadej)
  • Kind signatures on types and type constructor arguments are now supported. (@paf31)

Enhancements

  • The runFnN and mkFnN families of functions are now inlined by the optimizer, making interop with JavaScript functions of multiple arguments much simpler. (@paf31)
  • Tail call optimization has been improved for functions using case expressions. (@paf31)
  • Saturated calls to data constructors are now optimized. (@garyb)
  • A new Renamer module now renames identifiers which shadow other names in scope, which greatly simplies code generation. (@garyb)
  • psci now provides the following new options:
    • :b to browse a module (@ardumont)
    • :s to show current imports or modules (@ardumont)
    • :k to find the kind of a type constructor (@5outh)
  • The approach to checking whether a name is initialized in the generated JavaScript was simplified (@paf31)
  • The dependency on the PureScript_paths module has been removed, which makes distribution via binaries simpler. (@paf31)
  • Nested if blocks now get optimized. (@garyb)
  • Generated code for type class dictionaries was simplified. (@garyb, @dylex)
  • The code generator now inserts the version of psc into the file as a comment. (@co-dh)
  • () is now valid syntax, referring to the empty row. (@paf31)
  • The type checker will now display multiple errors for type errors in the same binding group. (@paf31)
  • Imports can now specify hidden names using import ... hiding ( ... ) (@andreypopp)

Bug Fixes

  • Binding group errors in type class members are now caught at compile time. (@dylex)
  • Some errors related to type checking rows with duplicate labels were fixed. (@paf31)
  • Some issues with the calculation of binding groups were fixed. (@paf31)
  • Error messages for invalid case declarations are now generated. (@natefaubion)
  • Some issues related to module exports were fixed. (@garyb)
  • psci now checks imports for validity. (@Bogdanp)

Libraries

  • The Alternative type class hierarchy was refactored (@joneshf, @garyb)
  • The exceptions library no longer supports throwing exceptions of any type.
  • The following libraries have been moved to the core PureScript organisation: (@garyb)
    • purescript-transformers
    • purescript-free
    • purescript-const
    • purescript-identity
    • purescript-lazy
    • purescript-distributive
    • purescript-bifunctors
    • purescript-contravariant
    • purescript-profunctors
    • purescript-maps

Documentation

purescript -

Published by paf31 almost 10 years ago

purescript -

Published by paf31 almost 10 years ago

purescript -

Published by paf31 about 10 years ago

purescript -

Published by paf31 about 10 years ago

purescript -

Published by paf31 about 10 years ago

purescript - v0.5.6.2

Published by paf31 about 10 years ago

purescript - v0.5.5

Published by paf31 about 10 years ago

purescript - v0.5.4

Published by paf31 about 10 years ago

This incremental release is provided to provide bug fixes and features required to compile the latest core libraries.