Skip to content

Commit 3c1ed14

Browse files
committed
Merge master
2 parents 103cbf8 + 09f4c2d commit 3c1ed14

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

63 files changed

+486
-462
lines changed

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ updated.
3030
You can automate this (if you have bash):
3131

3232
- get a copy of [cabal-dependency-licenses][]
33-
- run at the command line: `./license/generate > LICENSE`
33+
- run at the command line: `runhaskell license-generator/generate.hs > LICENSE`
3434

3535
[cabal-dependency-licenses]: https://github.com/jaspervdj/cabal-dependency-licenses
3636

LICENSE

Lines changed: 125 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ PureScript uses the following Haskell library packages. Their license files foll
3131
array
3232
attoparsec
3333
base
34+
base-compat
3435
binary
3536
blaze-builder
3637
bower-json
@@ -50,6 +51,7 @@ PureScript uses the following Haskell library packages. Their license files foll
5051
monad-control
5152
mtl
5253
nats
54+
old-locale
5355
optparse-applicative
5456
parallel
5557
parsec
@@ -64,6 +66,7 @@ PureScript uses the following Haskell library packages. Their license files foll
6466
split
6567
stm
6668
syb
69+
tagged
6770
template-haskell
6871
terminfo
6972
text
@@ -454,6 +457,28 @@ base LICENSE file:
454457

455458
-----------------------------------------------------------------------------
456459

460+
base-compat LICENSE file:
461+
462+
Copyright (c) 2012-2015 Simon Hengel <sol@typeful.net> and Ryan Scott <ryan.gl.scott@ku.edu>
463+
464+
Permission is hereby granted, free of charge, to any person obtaining a copy
465+
of this software and associated documentation files (the "Software"), to deal
466+
in the Software without restriction, including without limitation the rights
467+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
468+
copies of the Software, and to permit persons to whom the Software is
469+
furnished to do so, subject to the following conditions:
470+
471+
The above copyright notice and this permission notice shall be included in
472+
all copies or substantial portions of the Software.
473+
474+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
475+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
476+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
477+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
478+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
479+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
480+
THE SOFTWARE.
481+
457482
binary LICENSE file:
458483

459484
Copyright (c) Lennart Kolmodin
@@ -1136,6 +1161,72 @@ nats LICENSE file:
11361161
ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
11371162
POSSIBILITY OF SUCH DAMAGE.
11381163

1164+
old-locale LICENSE file:
1165+
1166+
This library (libraries/base) is derived from code from two
1167+
sources:
1168+
1169+
* Code from the GHC project which is largely (c) The University of
1170+
Glasgow, and distributable under a BSD-style license (see below),
1171+
1172+
* Code from the Haskell 98 Report which is (c) Simon Peyton Jones
1173+
and freely redistributable (but see the full license for
1174+
restrictions).
1175+
1176+
The full text of these licenses is reproduced below. Both of the
1177+
licenses are BSD-style or compatible.
1178+
1179+
-----------------------------------------------------------------------------
1180+
1181+
The Glasgow Haskell Compiler License
1182+
1183+
Copyright 2004, The University Court of the University of Glasgow.
1184+
All rights reserved.
1185+
1186+
Redistribution and use in source and binary forms, with or without
1187+
modification, are permitted provided that the following conditions are met:
1188+
1189+
- Redistributions of source code must retain the above copyright notice,
1190+
this list of conditions and the following disclaimer.
1191+
1192+
- Redistributions in binary form must reproduce the above copyright notice,
1193+
this list of conditions and the following disclaimer in the documentation
1194+
and/or other materials provided with the distribution.
1195+
1196+
- Neither name of the University nor the names of its contributors may be
1197+
used to endorse or promote products derived from this software without
1198+
specific prior written permission.
1199+
1200+
THIS SOFTWARE IS PROVIDED BY THE UNIVERSITY COURT OF THE UNIVERSITY OF
1201+
GLASGOW AND THE CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
1202+
INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
1203+
FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
1204+
UNIVERSITY COURT OF THE UNIVERSITY OF GLASGOW OR THE CONTRIBUTORS BE LIABLE
1205+
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
1206+
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
1207+
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
1208+
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
1209+
LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
1210+
OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
1211+
DAMAGE.
1212+
1213+
-----------------------------------------------------------------------------
1214+
1215+
Code derived from the document "Report on the Programming Language
1216+
Haskell 98", is distributed under the following license:
1217+
1218+
Copyright (c) 2002 Simon Peyton Jones
1219+
1220+
The authors intend this Report to belong to the entire Haskell
1221+
community, and so we grant permission to copy and distribute it for
1222+
any purpose, provided that it is reproduced in its entirety,
1223+
including this Notice. Modified versions of this Report may also be
1224+
copied and distributed for any purpose, provided that the modified
1225+
version is clearly presented as such, and that it does not claim to
1226+
be a definition of the Haskell 98 Language.
1227+
1228+
-----------------------------------------------------------------------------
1229+
11391230
optparse-applicative LICENSE file:
11401231

11411232
Copyright (c) 2012, Paolo Capriotti
@@ -1648,6 +1739,39 @@ syb LICENSE file:
16481739

16491740
-----------------------------------------------------------------------------
16501741

1742+
tagged LICENSE file:
1743+
1744+
Copyright (c) 2009-2015 Edward Kmett
1745+
All rights reserved.
1746+
1747+
Redistribution and use in source and binary forms, with or without
1748+
modification, are permitted provided that the following conditions are
1749+
met:
1750+
1751+
* Redistributions of source code must retain the above copyright
1752+
notice, this list of conditions and the following disclaimer.
1753+
1754+
* Redistributions in binary form must reproduce the above
1755+
copyright notice, this list of conditions and the following
1756+
disclaimer in the documentation and/or other materials provided
1757+
with the distribution.
1758+
1759+
* Neither the name of Edward Kmett nor the names of other
1760+
contributors may be used to endorse or promote products derived
1761+
from this software without specific prior written permission.
1762+
1763+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
1764+
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
1765+
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
1766+
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
1767+
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
1768+
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
1769+
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
1770+
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
1771+
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
1772+
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
1773+
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
1774+
16511775
template-haskell LICENSE file:
16521776

16531777

@@ -2008,3 +2132,4 @@ void LICENSE file:
20082132
STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
20092133
ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
20102134
POSSIBILITY OF SUCH DAMAGE.
2135+

examples/passing/FieldPuns.purs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
module Main where
2+
3+
import Prelude
4+
import Control.Monad.Eff.Console
5+
6+
greet { greeting, name } = log $ greeting <> ", " <> name <> "."
7+
8+
main = greet { greeting: "Hello", name: "World" }

license-generator/generate

Lines changed: 0 additions & 47 deletions
This file was deleted.

license-generator/generate.hs

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
module Main (main) where
2+
3+
import Control.Monad (forM_)
4+
import Data.Char (isSpace)
5+
import Data.List
6+
import System.Process
7+
import System.IO (hPutStrLn, stderr)
8+
9+
echoHeader :: IO ()
10+
echoHeader =
11+
readFile "license-generator/header.txt" >>= putStr
12+
13+
depsNames :: IO [String]
14+
depsNames = do
15+
i <- readProcess "cabal-dependency-licenses" [] ""
16+
return $ sort $ map (drop 2) $ filter startsWithDash $ lines i
17+
where
18+
startsWithDash ('-' : _) = True
19+
startsWithDash _ = False
20+
21+
depsLicense :: String -> IO ()
22+
depsLicense dep = do
23+
let licenseFile = if dep == "Glob" then "LICENSE.txt" else "LICENSE"
24+
hPutStrLn stderr dep
25+
license <- readProcess "curl" ["--silent", "https://hackage.haskell.org/package/" ++ dep ++ "/src/" ++ licenseFile] ""
26+
putStrLn $ dep ++ " LICENSE file:"
27+
putStrLn ""
28+
putStrLn $ f license
29+
where
30+
f = unlines . map trimEnd . map (" " ++) . lines
31+
trimEnd = reverse . dropWhile isSpace . reverse
32+
33+
main :: IO ()
34+
main = do
35+
deps <-depsNames
36+
echoHeader
37+
putStrLn ""
38+
forM_ deps $ \d -> putStr " " >> putStrLn d
39+
putStrLn ""
40+
forM_ deps depsLicense

license-generator/tmp/.gitkeep

Whitespace-only changes.

psci/Completion.hs

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,14 @@
1-
{-# LANGUAGE CPP #-}
2-
31
module Completion where
42

3+
import Prelude ()
4+
import Prelude.Compat
5+
56
import Data.Maybe (mapMaybe)
67
import Data.List (nub, nubBy, sortBy, isPrefixOf, stripPrefix)
78
import Data.Char (isUpper)
89
import Data.Function (on)
9-
#if __GLASGOW_HASKELL__ < 710
10-
import Data.Traversable (traverse)
11-
#endif
1210

1311
import Control.Arrow (second)
14-
#if __GLASGOW_HASKELL__ < 710
15-
import Control.Applicative ((<$>), (<*>))
16-
#endif
1712
import Control.Monad.Trans.Reader (asks, runReaderT, ReaderT)
1813
import Control.Monad.Trans.State.Strict
1914

psci/PSCi.hs

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -17,15 +17,14 @@
1717
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
1818
{-# LANGUAGE RecordWildCards #-}
1919
{-# LANGUAGE TupleSections #-}
20-
{-# LANGUAGE CPP #-}
2120

2221
module PSCi where
2322

23+
import Prelude ()
24+
import Prelude.Compat
25+
2426
import Data.Foldable (traverse_)
2527
import Data.List (intercalate, nub, sort)
26-
#if __GLASGOW_HASKELL__ < 710
27-
import Data.Traversable (traverse)
28-
#endif
2928
import Data.Tuple (swap)
3029
import Data.Version (showVersion)
3130
import qualified Data.Map as M
@@ -509,7 +508,7 @@ loadUserConfig = onFirstFileMatching readCommands pathGetters
509508
if exists
510509
then do
511510
ls <- lines <$> readFile configFile
512-
case mapM parseCommand ls of
511+
case traverse parseCommand ls of
513512
Left err -> print err >> exitFailure
514513
Right cs -> return $ Just cs
515514
else
@@ -526,8 +525,8 @@ consoleIsDefined = any ((== P.ModuleName (map P.ProperName [ "Control", "Monad",
526525
loop :: PSCiOptions -> IO ()
527526
loop PSCiOptions{..} = do
528527
config <- loadUserConfig
529-
inputFiles <- concat <$> mapM glob psciInputFile
530-
foreignFiles <- concat <$> mapM glob psciForeignInputFiles
528+
inputFiles <- concat <$> traverse glob psciInputFile
529+
foreignFiles <- concat <$> traverse glob psciForeignInputFiles
531530
modulesOrFirstError <- loadAllModules inputFiles
532531
case modulesOrFirstError of
533532
Left errs -> putStrLn (P.prettyPrintMultipleErrors False errs) >> exitFailure
@@ -542,7 +541,7 @@ loop PSCiOptions{..} = do
542541
Right foreigns ->
543542
flip evalStateT (PSCiState inputFiles [] modules foreigns [] psciInputNodeFlags) . runInputT (setComplete completion settings) $ do
544543
outputStrLn prologueMessage
545-
traverse_ (mapM_ (runPSCI . handleCommand)) config
544+
traverse_ (traverse_ (runPSCI . handleCommand)) config
546545
modules' <- lift $ gets psciLoadedModules
547546
unless (consoleIsDefined (map snd modules')) . outputStrLn $ unlines
548547
[ "PSCi requires the purescript-console module to be installed."

psci/Parser.hs

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,21 +13,16 @@
1313
--
1414
-----------------------------------------------------------------------------
1515

16-
{-# LANGUAGE CPP #-}
17-
1816
module Parser
1917
( parseCommand
2018
) where
2119

22-
import Prelude hiding (lex)
20+
import Prelude ()
21+
import Prelude.Compat hiding (lex)
2322

2423
import Data.Char (isSpace)
2524
import Data.List (intercalate)
2625

27-
#if __GLASGOW_HASKELL__ < 710
28-
import Control.Applicative hiding (many)
29-
#endif
30-
3126
import Text.Parsec hiding ((<|>))
3227

3328
import qualified Language.PureScript as P

psci/tests/Main.hs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,13 @@
11
{-# LANGUAGE RecordWildCards #-}
22
{-# LANGUAGE TupleSections #-}
3-
{-# LANGUAGE CPP #-}
43

54
module Main where
65

6+
import Prelude ()
7+
import Prelude.Compat
8+
79
import Control.Monad.Trans.State.Strict (runStateT)
810
import Control.Monad (when, forM)
9-
#if __GLASGOW_HASKELL__ < 710
10-
import Control.Applicative
11-
#endif
1211
import Control.Monad.Writer.Strict (runWriterT)
1312
import Control.Monad.Trans.Except (runExceptT)
1413

0 commit comments

Comments
 (0)