You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: RELEASE-0.2.md
+13-13Lines changed: 13 additions & 13 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -10,64 +10,64 @@ Many thanks to the [contributors](https://github.com/purescript/purescript/graph
10
10
- RankNTypes
11
11
12
12
This experimental feature allows polymorphic types (introduced with `forall`) to appear on the left of a function arrow, or as the type of a record field, etc. For example:
13
-
13
+
14
14
rank2 :: (forall a. a -> a) -> Number
15
15
rank2 = \f -> if f true then f 1 else f 2
16
-
16
+
17
17
- Modules
18
18
- Polymorphic Object Update
19
19
20
20
Records now support member update in which the type of the field changes during the update. For example:
21
21
22
22
data Wrap a = Wrap a
23
-
23
+
24
24
update = \o -> o { prop = Wrap o.prop }
25
25
26
26
### Enhancements
27
27
28
28
- Naked expressions as statements
29
-
29
+
30
30
Naked expressions of type `{}` can now be used as statements.
31
31
32
32
- Split code generation into `AST -> JS` and `JS -> String`
33
-
33
+
34
34
JavaScript generation is now split into the generation of a JavaScript AST, and the pretty-printing of that AST. This enables some optimizations, and a better JavaScript pretty-printer.
35
-
35
+
36
36
- Syntactic sugar for introducing curried functions
37
-
37
+
38
38
Single-argument functions and multiple-argument functions can now be introduced in the same way:
39
39
40
40
test = \a (b, c) d -> a + b + c + d
41
41
42
42
- JavaScript optimizations
43
43
44
44
Some basic dead-variable elimination, inlining and eta-conversion are now performed on the generated JavaScript.
45
-
45
+
46
46
- Generate formatted Javascript
47
47
48
48
The generated JavaScript is now formatted to be more readable. In particular, newlines get generated, and the correct indentation is used.
49
49
50
50
- More valid infix operators
51
-
51
+
52
52
The colon and period characters are now valid in infix operator names.
53
53
54
54
### Syntax Changes
55
55
56
56
- Avoid 'do' keyword for blocks
57
-
57
+
58
58
`do` will be used later for Haskell-like monad comprehensions, so its previous use in introducing blocks of statements is now invalid. The `do` keyword is still reserved.
59
59
60
60
- Member foreign import syntax
61
61
62
-
A small syntactic addition to the FFI, to support a common use case.
62
+
A small syntactic addition to the FFI, to support a common use case.
63
63
64
64
- Make FFI syntax match Haskell
65
-
65
+
66
66
Use `foreign import` instead of `extern`.
67
67
68
68
- Make record declaration syntax match Haskell
69
69
- Simplify array binders
70
-
70
+
71
71
There are now two types of array binders: cons binders `x : xs -> ...` and array binders `[x, y, z] -> ...` instead of the previously confusing `[x:xs]`.
Copy file name to clipboardExpand all lines: RELEASE-0.3.md
+8-8Lines changed: 8 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -14,40 +14,40 @@ Many thanks to the [contributors](https://github.com/purescript/purescript/graph
14
14
sum (x:xs) = x + sum xs
15
15
16
16
- Basic support for type classes has been added. Polymorphic types of the form `forall a. (C a) => ...` will not be inferred but can be checked. Type inference still works if all type class instances can be determined. There is not yet support for functionality like GHC's `FlexibleInstances`, `FlexibleContexts` or `MultiParamTypesClasses`. For example:
17
-
17
+
18
18
class Truthy a where
19
19
isTrue :: a -> Boolean
20
-
20
+
21
21
instance Truthy Boolean where
22
22
isTrue b = b
23
-
23
+
24
24
instance Truthy String where
25
25
isTrue "" = false
26
26
isTrue _ = true
27
-
27
+
28
28
ifThenElse :: forall a b. (Truthy a) => a -> b -> b -> b
29
29
ifThenElse a tr fa = if isTrue a then tr else fa
30
30
31
31
- There is now support for `do` notation, using the `Monad` type class from the `Prelude` module. For example:
32
32
33
33
data Maybe = Nothing | Just a
34
-
34
+
35
35
instance Prelude.Monad Maybe where
36
36
ret = Just
37
37
(>>=) Nothing _ = Nothing
38
38
(>>=) (Just a) f = f a
39
-
39
+
40
40
test = do
41
41
x <- Just 1
42
42
y <- Just 2
43
43
ret $ x + y
44
-
44
+
45
45
- There is now a better story for side-effects. The `Eff` module in the `Prelude` defines a monad `Eff e` where e is a row of effect types. The kind system now defines a new kind `!` of effects. Row polymorphism allows different native effects to be interleaved. For example:
46
46
47
47
test = do
48
48
trace "Testing"
49
49
throwError "Error!"
50
-
50
+
51
51
has inferred type `forall eff. Eff (trace :: Trace | error :: Error String | eff)`.
52
52
See the `/examples/passing/Eff.purs` file for a more in-depth set of examples.
53
53
Supported native effects currently include `ST`, `Trace`, `Error` and `DOM` (via the `libraries/jquery` module).
Copy file name to clipboardExpand all lines: RELEASE-0.4.md
+8-8Lines changed: 8 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,17 +8,17 @@ This release saw major contributions from [a number of new contributors](https:/
8
8
- Try out the latest features [here](http://tryps.functorial.com).
9
9
10
10
## Breaking Changes
11
-
11
+
12
12
- Multiple argument functions are no longer available.
13
13
- When used in the browser, PureScript modules are now accessed through `window.PS.<ModuleName>`. The `PS` object name can be changed via the `--browser-namespace` compiler argument.
14
14
- The `--run-main` argument has been replaced with `--main` which can now accept a module name in which to find the `main` function.
15
-
15
+
16
16
### New Features
17
-
17
+
18
18
- Dead code elimination. The new compiler argument `--module=` can be used to specify one or more modules that should be kept in the generated code along with their dependencies. If no modules are specified, all code is exported.
19
-
19
+
20
20
### Enhancements
21
-
21
+
22
22
- The `->` and `[]` types are now usable in type class instances.
23
23
- The file path is included in syntax error messages.
24
24
- Most reserved Javascript names (`return`, `const`, etc) are now usable.
@@ -28,9 +28,9 @@ This release saw major contributions from [a number of new contributors](https:/
28
28
- It is no longer necessary to sort modules in order of dependencies manually.
29
29
- Case statements matching data constructors no longer generate unnecessary constructor checks at runtime if there is only a single data constructor.
30
30
- New optimizer rules were added to inline JavaScript's built-in operators.
31
-
31
+
32
32
### Bug Fixes
33
-
33
+
34
34
- Floats parse correctly.
35
35
- Using data constructors in pattern matches now works properly across modules.
36
36
- PureScript modules no longer overwrite global objects with the same name.
@@ -43,7 +43,7 @@ This release saw major contributions from [a number of new contributors](https:/
43
43
- A bug which allowed skolem variables to escape their scope was add (thanks to Brian McKenna).
44
44
- Modules containing mutually recursive type synonyms and data declarations now compile correctly.
45
45
- A number of bugs in the optimizer were addressed.
46
-
46
+
47
47
### Libraries
48
48
49
49
- The `Prelude` has been greatly expanded. Definitions for built-in JavaScript operators have been moved into the Prelude.
Copy file name to clipboardExpand all lines: RELEASE-0.5.md
+3-3Lines changed: 3 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -54,7 +54,7 @@
54
54
- The escape check was removed, since it was too restrictive (paf31)
55
55
- The binary operator reordering step was greatly simplified (paf31)
56
56
- The Object type constructor can now be referenced explicitly as `Prim.Object` (with kind `# * -> *`) (paf31)
57
-
- Optimizations are now enabled by default and can be disabled with the `--no-tco` and `--no-magic-do` flags (garyb)
57
+
- Optimizations are now enabled by default and can be disabled with the `--no-tco` and `--no-magic-do` flags (garyb)
58
58
- Unary minus and signed numeric literals are now supported again (paf31, garyb)
59
59
- Type errors have been simplified, the full trace can be enabled with `--verbose-errors` or `-v` (paf31)
60
60
- Error messages now display source positions (paf31, garyb)
@@ -63,7 +63,7 @@
63
63
-`(++)` is now an alias for the Semigroup operator `(<>)` (paf31)
64
64
- Error messages for classes with undefined or missing members have been improved (garyb)
65
65
- The SYB dependency was removed, and traversals rewritten by hand, for a large performance increase (paf31)
66
-
66
+
67
67
### Bug Fixes
68
68
69
69
- The subsumes relation has been fixed for object types (paf31)
@@ -94,6 +94,6 @@
94
94
- The `grunt-purescript` plugin has been updated to provide support for new command line options.
95
95
- There is a new `gulp-purescript` plugin available for compiling with Gulp.
96
96
97
-
### Documentation
97
+
### Documentation
98
98
99
99
- There is a new `hierarchy` executable which will generate `.dot` diagrams based on the type class hierarchy of a module. The Prelude docs have been updated to include such a type class diagram. (joneshf)
0 commit comments