git.iko.soy/rowtype-yoga/purescript-native
on golang help sign in
trim trailing whitespace
commit525b75254150d3d978cd5f0573fdbecf87e8d163 authorDavid Chambers <dc@davidchambers.me> dateSat 24 Jan 2015, 12:05 (12 years ago) parent145c4c5
90 files changed+265−265
LICENSE+35−35 RELEASE-0.2.md+13−13 RELEASE-0.3.md+8−8 RELEASE-0.4.md+8−8 RELEASE-0.5.md+3−3 RELEASE-0.7.md+6−6 bundle/README+4−4 bundle/build.sh+1−1 bundle/winbuild.sh+3−3 examples/failing/NewtypeMultiArgs.purs+1−1 examples/failing/NewtypeMultiCtor.purs+1−1 examples/failing/SkolemEscape2.purs+1−1 examples/failing/UnknownType.purs+1−1 examples/manual/failing/ArgLengthMismatch.purs+1−1 examples/manual/failing/ExportExplicit.purs+1−1 examples/manual/failing/ExportExplicit1.purs+2−2 examples/manual/failing/ExportExplicit2.purs+1−1 examples/manual/failing/ExportExplicit3.purs+1−1 examples/manual/failing/RedefinedFixity.purs+1−1 examples/manual/failing/RequiredHiddenType.purs+2−2 examples/manual/passing/ExportExplicit.purs+2−2 examples/manual/passing/ExportExplicit2.purs+1−1 examples/manual/passing/Import.purs+1−1 examples/manual/passing/ImportExplicit.purs+1−1 examples/manual/passing/ImportQualified.purs+3−3 examples/manual/passing/Module.purs+1−1 examples/manual/passing/ModuleDeps.purs+1−1 examples/passing/BindersInFunctions.purs+2−2 examples/passing/BindingGroups.purs+2−2 examples/passing/CheckSynonymBug.purs+1−1 examples/passing/Conditional.purs+1−1 examples/passing/Console.purs+1−1 examples/passing/DeepArrayBinder.purs+1−1 examples/passing/DeepCase.purs+2−2 examples/passing/Dollar.purs+1−1 examples/passing/EmptyRow.purs+1−1 examples/passing/FFI.purs+1−1 examples/passing/FinalTagless.purs+1−1 examples/passing/FunctionScope.purs+1−1 examples/passing/Guards.purs+2−2 examples/passing/JSReserved.purs+2−2 examples/passing/KindedType.purs+1−1 examples/passing/Let.purs+7−7 examples/passing/Monad.purs+2−2 examples/passing/MutRec.purs+1−1 examples/passing/MutRec2.purs+1−1 examples/passing/MutRec3.purs+1−1 examples/passing/NamedPatterns.purs+1−1 examples/passing/Newtype.purs+3−3 examples/passing/ObjectSynonym.purs+1−1 examples/passing/ObjectUpdate2.purs+1−1 examples/passing/Objects.purs+1−1 examples/passing/Operators.purs+5−5 examples/passing/OptimizerBug.purs+1−1 examples/passing/Patterns.purs+3−3 examples/passing/Person.purs+3−3 examples/passing/Rank2Data.purs+1−1 examples/passing/Rank2TypeSynonym.purs+2−2 examples/passing/Rank2Types.purs+1−1 examples/passing/Recursion.purs+1−1 examples/passing/Sequence.purs+2−2 examples/passing/ShadowedTCOLet.purs+3−3 examples/passing/SignedNumericLiterals.purs+2−2 examples/passing/Superclasses3.purs+1−1 examples/passing/TailCall.purs+2−2 examples/passing/TopLevelCase.purs+1−1 examples/passing/TypeClassImport.purs+3−3 examples/passing/TypeClassMemberOrderChange.purs+1−1 examples/passing/TypeDecl.purs+1−1 examples/passing/TypeSynonyms.purs+2−2 examples/passing/TypeWildcardsRecordExtension.purs+1−1 examples/passing/Where.purs+6−6 examples/passing/s.purs+1−1 psc-docs/Main.hs+4−4 psc-make/Main.hs+9−9 psc/Main.hs+11−11 psci/Parser.hs+4−4 purescript.cabal+1−1 src/Language/PureScript/AST/SourcePos.hs+2−2 src/Language/PureScript/CodeGen/Externs.hs+1−1 src/Language/PureScript/CodeGen/JS.hs+2−2 src/Language/PureScript/Comments.hs+2−2 src/Language/PureScript/CoreFn/Ann.hs+1−1 src/Language/PureScript/Parser.hs+1−1 src/Language/PureScript/Parser/Lexer.hs+30−30 src/Language/PureScript/Pretty/JS.hs+4−4 src/Language/PureScript/Pretty/Types.hs+1−1 src/Language/PureScript/Sugar/BindingGroups.hs+3−3 src/Language/PureScript/TypeChecker/Unify.hs+1−1 tests/Main.hs+2−2
LICENSE+35−35
@@ -41,43 +41,43 @@ PureScript uses the following Haskell library packages. Their license files foll
4141base LICENSE file:
4242
4343 This library (libraries/base) is derived from code from several
44− sources:
45−
44+ sources:
45+
4646 * Code from the GHC project which is largely (c) The University of
4747 Glasgow, and distributable under a BSD-style license (see below),
48−
48+
4949 * Code from the Haskell 98 Report which is (c) Simon Peyton Jones
5050 and freely redistributable (but see the full license for
5151 restrictions).
52−
52+
5353 * Code from the Haskell Foreign Function Interface specification,
5454 which is (c) Manuel M. T. Chakravarty and freely redistributable
5555 (but see the full license for restrictions).
56−
56+
5757 The full text of these licenses is reproduced below. All of the
5858 licenses are BSD-style or compatible.
59−
59+
6060 -----------------------------------------------------------------------------
61−
61+
6262 The Glasgow Haskell Compiler License
63−
64− Copyright 2004, The University Court of the University of Glasgow.
63+
64+ Copyright 2004, The University Court of the University of Glasgow.
6565 All rights reserved.
66−
66+
6767 Redistribution and use in source and binary forms, with or without
6868 modification, are permitted provided that the following conditions are met:
69−
69+
7070 - Redistributions of source code must retain the above copyright notice,
7171 this list of conditions and the following disclaimer.
72−
72+
7373 - Redistributions in binary form must reproduce the above copyright notice,
7474 this list of conditions and the following disclaimer in the documentation
7575 and/or other materials provided with the distribution.
76−
76+
7777 - Neither name of the University nor the names of its contributors may be
7878 used to endorse or promote products derived from this software without
79− specific prior written permission.
80−
79+ specific prior written permission.
80+
8181 THIS SOFTWARE IS PROVIDED BY THE UNIVERSITY COURT OF THE UNIVERSITY OF
8282 GLASGOW AND THE CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
8383 INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
@@ -90,14 +90,14 @@ base LICENSE file:
9090 LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
9191 OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
9292 DAMAGE.
93−
93+
9494 -----------------------------------------------------------------------------
95−
95+
9696 Code derived from the document "Report on the Programming Language
9797 Haskell 98", is distributed under the following license:
98−
98+
9999 Copyright (c) 2002 Simon Peyton Jones
100−
100+
101101 The authors intend this Report to belong to the entire Haskell
102102 community, and so we grant permission to copy and distribute it for
103103 any purpose, provided that it is reproduced in its entirety,
@@ -105,15 +105,15 @@ base LICENSE file:
105105 copied and distributed for any purpose, provided that the modified
106106 version is clearly presented as such, and that it does not claim to
107107 be a definition of the Haskell 98 Language.
108−
108+
109109 -----------------------------------------------------------------------------
110−
110+
111111 Code derived from the document "The Haskell 98 Foreign Function
112112 Interface, An Addendum to the Haskell 98 Report" is distributed under
113113 the following license:
114−
114+
115115 Copyright (c) 2002 Manuel M. T. Chakravarty
116−
116+
117117 The authors intend this Report to belong to the entire Haskell
118118 community, and so we grant permission to copy and distribute it for
119119 any purpose, provided that it is reproduced in its entirety,
@@ -121,9 +121,9 @@ base LICENSE file:
121121 copied and distributed for any purpose, provided that the modified
122122 version is clearly presented as such, and that it does not claim to
123123 be a definition of the Haskell 98 Foreign Function Interface.
124−
124+
125125 -----------------------------------------------------------------------------
126−
126+
127127containers LICENSE file:
128128
129129 The Glasgow Haskell Compiler License
@@ -161,7 +161,7 @@ containers LICENSE file:
161161directory LICENSE file:
162162
163163 This library (libraries/base) is derived from code from two
164− sources:
164+ sources:
165165
166166 * Code from the GHC project which is largely (c) The University of
167167 Glasgow, and distributable under a BSD-style license (see below),
@@ -177,7 +177,7 @@ directory LICENSE file:
177177
178178 The Glasgow Haskell Compiler License
179179
180− Copyright 2004, The University Court of the University of Glasgow.
180+ Copyright 2004, The University Court of the University of Glasgow.
181181 All rights reserved.
182182
183183 Redistribution and use in source and binary forms, with or without
@@ -185,14 +185,14 @@ directory LICENSE file:
185185
186186 - Redistributions of source code must retain the above copyright notice,
187187 this list of conditions and the following disclaimer.
188−
188+
189189 - Redistributions in binary form must reproduce the above copyright notice,
190190 this list of conditions and the following disclaimer in the documentation
191191 and/or other materials provided with the distribution.
192−
192+
193193 - Neither name of the University nor the names of its contributors may be
194194 used to endorse or promote products derived from this software without
195− specific prior written permission.
195+ specific prior written permission.
196196
197197 THIS SOFTWARE IS PROVIDED BY THE UNIVERSITY COURT OF THE UNIVERSITY OF
198198 GLASGOW AND THE CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
@@ -451,7 +451,7 @@ pattern-arrows LICENSE file:
451451process LICENSE file:
452452
453453 This library (libraries/process) is derived from code from two
454− sources:
454+ sources:
455455
456456 * Code from the GHC project which is largely (c) The University of
457457 Glasgow, and distributable under a BSD-style license (see below),
@@ -467,7 +467,7 @@ process LICENSE file:
467467
468468 The Glasgow Haskell Compiler License
469469
470− Copyright 2004, The University Court of the University of Glasgow.
470+ Copyright 2004, The University Court of the University of Glasgow.
471471 All rights reserved.
472472
473473 Redistribution and use in source and binary forms, with or without
@@ -475,14 +475,14 @@ process LICENSE file:
475475
476476 - Redistributions of source code must retain the above copyright notice,
477477 this list of conditions and the following disclaimer.
478−
478+
479479 - Redistributions in binary form must reproduce the above copyright notice,
480480 this list of conditions and the following disclaimer in the documentation
481481 and/or other materials provided with the distribution.
482−
482+
483483 - Neither name of the University nor the names of its contributors may be
484484 used to endorse or promote products derived from this software without
485− specific prior written permission.
485+ specific prior written permission.
486486
487487 THIS SOFTWARE IS PROVIDED BY THE UNIVERSITY COURT OF THE UNIVERSITY OF
488488 GLASGOW AND THE CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
RELEASE-0.2.md+13−13
@@ -10,31 +10,31 @@ Many thanks to the [contributors](https://github.com/purescript/purescript/graph
1010- RankNTypes
1111
1212 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+
1414 rank2 :: (forall a. a -> a) -> Number
1515 rank2 = \f -> if f true then f 1 else f 2
16−
16+
1717- Modules
1818- Polymorphic Object Update
1919
2020 Records now support member update in which the type of the field changes during the update. For example:
2121
2222 data Wrap a = Wrap a
23−
23+
2424 update = \o -> o { prop = Wrap o.prop }
2525
2626### Enhancements
2727
2828- Naked expressions as statements
29−
29+
3030 Naked expressions of type `{}` can now be used as statements.
3131
3232- Split code generation into `AST -> JS` and `JS -> String`
33−
33+
3434 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+
3636- Syntactic sugar for introducing curried functions
37−
37+
3838 Single-argument functions and multiple-argument functions can now be introduced in the same way:
3939
4040 test = \a (b, c) d -> a + b + c + d
@@ -42,32 +42,32 @@ Many thanks to the [contributors](https://github.com/purescript/purescript/graph
4242- JavaScript optimizations
4343
4444 Some basic dead-variable elimination, inlining and eta-conversion are now performed on the generated JavaScript.
45−
45+
4646- Generate formatted Javascript
4747
4848 The generated JavaScript is now formatted to be more readable. In particular, newlines get generated, and the correct indentation is used.
4949
5050- More valid infix operators
51−
51+
5252 The colon and period characters are now valid in infix operator names.
5353
5454### Syntax Changes
5555
5656- Avoid 'do' keyword for blocks
57−
57+
5858 `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.
5959
6060- Member foreign import syntax
6161
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.
6363
6464- Make FFI syntax match Haskell
65−
65+
6666 Use `foreign import` instead of `extern`.
6767
6868- Make record declaration syntax match Haskell
6969- Simplify array binders
70−
70+
7171 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]`.
7272
7373- Array indexing syntax is ambiguous
RELEASE-0.3.md+8−8
@@ -14,40 +14,40 @@ Many thanks to the [contributors](https://github.com/purescript/purescript/graph
1414 sum (x:xs) = x + sum xs
1515
1616- 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+
1818 class Truthy a where
1919 isTrue :: a -> Boolean
20−
20+
2121 instance Truthy Boolean where
2222 isTrue b = b
23−
23+
2424 instance Truthy String where
2525 isTrue "" = false
2626 isTrue _ = true
27−
27+
2828 ifThenElse :: forall a b. (Truthy a) => a -> b -> b -> b
2929 ifThenElse a tr fa = if isTrue a then tr else fa
3030
3131- There is now support for `do` notation, using the `Monad` type class from the `Prelude` module. For example:
3232
3333 data Maybe = Nothing | Just a
34−
34+
3535 instance Prelude.Monad Maybe where
3636 ret = Just
3737 (>>=) Nothing _ = Nothing
3838 (>>=) (Just a) f = f a
39−
39+
4040 test = do
4141 x <- Just 1
4242 y <- Just 2
4343 ret $ x + y
44−
44+
4545- 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:
4646
4747 test = do
4848 trace "Testing"
4949 throwError "Error!"
50−
50+
5151 has inferred type `forall eff. Eff (trace :: Trace | error :: Error String | eff)`.
5252 See the `/examples/passing/Eff.purs` file for a more in-depth set of examples.
5353 Supported native effects currently include `ST`, `Trace`, `Error` and `DOM` (via the `libraries/jquery` module).
RELEASE-0.4.md+8−8
@@ -8,17 +8,17 @@ This release saw major contributions from [a number of new contributors](https:/
88- Try out the latest features [here](http://tryps.functorial.com).
99
1010## Breaking Changes
11−
11+
1212- Multiple argument functions are no longer available.
1313- 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.
1414- 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+
1616### New Features
17−
17+
1818- 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+
2020### Enhancements
21−
21+
2222- The `->` and `[]` types are now usable in type class instances.
2323- The file path is included in syntax error messages.
2424- 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:/
2828- It is no longer necessary to sort modules in order of dependencies manually.
2929- Case statements matching data constructors no longer generate unnecessary constructor checks at runtime if there is only a single data constructor.
3030- New optimizer rules were added to inline JavaScript's built-in operators.
31−
31+
3232### Bug Fixes
33−
33+
3434- Floats parse correctly.
3535- Using data constructors in pattern matches now works properly across modules.
3636- 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:/
4343- A bug which allowed skolem variables to escape their scope was add (thanks to Brian McKenna).
4444- Modules containing mutually recursive type synonyms and data declarations now compile correctly.
4545- A number of bugs in the optimizer were addressed.
46−
46+
4747### Libraries
4848
4949- The `Prelude` has been greatly expanded. Definitions for built-in JavaScript operators have been moved into the Prelude.
RELEASE-0.5.md+3−3
@@ -54,7 +54,7 @@
5454- The escape check was removed, since it was too restrictive (paf31)
5555- The binary operator reordering step was greatly simplified (paf31)
5656- 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)
5858- Unary minus and signed numeric literals are now supported again (paf31, garyb)
5959- Type errors have been simplified, the full trace can be enabled with `--verbose-errors` or `-v` (paf31)
6060- Error messages now display source positions (paf31, garyb)
@@ -63,7 +63,7 @@
6363- `(++)` is now an alias for the Semigroup operator `(<>)` (paf31)
6464- Error messages for classes with undefined or missing members have been improved (garyb)
6565- The SYB dependency was removed, and traversals rewritten by hand, for a large performance increase (paf31)
66−
66+
6767### Bug Fixes
6868
6969- The subsumes relation has been fixed for object types (paf31)
@@ -94,6 +94,6 @@
9494- The `grunt-purescript` plugin has been updated to provide support for new command line options.
9595- There is a new `gulp-purescript` plugin available for compiling with Gulp.
9696
97−### Documentation
97+### Documentation
9898
9999- 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)
RELEASE-0.7.md+6−6
@@ -12,7 +12,7 @@ positive _ = false
1212but this is not:
1313
1414```haskell
15−positive n | n > 0
15+positive n | n > 0
1616 = true
1717positive _ = false
1818```
@@ -32,20 +32,20 @@ positive _ = false
3232
3333### Breaking Changes
3434
35−-
35+-
3636
3737### New Features
3838
39−-
39+-
4040
4141### Enhancements
4242
43−-
43+-
4444
4545### Libraries
4646
47−-
47+-
4848
4949### Documentation
5050
51−-
51+-
bundle/README+4−4
@@ -1,9 +1,9 @@
1− ____ ____ _ _
2−| _ \ _ _ _ __ ___/ ___| ___ _ __(_)_ __ | |_
1+ ____ ____ _ _
2+| _ \ _ _ _ __ ___/ ___| ___ _ __(_)_ __ | |_
33| |_) | | | | '__/ _ \___ \ / __| '__| | '_ \| __|
4−| __/| |_| | | | __/___) | (__| | | | |_) | |_
4+| __/| |_| | | | __/___) | (__| | | | |_) | |_
55|_| \__,_|_| \___|____/ \___|_| |_| .__/ \__|
6− |_|
6+ |_|
77
88Installation Instructions
99-------------------------
bundle/build.sh+1−1
@@ -4,7 +4,7 @@ SCRIPTPATH=$( cd "$(dirname "$0")" ; pwd -P )
44
55OS=$1
66
7−if [ -z $OS ]
7+if [ -z $OS ]
88then
99 echo "Usage: build.sh osname"
1010 exit 1
bundle/winbuild.sh+3−3
@@ -26,9 +26,9 @@ cp README build/purescript/
2626cp ../LICENSE build/purescript/
2727
2828# Make the binary bundle
29−pushd build
29+pushd build
3030tar -zcvf ../win64.tar.gz purescript
31−popd
31+popd
3232
3333# Calculate the MD5 hash
3434md5sum win64.tar.gz > win64.md5
@@ -36,5 +36,5 @@ md5sum win64.tar.gz > win64.md5
3636# Remove the staging directory
3737rm -rf build/
3838
39−popd
39+popd
4040
examples/failing/NewtypeMultiArgs.purs+1−1
@@ -1,3 +1,3 @@
11module Main where
22
3−newtype Thing = Thing String Boolean
3+newtype Thing = Thing String Boolean
examples/failing/NewtypeMultiCtor.purs+1−1
@@ -1,3 +1,3 @@
11module Main where
22
3−newtype Thing = Thing String | Other
3+newtype Thing = Thing String | Other
examples/failing/SkolemEscape2.purs+1−1
@@ -6,4 +6,4 @@ import Control.Monad.ST
66
77test _ = do
88 r <- runST (newSTRef 0)
9− return 0
9+ return 0
examples/failing/UnknownType.purs+1−1
@@ -1,4 +1,4 @@
11module Main where
22
33test :: Number -> Something
4−test = {}
4+test = {}
examples/manual/failing/ArgLengthMismatch.purs+1−1
@@ -1,4 +1,4 @@
11module ArgLengthMismatch where
22
33 f x y = true
4− f = false
4+ f = false
examples/manual/failing/ExportExplicit.purs+1−1
@@ -2,4 +2,4 @@
22module M1 (x, y, z) where
33
44 x = 1
5− y = 2
5+ y = 2
examples/manual/failing/ExportExplicit1.purs+2−2
@@ -5,9 +5,9 @@ module M1 (X(X)) where
55module Main where
66
77 import M1
8−
8+
99 testX = X
10−
10+
1111 -- should fail as Y constructor is not exported from M1
1212 testY = Y
1313
examples/manual/failing/ExportExplicit2.purs+1−1
@@ -2,4 +2,4 @@
22module M1 (X(Y)) where
33
44 data X = X
5− data Y = Y
5+ data Y = Y
examples/manual/failing/ExportExplicit3.purs+1−1
@@ -6,7 +6,7 @@ module M1 (X(..)) where
66module Main where
77
88 import M1
9−
9+
1010 -- should fail as Z is not exported from M1
1111 testZ = M1.Z
1212
examples/manual/failing/RedefinedFixity.purs+1−1
@@ -1,6 +1,6 @@
11module RedefinedFixity where
22
33 (!?) x y = x + y
4−
4+
55 infix 2 !?
66 infix 2 !?
examples/manual/failing/RequiredHiddenType.purs+2−2
@@ -3,6 +3,6 @@ module Foo (B(..), a, b) where
33
44 data A = A
55 data B = B
6−
6+
77 a = A
8− b = B
8+ b = B
examples/manual/passing/ExportExplicit.purs+2−2
@@ -3,7 +3,7 @@ module M1 (X(X), Z(..), foo) where
33 data X = X | Y
44 data Z = Z
55
6− foo :: Number
6+ foo :: Number
77 foo = 0
88
99 bar :: Number
@@ -12,7 +12,7 @@ module M1 (X(X), Z(..), foo) where
1212module Main where
1313
1414 import M1
15−
15+
1616 testX = X
1717 testZ = Z
1818 testFoo = foo
examples/manual/passing/ExportExplicit2.purs+1−1
@@ -1,6 +1,6 @@
11module M1 (bar) where
22
3− foo :: Number
3+ foo :: Number
44 foo = 0
55
66 bar :: Number
examples/manual/passing/Import.purs+1−1
@@ -13,7 +13,7 @@ module M2 where
1313 import M1
1414
1515 main = \_ -> foo 42
16−
16+
1717module Main where
1818
1919main = Debug.Trace.trace "Done"
examples/manual/passing/ImportExplicit.purs+1−1
@@ -7,7 +7,7 @@ module Main where
77
88 import M1 (X(..))
99
10− testX :: X
10+ testX :: X
1111 testX = X
1212 testY = Y
1313
examples/manual/passing/ImportQualified.purs+3−3
@@ -1,5 +1,5 @@
11module M1 where
2−
2+
33 trace x = x
44
55module Main where
@@ -8,5 +8,5 @@ module Main where
88 import Control.Monad.Eff
99 import M1
1010 import qualified Debug.Trace as T
11−
12− main = T.trace (trace "Done")
11+
12+ main = T.trace (trace "Done")
examples/manual/passing/Module.purs+1−1
@@ -22,7 +22,7 @@ module M2 where
2222
2323 match :: M1.Foo -> String
2424 match = \f -> case f of M1.Foo s -> s ++ "foo"
25−
25+
2626module Main where
2727
2828main = Debug.Trace.trace "Done"
examples/manual/passing/ModuleDeps.purs+1−1
@@ -11,7 +11,7 @@ bar = M3.baz
1111module M3 where
1212
1313baz = 1
14−
14+
1515module Main where
1616
1717main = Debug.Trace.trace "Done"
examples/passing/BindersInFunctions.purs+2−2
@@ -11,8 +11,8 @@ foreign import error
1111 }
1212 """ :: forall a. String -> a
1313
14−main =
14+main =
1515 let ts = tail [1, 2, 3] in
16− if ts == [2, 3]
16+ if ts == [2, 3]
1717 then Debug.Trace.trace "Done"
1818 else error "Incorrect result from 'tails'."
examples/passing/BindingGroups.purs+2−2
@@ -1,6 +1,6 @@
11module Main where
2−
3−foo = bar
2+
3+foo = bar
44 where bar r = r + 1
55
66r = foo 2
examples/passing/CheckSynonymBug.purs+1−1
@@ -2,7 +2,7 @@ module Main where
22
33 import Prelude
44
5− type Foo a = [a]
5+ type Foo a = [a]
66
77 foreign import length
88 """
examples/passing/Conditional.purs+1−1
@@ -2,7 +2,7 @@ module Main where
22
33 import Prelude ()
44
5− fns = \f -> if f true then f else \x -> x
5+ fns = \f -> if f true then f else \x -> x
66
77 not = \x -> if x then false else true
88
examples/passing/Console.purs+1−1
@@ -9,5 +9,5 @@ replicateM_ 0 _ = return {}
99replicateM_ n act = do
1010 act
1111 replicateM_ (n - 1) act
12−
12+
1313main = replicateM_ 10 (trace "Hello World!")
examples/passing/DeepArrayBinder.purs+1−1
@@ -6,7 +6,7 @@ match2 :: [Number] -> Number
66match2 (x : y : xs) = x * y + match2 xs
77match2 _ = 0
88
9−foreign import explode
9+foreign import explode
1010 """
1111 function explode() {
1212 throw new Error('Incorrect result');
examples/passing/DeepCase.purs+2−2
@@ -4,9 +4,9 @@ import Debug.Trace
44import Control.Monad.Eff
55import Control.Monad.ST
66
7−f x y =
7+f x y =
88 let
9− g = case y of
9+ g = case y of
1010 0 -> x
1111 x -> 1 + x * x
1212 in g + x + y
examples/passing/Dollar.purs+1−1
@@ -12,5 +12,5 @@ id x = x
1212test1 x = id $ id $ id $ id $ x
1313
1414test2 x = id id $ id x
15−
15+
1616main = Debug.Trace.trace "Done"
examples/passing/EmptyRow.purs+1−1
@@ -1,6 +1,6 @@
11module Main where
22
3−data Foo r = Foo { | r }
3+data Foo r = Foo { | r }
44
55test :: Foo ()
66test = Foo {}
examples/passing/FFI.purs+1−1
@@ -1,6 +1,6 @@
11module Main where
22
3−foreign import foo
3+foreign import foo
44 """
55 function foo(s) {
66 return s;
examples/passing/FinalTagless.purs+1−1
@@ -5,7 +5,7 @@ import Prelude
55class E e where
66 num :: Number -> e Number
77 add :: e Number -> e Number -> e Number
8−
8+
99type Expr a = forall e. (E e) => e a
1010
1111data Id a = Id a
examples/passing/FunctionScope.purs+1−1
@@ -5,7 +5,7 @@ module Main where
55 mkValue :: Number -> Number
66 mkValue id = id
77
8− foreign import error
8+ foreign import error
99 """
1010 function error(msg) {
1111 throw msg;
examples/passing/Guards.purs+2−2
@@ -21,9 +21,9 @@ module Main where
2121 | otherwise -> m
2222
2323 testIndentation :: Number -> Number -> Number
24− testIndentation x y | x > 0
24+ testIndentation x y | x > 0
2525 = x + y
26− | otherwise
26+ | otherwise
2727 = y - x
2828
2929 main = Debug.Trace.trace $ min "Done" "ZZZZ"
examples/passing/JSReserved.purs+2−2
@@ -4,9 +4,9 @@ module Main where
44
55 yield = 0
66 member = 1
7−
7+
88 public = \return -> return
9−
9+
1010 this catch = catch
1111
1212 main = Debug.Trace.trace "Done"
examples/passing/KindedType.purs+1−1
@@ -26,6 +26,6 @@ class Clazz (a :: *) where
2626 def :: a
2727
2828instance clazzString :: Clazz String where
29− def = "test"
29+ def = "test"
3030
3131main = Debug.Trace.trace "Done"
examples/passing/Let.purs+7−7
@@ -4,12 +4,12 @@ import Prelude
44import Control.Monad.Eff
55import Control.Monad.ST
66
7−test1 x = let
7+test1 x = let
88 y :: Number
9− y = x + 1
9+ y = x + 1
1010 in y
1111
12−test2 x y =
12+test2 x y =
1313 let x' = x + 1 in
1414 let y' = y + 1 in
1515 x' + y'
@@ -17,10 +17,10 @@ test2 x y =
1717test3 = let f x y z = x + y + z in
1818 f 1 2 3
1919
20−test4 = let f x [y, z] = x y z in
20+test4 = let f x [y, z] = x y z in
2121 f (+) [1, 2]
2222
23−test5 = let
23+test5 = let
2424 f x | x > 0 = g (x / 2) + 1
2525 f x = 0
2626 g x = f (x - 1) + 1
@@ -42,12 +42,12 @@ test7 = let
4242 in if f true then f 1 else f 2
4343
4444test8 :: Number -> Number
45−test8 x = let
45+test8 x = let
4646 go y | (x - 0.1 < y * y) && (y * y < x + 0.1) = y
4747 go y = go $ (y + x / y) / 2
4848 in go x
4949
50−test10 _ =
50+test10 _ =
5151 let
5252 f x = g x * 3
5353 g x = f x / 2
examples/passing/Monad.purs+2−2
@@ -17,12 +17,12 @@ module Main where
1717 maybe = { return : Just
1818 , bind : \ma f -> case ma of
1919 Nothing -> Nothing
20− Just a -> f a
20+ Just a -> f a
2121 }
2222
2323 test :: forall m. Monad m -> m Number
2424 test = \m -> m.bind (m.return 1) (\n1 ->
25− m.bind (m.return "Test") (\n2 ->
25+ m.bind (m.return "Test") (\n2 ->
2626 m.return n1))
2727
2828 test1 = test id
examples/passing/MutRec.purs+1−1
@@ -1,4 +1,4 @@
1−module Main where
1+module Main where
22
33 import Prelude
44
examples/passing/MutRec2.purs+1−1
@@ -1,7 +1,7 @@
11module Main where
22
33data A = A B
4−
4+
55data B = B A
66
77foreign import data S :: *
examples/passing/MutRec3.purs+1−1
@@ -1,7 +1,7 @@
11module Main where
22
33data A = A B
4−
4+
55data B = B A
66
77foreign import data S :: *
examples/passing/NamedPatterns.purs+1−1
@@ -1,6 +1,6 @@
11module Main where
22
3− foo = \x -> case x of
3+ foo = \x -> case x of
44 y@{ foo = "Foo" } -> y
55 y -> y
66
examples/passing/Newtype.purs+3−3
@@ -12,11 +12,11 @@ newtype Box a = Box a
1212
1313instance showBox :: (Show a) => Show (Box a) where
1414 show (Box x) = "Box " ++ show x
15−
15+
1616apply f x = f x
17−
17+
1818main = do
1919 print $ Thing "hello"
2020 print $ Box 42
2121 print $ apply Box 9000
22− trace "Done"
22+ trace "Done"
examples/passing/ObjectSynonym.purs+1−1
@@ -10,4 +10,4 @@ type Outer = { inner :: Inner }
1010outer :: Outer
1111outer = { inner: inner }
1212
13−main = Debug.Trace.trace "Done"
13+main = Debug.Trace.trace "Done"
examples/passing/ObjectUpdate2.purs+1−1
@@ -7,7 +7,7 @@ foreign import x "var x = {};" :: forall r. X r
77blah :: forall r. X r -> X r
88blah x = x
99
10−test = blah x
10+test = blah x
1111 { baz = "blah"
1212 }
1313
examples/passing/Objects.purs+1−1
@@ -31,5 +31,5 @@ module Main where
3131 { "***": n } -> n
3232
3333 test7 {a: snoog , b : blah } = blah
34−
34+
3535 main = Debug.Trace.trace "Done"
examples/passing/Operators.purs+5−5
@@ -2,7 +2,7 @@ module Main where
22
33 import Control.Monad.Eff
44 import Debug.Trace
5−
5+
66 (?!) :: forall a. a -> a -> a
77 (?!) x _ = x
88
@@ -29,7 +29,7 @@ module Main where
2929
3030 test6 = ((\x -> x) `k` 2) 3
3131
32− (<+>) :: String -> String -> String
32+ (<+>) :: String -> String -> String
3333 (<+>) = \s1 s2 -> s1 ++ s2
3434
3535 test7 = "Hello" <+> "World!"
@@ -39,7 +39,7 @@ module Main where
3939
4040 foo :: String -> String
4141 foo = \s -> s
42−
42+
4343 test8 = foo @@ "Hello World"
4444
4545 test9 = Main.foo @@ "Hello World"
@@ -52,7 +52,7 @@ module Main where
5252 test11 = [1, 2, 3] ... [4, 5, 6]
5353
5454 test12 (<%>) a b = a <%> b
55−
55+
5656 test13 = \(<%>) a b -> a <%> b
5757
5858 test14 :: Number -> Number -> Boolean
@@ -61,7 +61,7 @@ module Main where
6161 test15 :: Number -> Number -> Boolean
6262 test15 a b = const false $ a `test14` b
6363
64− test16 :: Number -> Number -> Number
64+ test16 :: Number -> Number -> Number
6565 test16 x y = x .|. y .&. y
6666
6767 test17 :: Number
examples/passing/OptimizerBug.purs+1−1
@@ -5,5 +5,5 @@ import Prelude
55x a = 1 + y a
66
77y a = x a
8−
8+
99main = Debug.Trace.trace "Done"
examples/passing/Patterns.purs+3−3
@@ -2,7 +2,7 @@ module Main where
22
33 import Prelude
44
5− test = \x -> case x of
5+ test = \x -> case x of
66 { str = "Foo", bool = true } -> true
77 { str = "Bar", bool = b } -> b
88 _ -> false
@@ -17,12 +17,12 @@ module Main where
1717 _ -> 0
1818
1919
20− h = \o -> case o of
20+ h = \o -> case o of
2121 a@[_,_,_] -> a
2222 _ -> []
2323
2424 isDesc :: [Number] -> Boolean
2525 isDesc [x, y] | x > y = true
2626 isDesc _ = false
27−
27+
2828 main = Debug.Trace.trace "Done"
examples/passing/Person.purs+3−3
@@ -4,15 +4,15 @@ module Main where
44
55 data Person = Person { name :: String, age :: Number }
66
7− foreign import itoa
7+ foreign import itoa
88 """
99 function itoa(n) {
1010 return n.toString();
1111 }
1212 """ :: Number -> String
13−
13+
1414 showPerson :: Person -> String
1515 showPerson = \p -> case p of
1616 Person o -> o.name ++ ", aged " ++ itoa(o.age)
17−
17+
1818 main = Debug.Trace.trace "Done"
examples/passing/Rank2Data.purs+1−1
@@ -25,5 +25,5 @@ module Main where
2525 two = succ zero
2626 four = add two two
2727 fourNumber = runNat four
28−
28+
2929 main = Debug.Trace.trace "Done"
examples/passing/Rank2TypeSynonym.purs+2−2
@@ -3,10 +3,10 @@ module Main where
33import Control.Monad.Eff
44
55type Foo a = forall f. (Monad f) => f a
6−
6+
77foo :: forall a. a -> Foo a
88foo x = pure x
9−
9+
1010bar :: Foo Number
1111bar = foo 3
1212
examples/passing/Rank2Types.purs+1−1
@@ -7,5 +7,5 @@ module Main where
77
88 forever :: forall m a b. (forall a b. m a -> (a -> m b) -> m b) -> m a -> m b
99 forever = \bind action -> bind action $ \_ -> forever bind action
10−
10+
1111 main = Debug.Trace.trace "Done"
examples/passing/Recursion.purs+1−1
@@ -6,5 +6,5 @@ module Main where
66 0 -> 1
77 1 -> 1
88 n -> fib (n - 1) + fib (n - 2)
9−
9+
1010 main = Debug.Trace.trace "Done"
examples/passing/Sequence.purs+2−2
@@ -4,9 +4,9 @@ import Control.Monad.Eff
44
55class Sequence t where
66 sequence :: forall m a. (Monad m) => t (m a) -> m (t a)
7−
7+
88instance sequenceArray :: Sequence [] where
99 sequence [] = pure []
10− sequence (x:xs) = (:) <$> x <*> sequence xs
10+ sequence (x:xs) = (:) <$> x <*> sequence xs
1111
1212main = sequence $ [Debug.Trace.trace "Done"]
examples/passing/ShadowedTCOLet.purs+3−3
@@ -1,7 +1,7 @@
11module Main where
22
3−f x y z =
4− let f 1 2 3 = 1
3+f x y z =
4+ let f 1 2 3 = 1
55 in f x z y
6−
6+
77main = Debug.Trace.trace $ show $ f 1 3 2
examples/passing/SignedNumericLiterals.purs+2−2
@@ -6,10 +6,10 @@ module Main where
66 y = -0.5
77 z = 0.5
88 w = 1
9−
9+
1010 f :: Number -> Number
1111 f x = -x
1212
1313 test1 = 2 - 1
14−
14+
1515 main = Debug.Trace.trace "Done"
examples/passing/Superclasses3.purs+1−1
@@ -33,7 +33,7 @@ instance applicativeMTrace :: Applicative MTrace where
3333instance bindMTrace :: Bind MTrace where
3434 (>>=) m f = MTrace (runMTrace m >>= (runMTrace <<< f))
3535
36−instance monadMTrace :: Monad MTrace
36+instance monadMTrace :: Monad MTrace
3737
3838instance writerMTrace :: MonadWriter String MTrace where
3939 tell s = MTrace (trace s)
examples/passing/TailCall.purs+2−2
@@ -9,7 +9,7 @@ test n (x:xs) = test (n + x) xs
99loop :: forall a. Number -> a
1010loop x = loop (x + 1)
1111
12−notATailCall = \x ->
12+notATailCall = \x ->
1313 (\notATailCall -> notATailCall x) (\x -> x)
14−
14+
1515main = Debug.Trace.print (test 0 [1, 2, 3])
examples/passing/TopLevelCase.purs+1−1
@@ -14,5 +14,5 @@ module Main where
1414 data A = A
1515
1616 parseTest A 0 = 0
17−
17+
1818 main = Debug.Trace.trace "Done"
examples/passing/TypeClassImport.purs+3−3
@@ -7,9 +7,9 @@ foreign import data C :: *
77foreign import t "var t = null;" :: T
88
99foreign import inst """
10− var inst = {
11− show: function(t) {
12− return 'Done';
10+ var inst = {
11+ show: function(t) {
12+ return 'Done';
1313 }
1414 }""" :: C
1515
examples/passing/TypeClassMemberOrderChange.purs+1−1
@@ -3,7 +3,7 @@ module Main where
33class Test a where
44 fn :: a -> a -> a
55 val :: a
6−
6+
77instance testBoolean :: Test Boolean where
88 val = true
99 fn x y = y
examples/passing/TypeDecl.purs+1−1
@@ -8,5 +8,5 @@ module Main where
88 iterate :: forall a. Number -> (a -> a) -> a -> a
99 iterate 0 f a = a
1010 iterate n f a = iterate (n - 1) f (f a)
11−
11+
1212 main = Debug.Trace.trace "Done"
examples/passing/TypeSynonyms.purs+2−2
@@ -1,6 +1,6 @@
11module Main where
22
3− type Lens a b =
3+ type Lens a b =
44 { get :: a -> b
55 , set :: a -> b -> a
66 }
@@ -14,7 +14,7 @@ module Main where
1414 type Pair a b = { fst :: a, snd :: b }
1515
1616 fst :: forall a b. Lens (Pair a b) a
17− fst =
17+ fst =
1818 { get: \p -> p.fst
1919 , set: \p a -> { fst: a, snd: p.snd }
2020 }
examples/passing/TypeWildcardsRecordExtension.purs+1−1
@@ -1,5 +1,5 @@
11module Main where
2−
2+
33foo :: forall a. {b :: Number | a} -> {b :: Number | _}
44foo f = f
55
examples/passing/Where.purs+6−6
@@ -7,24 +7,24 @@ import Control.Monad.ST
77test1 x = y
88 where
99 y :: Number
10− y = x + 1
10+ y = x + 1
1111
1212test2 x y = x' + y'
1313 where
1414 x' = x + 1
1515 y' = y + 1
16−
16+
1717
1818test3 = f 1 2 3
1919 where f x y z = x + y + z
20−
20+
2121
2222test4 = f (+) [1, 2]
2323 where f x [y, z] = x y z
24−
24+
2525
2626test5 = g 10
27− where
27+ where
2828 f x | x > 0 = g (x / 2) + 1
2929 f x = 0
3030 g x = f (x - 1) + 1
@@ -35,7 +35,7 @@ test6 = if f true then f 1 else f 2
3535
3636test7 :: Number -> Number
3737test7 x = go x
38− where
38+ where
3939 go y | (x - 0.1 < y * y) && (y * y < x + 0.1) = y
4040 go y = go $ (y + x / y) / 2
4141
examples/passing/s.purs+1−1
@@ -1,5 +1,5 @@
11module Main where
22
33 s = \x y z -> x z (y z)
4−
4+
55 main = Debug.Trace.trace "Done"
psc-docs/Main.hs+4−4
@@ -136,7 +136,7 @@ renderDeclaration n _ (P.ExternDataDeclaration name kind) =
136136renderDeclaration n _ (P.TypeSynonymDeclaration name args ty) = do
137137 let
138138 typeApp = foldl P.TypeApp (P.TypeConstructor (P.Qualified Nothing name)) (map toTypeVar args)
139− typeName = prettyPrintType' typeApp
139+ typeName = prettyPrintType' typeApp
140140 atIndent n $ "type " ++ typeName ++ " = " ++ prettyPrintType' ty
141141renderDeclaration n exps (P.TypeClassDeclaration name args implies ds) = do
142142 let impliesText = case implies of
@@ -161,7 +161,7 @@ renderComments :: Int -> [P.Comment] -> Docs
161161renderComments n cs = mapM_ (atIndent n) ls
162162 where
163163 ls = concatMap toLines cs
164−
164+
165165 toLines (P.LineComment s) = [s]
166166 toLines (P.BlockComment s) = lines s
167167
@@ -217,7 +217,7 @@ inputFile = strArgument $
217217 <> help "The input .purs file(s)"
218218
219219includeHeirarcy :: Parser Bool
220−includeHeirarcy = switch $
220+includeHeirarcy = switch $
221221 long "hierarchy-images"
222222 <> help "Include markdown for type class hierarchy images in the output."
223223
@@ -232,6 +232,6 @@ main = execParser opts >>= docgen
232232 infoModList = fullDesc <> headerInfo <> footerInfo
233233 headerInfo = header "psc-docs - Generate Markdown documentation from PureScript extern files"
234234 footerInfo = footer $ "psc-docs " ++ showVersion Paths.version
235−
235+
236236 version :: Parser (a -> a)
237237 version = abortOption (InfoMsg (showVersion Paths.version)) $ long "version" <> help "Show the version number" <> hidden
psc-make/Main.hs+9−9
@@ -111,12 +111,12 @@ outputDirectory = strOption $
111111 <> help "The output directory"
112112
113113noTco :: Parser Bool
114−noTco = switch $
114+noTco = switch $
115115 long "no-tco"
116116 <> help "Disable tail call optimizations"
117117
118118noPrelude :: Parser Bool
119−noPrelude = switch $
119+noPrelude = switch $
120120 long "no-prelude"
121121 <> help "Omit the Prelude"
122122
@@ -137,15 +137,15 @@ verboseErrors = switch $
137137 <> help "Display verbose error messages"
138138
139139noPrefix :: Parser Bool
140−noPrefix = switch $
140+noPrefix = switch $
141141 short 'p'
142142 <> long "no-prefix"
143143 <> help "Do not include comment header"
144144
145145
146146options :: Parser (P.Options P.Make)
147−options = P.Options <$> noPrelude
148− <*> noTco
147+options = P.Options <$> noPrelude
148+ <*> noTco
149149 <*> noMagicDo
150150 <*> pure Nothing
151151 <*> noOpts
@@ -153,9 +153,9 @@ options = P.Options <$> noPrelude
153153 <*> pure P.MakeOptions
154154
155155pscMakeOptions :: Parser PSCMakeOptions
156−pscMakeOptions = PSCMakeOptions <$> many inputFile
157− <*> outputDirectory
158− <*> options
156+pscMakeOptions = PSCMakeOptions <$> many inputFile
157+ <*> outputDirectory
158+ <*> options
159159 <*> (not <$> noPrefix)
160160
161161main :: IO ()
@@ -165,6 +165,6 @@ main = execParser opts >>= compile
165165 infoModList = fullDesc <> headerInfo <> footerInfo
166166 headerInfo = header "psc-make - Compiles PureScript to Javascript"
167167 footerInfo = footer $ "psc-make " ++ showVersion Paths.version
168−
168+
169169 version :: Parser (a -> a)
170170 version = abortOption (InfoMsg (showVersion Paths.version)) $ long "version" <> help "Show the version number" <> hidden
psc/Main.hs+11−11
@@ -115,25 +115,25 @@ runMain = optional $ noArgs <|> withArgs
115115 where
116116 defaultVal = "Main"
117117 noArgs = flag' defaultVal (long "main")
118− withArgs = strOption $
118+ withArgs = strOption $
119119 long "main"
120120 <> help (concat [
121121 "Generate code to run the main method in the specified module. ",
122122 "(no argument: \"", defaultVal, "\")"
123123 ])
124−
124+
125125noMagicDo :: Parser Bool
126126noMagicDo = switch $
127127 long "no-magic-do"
128128 <> help "Disable the optimization that overloads the do keyword to generate efficient code specifically for the Eff monad."
129−
129+
130130noTco :: Parser Bool
131−noTco = switch $
131+noTco = switch $
132132 long "no-tco"
133133 <> help "Disable tail call optimizations"
134134
135135noPrelude :: Parser Bool
136−noPrelude = switch $
136+noPrelude = switch $
137137 long "no-prelude"
138138 <> help "Omit the Prelude"
139139
@@ -161,22 +161,22 @@ externsFile = optional . strOption $
161161 <> help "The output .e.purs file"
162162
163163noPrefix :: Parser Bool
164−noPrefix = switch $
164+noPrefix = switch $
165165 short 'p'
166166 <> long "no-prefix"
167167 <> help "Do not include comment header"
168168
169169options :: Parser (P.Options P.Compile)
170−options = P.Options <$> noPrelude
171− <*> noTco
170+options = P.Options <$> noPrelude
171+ <*> noTco
172172 <*> noMagicDo
173173 <*> runMain
174174 <*> noOpts
175175 <*> verboseErrors
176176 <*> additionalOptions
177177 where
178− additionalOptions =
179− P.CompileOptions <$> browserNamespace
178+ additionalOptions =
179+ P.CompileOptions <$> browserNamespace
180180 <*> many dceModule
181181 <*> many codeGenModule
182182
@@ -195,7 +195,7 @@ main = execParser opts >>= compile
195195 infoModList = fullDesc <> headerInfo <> footerInfo
196196 headerInfo = header "psc - Compiles PureScript to Javascript"
197197 footerInfo = footer $ "psc " ++ showVersion Paths.version
198−
198+
199199 version :: Parser (a -> a)
200200 version = abortOption (InfoMsg (showVersion Paths.version)) $ long "version" <> help "Show the version number" <> hidden
201201
psci/Parser.hs+4−4
@@ -34,8 +34,8 @@ import qualified Language.PureScript.Parser.Common as C (mark, same)
3434-- Parses PSCI metacommands or expressions input from the user.
3535--
3636parseCommand :: String -> Either String Command
37−parseCommand cmdString =
38− case splitCommand cmdString of
37+parseCommand cmdString =
38+ case splitCommand cmdString of
3939 Just ('?', _) -> return Help
4040 Just ('q', _) -> return Quit
4141 Just ('r', _) -> return Reset
@@ -52,7 +52,7 @@ parseCommand cmdString =
5252 parseRest p s = either (Left . show) Right $ do
5353 ts <- P.lex "" s
5454 P.runTokenParser "" (p <* eof) ts
55−
55+
5656 trimEnd :: String -> String
5757 trimEnd = reverse . dropWhile isSpace . reverse
5858
@@ -68,7 +68,7 @@ parseCommand cmdString =
6868 --
6969 psciExpression :: P.TokenParser Command
7070 psciExpression = Expression <$> P.parseValue
71−
71+
7272 -- |
7373 -- PSCI version of @let@.
7474 -- This is essentially let from do-notation.
purescript.cabal+1−1
@@ -150,7 +150,7 @@ executable psci
150150 ghc-options: -Wall -fno-warn-warnings-deprecations -O2
151151
152152executable psc-docs
153− build-depends: base >=4 && <5, purescript -any,
153+ build-depends: base >=4 && <5, purescript -any,
154154 optparse-applicative >= 0.10.0, process -any, mtl -any
155155 main-is: Main.hs
156156 buildable: True
src/Language/PureScript/AST/SourcePos.hs+2−2
@@ -48,6 +48,6 @@ data SourceSpan = SourceSpan
4848 --
4949 , spanEnd :: SourcePos
5050 } deriving (D.Data, D.Typeable)
51−
51+
5252instance Show SourceSpan where
53− show sp = spanName sp ++ " " ++ show (spanStart sp) ++ " - " ++ show (spanEnd sp)
53+ show sp = spanName sp ++ " " ++ show (spanStart sp) ++ " - " ++ show (spanEnd sp)
src/Language/PureScript/CodeGen/Externs.hs+1−1
@@ -49,7 +49,7 @@ moduleToPs (Module moduleName ds (Just exts)) env = intercalate "\n" . execWrite
4949 tell [ unwords [ show assoc, show prec, ident ] ]
5050 declToPs (PositionedDeclaration _ com d) = mapM commentToPs com >> declToPs d
5151 declToPs _ = return ()
52−
52+
5353 commentToPs :: Comment -> Writer [String] ()
5454 commentToPs (LineComment s) = tell ["-- " ++ s]
5555 commentToPs (BlockComment s) = tell ["{- " ++ s ++ " -}"]
src/Language/PureScript/CodeGen/JS.hs+2−2
@@ -81,7 +81,7 @@ bindToJs mp (NonRec ident val) = return <$> nonRecToJS mp ident val
8181bindToJs mp (Rec vals) = forM vals (uncurry (nonRecToJS mp))
8282
8383-- |
84−-- Generate code in the simplified Javascript intermediate representation for a single non-recursive
84+-- Generate code in the simplified Javascript intermediate representation for a single non-recursive
8585-- declaration.
8686--
8787-- The main purpose of this function is to handle code generation for comments.
@@ -92,7 +92,7 @@ nonRecToJS m i e@(extractAnn -> (_, com, _, _)) | not (null com) =
9292nonRecToJS mp ident val = do
9393 js <- valueToJs mp val
9494 return $ JSVariableIntroduction (identToJs ident) (Just js)
95−
95+
9696
9797-- |
9898-- Generate code in the simplified Javascript intermediate representation for a variable based on a
src/Language/PureScript/Comments.hs+2−2
@@ -18,8 +18,8 @@
1818module Language.PureScript.Comments where
1919
2020import qualified Data.Data as D
21−
21+
2222data Comment
2323 = LineComment String
2424 | BlockComment String
25− deriving (Show, Eq, Ord, D.Data, D.Typeable)
25+ deriving (Show, Eq, Ord, D.Data, D.Typeable)
src/Language/PureScript/CoreFn/Ann.hs+1−1
@@ -34,4 +34,4 @@ nullAnn = (Nothing, [], Nothing, Nothing)
3434-- Remove the comments from an annotation
3535--
3636removeComments :: Ann -> Ann
37−removeComments (ss, _, ty, meta) = (ss, [], ty, meta)
37+removeComments (ss, _, ty, meta) = (ss, [], ty, meta)
src/Language/PureScript/Parser.hs+1−1
@@ -32,4 +32,4 @@ import Language.PureScript.Parser.Types as P
3232import Language.PureScript.Parser.State as P
3333import Language.PureScript.Parser.Kinds as P
3434import Language.PureScript.Parser.Lexer as P
35−import Language.PureScript.Parser.Declarations as P
35+import Language.PureScript.Parser.Declarations as P
src/Language/PureScript/Parser/Lexer.hs+30−30
@@ -15,7 +15,7 @@
1515
1616{-# LANGUAGE TupleSections #-}
1717
18−module Language.PureScript.Parser.Lexer
18+module Language.PureScript.Parser.Lexer
1919 ( PositionedToken(..)
2020 , Token()
2121 , TokenParser()
@@ -34,8 +34,8 @@ module Language.PureScript.Parser.Lexer
3434 , squares
3535 , indent
3636 , indentAt
37− , larrow
38− , rarrow
37+ , larrow
38+ , rarrow
3939 , lfatArrow
4040 , rfatArrow
4141 , colon
@@ -83,7 +83,7 @@ import Language.PureScript.Comments
8383
8484import qualified Text.Parsec as P
8585import qualified Text.Parsec.Token as PT
86−
86+
8787data Token
8888 = LParen
8989 | RParen
@@ -112,7 +112,7 @@ data Token
112112 | StringLiteral String
113113 | Number (Either Integer Double)
114114 deriving (Show, Eq, Ord)
115−
115+
116116prettyPrintToken :: Token -> String
117117prettyPrintToken LParen = "("
118118prettyPrintToken RParen = ")"
@@ -146,19 +146,19 @@ data PositionedToken = PositionedToken
146146 , ptToken :: Token
147147 , ptComments :: [Comment]
148148 } deriving (Eq)
149−
149+
150150instance Show PositionedToken where
151151 show = show . ptToken
152152
153153lex :: FilePath -> String -> Either P.ParseError [PositionedToken]
154154lex filePath input = P.parse parseTokens filePath input
155−
155+
156156parseTokens :: P.Parsec String u [PositionedToken]
157157parseTokens = whitespace *> P.many parsePositionedToken <* P.skipMany parseComment <* P.eof
158158
159159whitespace :: P.Parsec String u ()
160160whitespace = P.skipMany (P.satisfy isSpace)
161−
161+
162162parseComment :: P.Parsec String u Comment
163163parseComment = (BlockComment <$> blockComment <|> LineComment <$> lineComment) <* whitespace
164164 where
@@ -177,11 +177,11 @@ parsePositionedToken = P.try $ do
177177
178178parseToken :: P.Parsec String u Token
179179parseToken = P.choice
180− [ P.try $ P.string "<-" *> P.notFollowedBy symbolChar *> pure LArrow
180+ [ P.try $ P.string "<-" *> P.notFollowedBy symbolChar *> pure LArrow
181181 , P.try $ P.string "<=" *> P.notFollowedBy symbolChar *> pure LFatArrow
182− , P.try $ P.string "->" *> P.notFollowedBy symbolChar *> pure RArrow
183− , P.try $ P.string "=>" *> P.notFollowedBy symbolChar *> pure RFatArrow
184− , P.try $ P.string "::" *> P.notFollowedBy symbolChar *> pure DoubleColon
182+ , P.try $ P.string "->" *> P.notFollowedBy symbolChar *> pure RArrow
183+ , P.try $ P.string "=>" *> P.notFollowedBy symbolChar *> pure RFatArrow
184+ , P.try $ P.string "::" *> P.notFollowedBy symbolChar *> pure DoubleColon
185185 , P.try $ P.char '(' *> pure LParen
186186 , P.try $ P.char ')' *> pure RParen
187187 , P.try $ P.char '{' *> pure LBrace
@@ -196,10 +196,10 @@ parseToken = P.choice
196196 , P.try $ P.char '.' *> P.notFollowedBy symbolChar *> pure Dot
197197 , P.try $ P.char ';' *> P.notFollowedBy symbolChar *> pure Semi
198198 , P.try $ P.char '@' *> P.notFollowedBy symbolChar *> pure At
199− , LName <$> parseLName
199+ , LName <$> parseLName
200200 , do uName <- parseUName
201201 (guard (validModuleName uName) >> Qualifier uName <$ P.char '.') <|> pure (UName uName)
202− , Symbol <$> parseSymbol
202+ , Symbol <$> parseSymbol
203203 , StringLiteral <$> parseStringLiteral
204204 , Number <$> parseNumber
205205 ] <* whitespace
@@ -207,16 +207,16 @@ parseToken = P.choice
207207 where
208208 parseLName :: P.Parsec String u String
209209 parseLName = (:) <$> identStart <*> P.many identLetter
210−
210+
211211 parseUName :: P.Parsec String u String
212212 parseUName = (:) <$> P.upper <*> P.many uidentLetter
213−
213+
214214 parseSymbol :: P.Parsec String u String
215215 parseSymbol = P.many1 symbolChar
216−
216+
217217 identStart :: P.Parsec String u Char
218218 identStart = P.lower <|> P.oneOf "_"
219−
219+
220220 identLetter :: P.Parsec String u Char
221221 identLetter = P.alphaNum <|> P.oneOf "_'"
222222
@@ -225,13 +225,13 @@ parseToken = P.choice
225225
226226 symbolChar :: P.Parsec String u Char
227227 symbolChar = P.oneOf opChars
228−
228+
229229 parseStringLiteral :: P.Parsec String u String
230230 parseStringLiteral = blockString <|> PT.stringLiteral tokenParser
231− where
231+ where
232232 delimeter = P.try (P.string "\"\"\"")
233233 blockString = delimeter >> P.manyTill P.anyChar delimeter
234−
234+
235235 parseNumber :: P.Parsec String u (Either Integer Double)
236236 parseNumber = (Right <$> P.try (PT.float tokenParser) <|>
237237 Left <$> P.try (PT.natural tokenParser)) P.<?> "number"
@@ -261,10 +261,10 @@ tokenParser :: PT.GenTokenParser String u Identity
261261tokenParser = PT.makeTokenParser langDef
262262
263263type TokenParser a = P.Parsec [PositionedToken] ParseState a
264−
264+
265265anyToken :: TokenParser PositionedToken
266266anyToken = P.token (prettyPrintToken . ptToken) ptSourcePos Just
267−
267+
268268token :: (Token -> Maybe a) -> TokenParser a
269269token f = P.token (prettyPrintToken . ptToken) ptSourcePos (f . ptToken)
270270
@@ -347,7 +347,7 @@ semi :: TokenParser ()
347347semi = match Semi
348348
349349at :: TokenParser ()
350−at = match At
350+at = match At
351351
352352-- |
353353-- Parse zero or more values separated by semicolons
@@ -408,7 +408,7 @@ uname' s = token go P.<?> show s
408408 where
409409 go (UName s') | s == s' = Just ()
410410 go _ = Nothing
411−
411+
412412symbol :: TokenParser String
413413symbol = token go P.<?> "symbol"
414414 where
@@ -424,7 +424,7 @@ symbol' s = token go P.<?> show s
424424 go Colon | s == ":" = Just ()
425425 go LFatArrow | s == "<=" = Just ()
426426 go _ = Nothing
427−
427+
428428stringLiteral :: TokenParser String
429429stringLiteral = token go P.<?> "string literal"
430430 where
@@ -448,10 +448,10 @@ identifier = token go P.<?> "identifier"
448448 where
449449 go (LName s) | s `notElem` reservedPsNames = Just s
450450 go _ = Nothing
451−
451+
452452validModuleName :: String -> Bool
453453validModuleName s = not ('_' `elem` s)
454−
454+
455455-- |
456456-- A list of purescript reserved identifiers
457457--
@@ -479,7 +479,7 @@ reservedPsNames = [ "data"
479479 , "in"
480480 , "where"
481481 ]
482−
482+
483483reservedTypeNames :: [String]
484484reservedTypeNames = [ "forall", "where" ]
485485
@@ -488,4 +488,4 @@ reservedTypeNames = [ "forall", "where" ]
488488--
489489opChars :: [Char]
490490opChars = ":!#$%&*+./<=>?@\\^|-~"
491−
491+
src/Language/PureScript/Pretty/JS.hs+4−4
@@ -135,16 +135,16 @@ literals = mkPattern' match
135135 commentLines :: Comment -> [String]
136136 commentLines (LineComment s) = [s]
137137 commentLines (BlockComment s) = lines s
138−
139− asLine :: String -> StateT PrinterState Maybe String
138+
139+ asLine :: String -> StateT PrinterState Maybe String
140140 asLine s = do
141141 i <- currentIndent
142142 return $ i ++ " * " ++ removeComments s ++ "\n"
143−
143+
144144 removeComments :: String -> String
145145 removeComments ('*' : '/' : s) = removeComments s
146146 removeComments (c : s) = c : removeComments s
147−
147+
148148 removeComments [] = []
149149 match (JSRaw js) = return js
150150 match _ = mzero
src/Language/PureScript/Pretty/Types.hs+1−1
@@ -34,7 +34,7 @@ import Language.PureScript.Environment
3434typeLiterals :: Pattern () Type String
3535typeLiterals = mkPattern match
3636 where
37− match TypeWildcard = Just "_"
37+ match TypeWildcard = Just "_"
3838 match (TypeVar var) = Just var
3939 match (PrettyPrintObject row) = Just $ "{ " ++ prettyPrintRow row ++ " }"
4040 match (PrettyPrintArray ty) = Just $ "[" ++ prettyPrintType ty ++ "]"
src/Language/PureScript/Sugar/BindingGroups.hs+3−3
@@ -52,12 +52,12 @@ createBindingGroups :: ModuleName -> [Declaration] -> Either ErrorStack [Declara
5252createBindingGroups moduleName = mapM f <=< handleDecls
5353
5454 where
55− (f, _, _) = everywhereOnValuesTopDownM return handleExprs return
56−
55+ (f, _, _) = everywhereOnValuesTopDownM return handleExprs return
56+
5757 handleExprs :: Expr -> Either ErrorStack Expr
5858 handleExprs (Let ds val) = flip Let val <$> handleDecls ds
5959 handleExprs other = return other
60−
60+
6161 -- |
6262 -- Replace all sets of mutually-recursive declarations with binding groups
6363 --
src/Language/PureScript/TypeChecker/Unify.hs+1−1
@@ -158,7 +158,7 @@ replaceVarWithUnknown :: String -> Type -> UnifyT Type Check Type
158158replaceVarWithUnknown ident ty = do
159159 tu <- fresh
160160 return $ replaceTypeVars ident tu ty
161−
161+
162162-- |
163163-- Replace type wildcards with unknowns
164164--
tests/Main.hs+2−2
@@ -35,7 +35,7 @@ readInput inputFiles = forM inputFiles $ \inputFile -> do
3535 return (inputFile, text)
3636
3737loadPrelude :: Either String (String, String, P.Environment)
38−loadPrelude =
38+loadPrelude =
3939 case P.parseModulesFromFiles id [("", P.prelude)] of
4040 Left parseError -> Left (show parseError)
4141 Right ms -> P.compile (P.defaultCompileOptions { P.optionsAdditional = P.CompileOptions "Tests" [] [] }) (map snd ms) []
@@ -85,7 +85,7 @@ findNodeProcess = runMaybeT . msum $ map (MaybeT . findExecutable) names
8585
8686main :: IO ()
8787main = do
88− putStrLn "Compiling Prelude"
88+ putStrLn "Compiling Prelude"
8989 case loadPrelude of
9090 Left err -> putStrLn err >> exitFailure
9191 Right (preludeJs, exts, _) -> do