Skip to content

Releases: purescript/purescript

v0.6.8

21 Feb 02:18
Compare
Choose a tag to compare

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.

v0.6.7.1

14 Feb 19:09
Compare
Choose a tag to compare

Bug Fixes

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

v0.6.7

12 Feb 22:52
Compare
Choose a tag to compare

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)

v0.6.6

09 Feb 03:29
Compare
Choose a tag to compare

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

v0.6.5

08 Feb 05:12
Compare
Choose a tag to compare

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)

v0.6.4.1

03 Feb 16:55
Compare
Choose a tag to compare

Various small bug fixes.

v0.6.4

23 Jan 17:29
Compare
Choose a tag to compare
  • Fix some precedence issues in the code generator.
  • Tighten the bounds on utf8-string.
  • Fixed a bug in the typechecker.

v0.6.3

08 Jan 23:07
Compare
Choose a tag to compare

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)

v0.6.2

28 Nov 21:10
Compare
Choose a tag to compare

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)

v0.6.1.2

24 Nov 17:39
Compare
Choose a tag to compare
v0.6.1.2