git.iko.soy/rowtype-yoga/purescript-native
on golang help sign in
Merge branch 'master' of github.com:purescript/purescript
2db1268joneshf
RELEASE-0.5.md+15−7
@@ -9,18 +9,23 @@
9 ...
9 ...
10
10
11- Prelude modules now follow a naming scheme similar to haskell (e.g. `Data.Maybe`, `Control.Monad`) (garyb)
11- Prelude modules now follow a naming scheme similar to haskell (e.g. `Data.Maybe`, `Control.Monad`) (garyb)
12+- Many modules that were previously part of the Prelude have been split into individual libraries, [now distributed via Bower](http://bower.io/search/?q=purescript) (garyb)
12- Multiple modules with the same name are now disallowed rather than merged (garyb)
13- Multiple modules with the same name are now disallowed rather than merged (garyb)
13- The `--runtime-type-checks` flag has been removed. Runtime type checks have been superceded by the `purescript-foreign` library (paf31)
14- The `--runtime-type-checks` flag has been removed. Runtime type checks have been superceded by the `purescript-foreign` library (paf31)
14−- The `Prelude` module is now imported automatically. Conflicts can be avoided by using qualified imports or a specific import list. (garyb, paf31)
15+- The `Prelude` module is now imported automatically. Conflicts can be avoided by using qualified imports or an explicit import list. (garyb, paf31)
15−- Overlapping instances are no longer allowed. The `Prelude` and core liblaries have been updated accordingly. (paf31)
16+- Overlapping instances are no longer allowed. The `Prelude` and core libraries have been updated accordingly. (paf31)
17+- `Functor`, `Applicative`, `Monad` are now part of a class heirarchy that include `Apply` and `Bind`. `return` is now an alias for `pure`. (joneshf, paf31, garyb)
18+- `Semigroupoid` is now a superclass of `Category` (garyb)
16
19
17### New Features
20### New Features
18
21
19−- Let bindings are now supported. The `let` keyword can introduce several local (possibly mutually recursive) bindings, along with optional type signatures. (paf31)
20- Multi parameter typeclasses (paf31)
22- Multi parameter typeclasses (paf31)
23+- Superclasses (puffnfresh, paf31)
24+- FlexibleInstances and FlexibleContexts (paf31)
25+- Let bindings are now supported. The `let` keyword can introduce several local (possibly mutually recursive) bindings, along with optional type signatures. (paf31)
26+- `where` clauses are now supported in value declarations, with the same rules as `let` bindings (garyb)
21- Empty data declarations and empty type classes are now supported (paf31)
27- Empty data declarations and empty type classes are now supported (paf31)
22- A new command line option `--codegen` controls which modules will have Javascript and externs generated (paf31)
28- A new command line option `--codegen` controls which modules will have Javascript and externs generated (paf31)
23−- `where` clauses are now supported in value declarations (garyb)
24
29
25### Enhancements
30### Enhancements
26
31
@@ -43,7 +48,7 @@
43- Case statements and functions which do not pattern match on their arguments now generate smaller code (paf31)
48- Case statements and functions which do not pattern match on their arguments now generate smaller code (paf31)
44- Imported type class instances are now exported (paf31)
49- Imported type class instances are now exported (paf31)
45- Some error messages were improved (paf31)
50- Some error messages were improved (paf31)
46−- Qualfied module imports are now supported as `import qualified M as X` (garyb).
51+- Qualfied module imports are now supported as `import qualified M as X` (garyb)
47- The escape check was removed, since it was too restrictive (paf31)
52- The escape check was removed, since it was too restrictive (paf31)
48- The binary operator reordering step was greatly simplified (paf31)
53- The binary operator reordering step was greatly simplified (paf31)
49- The Object type constructor can now be referenced explicitly as `Prim.Object` (with kind `# * -> *`) (paf31)
54- The Object type constructor can now be referenced explicitly as `Prim.Object` (with kind `# * -> *`) (paf31)
@@ -51,8 +56,10 @@
51- Unary minus and signed numeric literals are now supported again (paf31, garyb)
56- Unary minus and signed numeric literals are now supported again (paf31, garyb)
52- Type errors have been simplified, the full trace can be enabled with `--verbose-errors` or `-v` (paf31)
57- Type errors have been simplified, the full trace can be enabled with `--verbose-errors` or `-v` (paf31)
53- Error messages now display source positions (paf31, garyb)
58- Error messages now display source positions (paf31, garyb)
54−- The type classes implementation and code generation was greatly simplified. (paf31)
59+- The type classes implementation and code generation was greatly simplified (paf31)
55−- Object properties and row labels can now be accessed with arbitrary string names by using string literals. (paf31)
60+- Object properties and row labels can now be accessed with arbitrary string names by using string literals (paf31)
61+- `(++)` is now an alias for the Semigroup operator `(<>)` (paf31)
62+- Error messages for classes with undefined or missing members have been improved (garyb)
56
63
57### Bug Fixes
64### Bug Fixes
58
65
@@ -72,6 +79,7 @@
72- Characters in string literals are now properly escaped (garyb)
79- Characters in string literals are now properly escaped (garyb)
73- A module containing a single orphan type declaration and no other declarations now fails to compile (garyb)
80- A module containing a single orphan type declaration and no other declarations now fails to compile (garyb)
74- An error involving ordering of type class instances was fixed (garyb, paf31)
81- An error involving ordering of type class instances was fixed (garyb, paf31)
82+- Externs files no longer include fixity declarations for members that were removed as dead code (garyb)
75
83
76### Libraries
84### Libraries
77
85
prelude/prelude.purs+6−1
@@ -42,8 +42,13 @@ module Prelude where
42 class Show a where
42 class Show a where
43 show :: a -> String
43 show :: a -> String
44
44
45+ foreign import showStringImpl
46+ "function showStringImpl(s) {\
47+ \ return JSON.stringify(s);\
48+ \}" :: String -> String
49+
45 instance showString :: Show String where
50 instance showString :: Show String where
46− show s = s
51+ show = showStringImpl
47
52
48 instance showBoolean :: Show Boolean where
53 instance showBoolean :: Show Boolean where
49 show true = "true"
54 show true = "true"
purescript.cabal+6−6
@@ -1,5 +1,5 @@
1name: purescript
1name: purescript
2−version: 0.4.17
2+version: 0.4.17.1
3cabal-version: >=1.8
3cabal-version: >=1.8
4build-type: Custom
4build-type: Custom
5license: MIT
5license: MIT
@@ -19,7 +19,7 @@ data-dir: ""
19
19
20library
20library
21 build-depends: base >=4 && <5, cmdtheline -any, containers -any,
21 build-depends: base >=4 && <5, cmdtheline -any, containers -any,
22− directory >= 1.2, filepath -any, mtl -any, parsec -any, syb -any,
22+ directory >= 1.2, filepath -any, mtl -any, parsec -any, syb >= 0.4.1 && < 0.5,
23 transformers -any, utf8-string -any,
23 transformers -any, utf8-string -any,
24 pattern-arrows >= 0.0.2 && < 0.1,
24 pattern-arrows >= 0.0.2 && < 0.1,
25 monad-unify >= 0.2.1 && < 0.3,
25 monad-unify >= 0.2.1 && < 0.3,
@@ -87,7 +87,7 @@ library
87executable psc
87executable psc
88 build-depends: base >=4 && <5, cmdtheline -any, containers -any,
88 build-depends: base >=4 && <5, cmdtheline -any, containers -any,
89 directory -any, filepath -any, mtl -any, parsec -any,
89 directory -any, filepath -any, mtl -any, parsec -any,
90− purescript -any, syb -any, transformers -any, utf8-string -any
90+ purescript -any, syb >= 0.4.1 && < 0.5, transformers -any, utf8-string -any
91 main-is: Main.hs
91 main-is: Main.hs
92 buildable: True
92 buildable: True
93 hs-source-dirs: psc
93 hs-source-dirs: psc
@@ -97,7 +97,7 @@ executable psc
97executable psc-make
97executable psc-make
98 build-depends: base >=4 && <5, cmdtheline -any, containers -any,
98 build-depends: base >=4 && <5, cmdtheline -any, containers -any,
99 directory -any, filepath -any, mtl -any, parsec -any,
99 directory -any, filepath -any, mtl -any, parsec -any,
100− purescript -any, syb -any, transformers -any, utf8-string -any
100+ purescript -any, syb >= 0.4.1 && < 0.5, transformers -any, utf8-string -any
101 main-is: Main.hs
101 main-is: Main.hs
102 buildable: True
102 buildable: True
103 hs-source-dirs: psc-make
103 hs-source-dirs: psc-make
@@ -107,7 +107,7 @@ executable psc-make
107executable psci
107executable psci
108 build-depends: base >=4 && <5, containers -any, directory -any, filepath -any,
108 build-depends: base >=4 && <5, containers -any, directory -any, filepath -any,
109 mtl -any, parsec -any, haskeline -any, purescript -any,
109 mtl -any, parsec -any, haskeline -any, purescript -any,
110− syb -any, transformers -any, utf8-string -any, process -any,
110+ syb >= 0.4.1 && < 0.5, transformers -any, utf8-string -any, process -any,
111 xdg-basedir -any, cmdtheline -any
111 xdg-basedir -any, cmdtheline -any
112 main-is: Main.hs
112 main-is: Main.hs
113 buildable: True
113 buildable: True
@@ -127,7 +127,7 @@ executable docgen
127
127
128test-suite tests
128test-suite tests
129 build-depends: base >=4 && <5, containers -any, directory -any,
129 build-depends: base >=4 && <5, containers -any, directory -any,
130− filepath -any, mtl -any, parsec -any, purescript -any, syb -any,
130+ filepath -any, mtl -any, parsec -any, purescript -any, syb >= 0.4.1 && < 0.5,
131 transformers -any, utf8-string -any, process -any
131 transformers -any, utf8-string -any, process -any
132 type: exitcode-stdio-1.0
132 type: exitcode-stdio-1.0
133 main-is: Main.hs
133 main-is: Main.hs
src/Language/PureScript/Sugar/Names.hs+4−2
@@ -41,10 +41,11 @@ type ExportEnvironment = M.Map ModuleName Exports
41-- The exported declarations from a module.
41-- The exported declarations from a module.
42--
42--
43data Exports = Exports
43data Exports = Exports
44+ {
44 -- |
45 -- |
45 -- The types exported from each module
46 -- The types exported from each module
46 --
47 --
47− { exportedTypes :: [(ProperName, [ProperName])]
48+ exportedTypes :: [(ProperName, [ProperName])]
48 -- |
49 -- |
49 -- The classes exported from each module
50 -- The classes exported from each module
50 --
51 --
@@ -59,10 +60,11 @@ data Exports = Exports
59-- An imported environment for a particular module. This also contains the module's own members.
60-- An imported environment for a particular module. This also contains the module's own members.
60--
61--
61data ImportEnvironment = ImportEnvironment
62data ImportEnvironment = ImportEnvironment
63+ {
62 -- |
64 -- |
63 -- Local names for types within a module mapped to to their qualified names
65 -- Local names for types within a module mapped to to their qualified names
64 --
66 --
65− { importedTypes :: M.Map (Qualified ProperName) (Qualified ProperName)
67+ importedTypes :: M.Map (Qualified ProperName) (Qualified ProperName)
66 -- |
68 -- |
67 -- Local names for data constructors within a module mapped to to their qualified names
69 -- Local names for data constructors within a module mapped to to their qualified names
68 --
70 --
src/Language/PureScript/Sugar/TypeClasses.hs+2−3
@@ -57,8 +57,7 @@ desugarModule (Module name decls (Just exps)) = do
57 return $ Module name (concat declss) $ Just (exps ++ catMaybes newExpss)
57 return $ Module name (concat declss) $ Just (exps ++ catMaybes newExpss)
58desugarModule _ = error "Exports should have been elaborated in name desugaring"
58desugarModule _ = error "Exports should have been elaborated in name desugaring"
59
59
60−-- |
61−-- Desugar type class and type class instance declarations
60+{- Desugar type class and type class instance declarations
62--
61--
63-- Type classes become type synonyms for their dictionaries, and type instances become dictionary declarations.
62-- Type classes become type synonyms for their dictionaries, and type instances become dictionary declarations.
64-- Additional values are generated to access individual members of a dictionary, with the appropriate type.
63-- Additional values are generated to access individual members of a dictionary, with the appropriate type.
@@ -109,7 +108,7 @@ desugarModule _ = error "Exports should have been elaborated in name desugaring"
109-- }
108-- }
110-- sub: ""
109-- sub: ""
111-- }
110-- }
112−--
111+-}
113desugarDecl :: ModuleName -> Declaration -> Desugar (Maybe DeclarationRef, [Declaration])
112desugarDecl :: ModuleName -> Declaration -> Desugar (Maybe DeclarationRef, [Declaration])
114desugarDecl mn d@(TypeClassDeclaration name args implies members) = do
113desugarDecl mn d@(TypeClassDeclaration name args implies members) = do
115 modify (M.insert (mn, name) d)
114 modify (M.insert (mn, name) d)
src/Language/PureScript/TypeChecker/Monad.hs+1−1
@@ -143,7 +143,7 @@ getEnv :: (Functor m, MonadState CheckState m) => m Environment
143getEnv = checkEnv <$> get
143getEnv = checkEnv <$> get
144
144
145-- |
145-- |
146−-- Update the @Environment#
146+-- Update the @Environment@
147--
147--
148putEnv :: (MonadState CheckState m) => Environment -> m ()
148putEnv :: (MonadState CheckState m) => Environment -> m ()
149putEnv env = modify (\s -> s { checkEnv = env })
149putEnv env = modify (\s -> s { checkEnv = env })
src/Language/PureScript/TypeChecker/Types.hs+2−2
@@ -888,7 +888,7 @@ check' v@(Var var) ty = do
888 Nothing -> throwError . strMsg $ "Unable to check type subsumption"
888 Nothing -> throwError . strMsg $ "Unable to check type subsumption"
889 Just v'' -> return $ TypedValue True v'' ty'
889 Just v'' -> return $ TypedValue True v'' ty'
890check' (SuperClassDictionary className tys) _ = do
890check' (SuperClassDictionary className tys) _ = do
891− -- |
891+ {-
892 -- Here, we replace a placeholder for a superclass dictionary with a regular
892 -- Here, we replace a placeholder for a superclass dictionary with a regular
893 -- TypeClassDictionary placeholder. The reason we do this is that it is necessary to have the
893 -- TypeClassDictionary placeholder. The reason we do this is that it is necessary to have the
894 -- correct super instance dictionaries in scope, and these are not available when the type class
894 -- correct super instance dictionaries in scope, and these are not available when the type class
@@ -897,7 +897,7 @@ check' (SuperClassDictionary className tys) _ = do
897 -- Note also that the first argument to TypeClassDictionary is False, meaning we _do not_ want
897 -- Note also that the first argument to TypeClassDictionary is False, meaning we _do not_ want
898 -- to consider superclass instances when searching for this dictionary - doing so might lead
898 -- to consider superclass instances when searching for this dictionary - doing so might lead
899 -- to traversing a cycle in the instance graph.
899 -- to traversing a cycle in the instance graph.
900− --
900+ -}
901 dicts <- getTypeClassDictionaries
901 dicts <- getTypeClassDictionaries
902 return $ TypeClassDictionary False (className, tys) dicts
902 return $ TypeClassDictionary False (className, tys) dicts
903check' (TypedValue checkType val ty1) ty2 = do
903check' (TypedValue checkType val ty1) ty2 = do