Skip to content

Commit e4975e4

Browse files
committed
Merge remote-tracking branch 'upstream/master'
2 parents c676a7e + 377bdbd commit e4975e4

File tree

27 files changed

+261
-140
lines changed

27 files changed

+261
-140
lines changed

.github/workflows/ci.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -54,10 +54,10 @@ jobs:
5454
fail-fast: false # do not cancel builds for other OSes if one fails
5555
matrix:
5656
include:
57-
- image: haskell:9.6.6 # Also upgrade version in the lint job below
57+
- image: haskell:9.8.4 # Also upgrade version in the lint job below
5858
os: ubuntu-latest # Exact version is not important, as it's only the container host)
5959

60-
- image: haskell:9.6.6
60+
- image: haskell:9.8.4
6161
os: ubuntu-24.04-arm # Exact version is not important, as it's only the container host
6262

6363
- os: macos-13 # x64
@@ -92,7 +92,7 @@ jobs:
9292
if: startsWith(matrix.os, 'macos') || startsWith(matrix.os, 'windows')
9393
uses: "haskell-actions/setup@v2"
9494
with:
95-
ghc-version: "9.6.6"
95+
ghc-version: "9.8.4"
9696
enable-stack: true
9797
stack-version: "${{ env.STACK_VERSION }}"
9898
stack-no-global: true
@@ -202,7 +202,7 @@ jobs:
202202
run: "gh release upload --clobber ${{ github.ref_name }} sdist-test/bundle/*.{tar.gz,sha}"
203203

204204
lint:
205-
container: haskell:9.6.6
205+
container: haskell:9.8.4
206206
runs-on: ubuntu-latest # Exact version is not important, as it's only the container host
207207

208208
steps:
@@ -220,7 +220,7 @@ jobs:
220220

221221
- run: "ci/fix-home ci/run-hlint.sh --git"
222222
env:
223-
VERSION: "3.5"
223+
VERSION: "3.10"
224224

225225
- name: Install weeder
226226
run: |
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
* Upgrade GHC to [`9.8.4`](https://downloads.haskell.org/~ghc/9.8.4/docs/users_guide/9.8.4-notes.html), Stackage LTS `23.18`
2+
* Use [HLint 3.10](https://github.com/ndmitchell/hlint/blob/master/CHANGES.txt) in CI

INSTALL.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@ If you are having difficulty installing the PureScript compiler, feel free to as
44

55
## Requirements
66

7-
The PureScript compiler is built using GHC 9.6.6, and should be able to run on any operating system supported by GHC 9.6.6.
7+
The PureScript compiler is built using GHC 9.8.4, and should be able to run on any operating system supported by GHC 9.8.4.
88
In particular:
99

1010
* for Windows users, versions predating Vista are not officially supported,
1111
* for macOS / OS X users, versions predating Mac OS X 10.7 (Lion) are not officially supported.
1212

13-
See also <https://www.haskell.org/ghc/download_ghc_9_6_6.html> for more details about the operating systems which GHC 9.6.6 supports.
13+
See also <https://www.haskell.org/ghc/download_ghc_9_8_4.html> for more details about the operating systems which GHC 9.8.4 supports.
1414

1515
## Official prebuilt binaries
1616

cabal.project

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@ packages:
44
source-repository-package
55
type: git
66
location: https://github.com/purescript/cheapskate.git
7-
tag: 8bfaf4beeb108e97a274ed51303f278905979e87
7+
tag: 633c69024e061ad956f1aecfc137fb99a7a7a20b

purescript.cabal

Lines changed: 53 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,7 @@ common defaults
9292
-Wno-missing-export-lists
9393
-Wno-missing-kind-signatures
9494
-Wno-partial-fields
95+
-Wno-missing-role-annotations
9596
default-language: Haskell2010
9697
default-extensions:
9798
BangPatterns
@@ -124,8 +125,6 @@ common defaults
124125
TupleSections
125126
TypeFamilies
126127
ViewPatterns
127-
build-tool-depends:
128-
happy:happy ==1.20.1.1
129128
build-depends:
130129
-- NOTE: Please do not edit these version constraints manually. They are
131130
-- deliberately made narrow because changing the dependency versions in
@@ -159,65 +158,63 @@ common defaults
159158
-- modules must be parseable by this library otherwise the compiler
160159
-- will reject them. It should therefore always be pinned to a single
161160
-- specific version.
162-
aeson >=2.0.3.0 && <2.2,
161+
aeson >=2.2.3.0 && <2.3,
163162
aeson-better-errors >=0.9.1.3 && <0.10,
164-
ansi-terminal >=0.11.3 && <1.1,
165-
array >=0.5.4.0 && <0.6,
166-
intern,
167-
base >=4.16.2.0 && <4.19,
168-
blaze-html >=0.9.1.2 && <0.10,
163+
ansi-terminal >=1.1.2 && <1.2,
164+
array >=0.5.8.0 && <0.6,
165+
base >=4.19.2.0 && <4.20,
166+
blaze-html >=0.9.2.0 && <0.10,
169167
bower-json >=1.1.0.0 && <1.2,
170168
boxes >=0.1.5 && <0.2,
171-
bytestring >=0.11.3.1 && <0.12,
169+
bytestring >=0.12.1.0 && <0.13,
172170
Cabal >=3.10.3.0 && <3.11,
173-
cborg >=0.2.7.0 && <0.3,
171+
cborg >=0.2.10.0 && <0.3,
174172
cheapskate >=0.1.1.2 && <0.2,
175-
clock >=0.8.3 && <0.9,
176-
containers >=0.6.5.1 && <0.7,
177-
-- unordered-containers,
178-
-- hashable,
179-
cryptonite ==0.30.*,
173+
clock >=0.8.4 && <0.9,
174+
containers >=0.6.8 && <0.7,
175+
cryptonite >=0.30 && <0.31,
180176
data-ordlist >=0.4.7.0 && <0.5,
181-
deepseq >=1.4.6.1 && <1.5,
182-
directory >=1.3.6.2 && <1.4,
183-
dlist ==1.0.*,
177+
deepseq >=1.5.1.0 && <1.6,
178+
directory >=1.3.8.5 && <1.4,
179+
dlist >=1.0 && <1.1,
184180
edit-distance >=0.2.2.1 && <0.3,
185-
file-embed >=0.0.15.0 && <0.1,
186-
filepath >=1.4.2.2 && <1.5,
181+
file-embed >=0.0.16.0 && <0.1,
182+
filepath >=1.4.301.0 && <1.5,
187183
Glob >=0.10.2 && <0.11,
188184
haskeline ==0.8.2,
185+
intern >=0.9.2 && <0.10,
189186
language-javascript ==0.7.0.0,
190-
lens >=5.1.1 && <5.3,
191-
lifted-async >=0.10.2.2 && <0.11,
187+
lens >=5.3.4 && <5.4,
188+
lifted-async >=0.10.2.7 && <0.11,
192189
lifted-base >=0.2.3.12 && <0.3,
193-
memory >=0.17.0 && <0.19,
190+
memory >=0.18.0 && <0.19,
194191
monad-control >=1.0.3.1 && <1.1,
195-
monad-logger >=0.3.36 && <0.4,
196-
monoidal-containers >=0.6.2.0 && <0.7,
197-
mtl >=2.2.2 && <2.4,
192+
monad-logger >=0.3.42 && <0.4,
193+
monoidal-containers >=0.6.6.0 && <0.7,
194+
mtl >=2.3.1 && <2.4,
198195
parallel >=3.2.2.0 && <3.3,
199-
parsec >=3.1.15.0 && <3.2,
200-
process >=1.6.19.0 && <1.7,
201-
protolude >=0.3.1 && <0.4,
202-
regex-tdfa >=1.3.1.2 && <1.4,
203-
safe >=0.3.19 && <0.4,
204-
scientific >=0.3.7.0 && <0.4,
205-
semialign >=1.2.0.1 && <1.4,
206-
semigroups ==0.20.*,
207-
serialise >=0.2.5.0 && <0.3,
196+
parsec >=3.1.17.0 && <3.2,
197+
process >=1.6.25.0 && <1.7,
198+
protolude >=0.3.4 && <0.4,
199+
regex-tdfa >=1.3.2.3 && <1.4,
200+
safe >=0.3.21 && <0.4,
201+
scientific >=0.3.8.0 && <0.4,
202+
semialign >=1.3.1 && <1.4,
203+
semigroups >=0.20 && <0.21,
204+
serialise >=0.2.6.1 && <0.3,
208205
sourcemap >=0.1.7 && <0.2,
209-
sqlite-simple,
210-
stm >=2.5.0.2 && <2.6,
206+
sqlite-simple >= 0.4.18 && <0.5,
207+
stm >=2.5.3.1 && <2.6,
211208
stringsearch >=0.3.6.6 && <0.4,
212-
template-haskell >=2.18.0.0 && <2.21,
213-
text >=1.2.5.0 && <2.1,
214-
these >=1.1.1.1 && <1.3,
215-
time >=1.11.1.1 && <1.13,
216-
transformers >=0.5.6.2 && <0.7,
209+
template-haskell >=2.21.0.0 && <2.22,
210+
text >=2.1.1 && <2.2,
211+
these >=1.2.1 && <1.3,
212+
time >=1.12.2 && <1.13,
213+
transformers >=0.6.1.0 && <0.7,
217214
transformers-base >=0.4.6 && <0.5,
218215
utf8-string >=1.0.2 && <1.1,
219-
vector >=0.12.3.1 && <0.14,
220-
witherable >=0.4.2 && <0.5,
216+
vector >=0.13.2.0 && <0.14,
217+
witherable >=0.5 && <0.6,
221218

222219
library
223220
import: defaults
@@ -418,17 +415,17 @@ executable purs
418415
main-is: Main.hs
419416
ghc-options: -fno-warn-unused-do-bind -threaded -rtsopts -with-rtsopts=-N -Wno-unused-packages
420417
build-depends:
421-
prettyprinter >=1.6 && <1.8,
422-
prettyprinter-ansi-terminal >=1.1.1 && <1.2,
423-
exceptions >=0.10.4 && <0.11,
424-
network >=3.1.2.7 && <3.2,
425-
optparse-applicative >=0.17.0.0 && <0.19,
418+
prettyprinter >=1.7.1 && <1.8,
419+
prettyprinter-ansi-terminal >=1.1.3 && <1.2,
420+
exceptions >=0.10.7 && <0.11,
421+
network >=3.2.7.0 && <3.3,
422+
optparse-applicative >=0.18.1.0 && <0.19,
426423
purescript
427424
if flag(release)
428425
cpp-options: -DRELEASE
429426
else
430427
build-depends:
431-
gitrev >=1.2.0 && <1.4
428+
gitrev >=1.3.1 && <1.4,
432429
other-modules:
433430
Command.Bundle
434431
Command.Compile
@@ -457,13 +454,13 @@ test-suite tests
457454
build-depends:
458455
purescript,
459456
generic-random >=1.5.0.1 && <1.6,
460-
hspec >= 2.11.10 && < 3,
457+
hspec >=2.11.12 && <2.12,
461458
HUnit >=1.6.2.0 && <1.7,
462459
newtype >=0.2.2.0 && <0.3,
463-
QuickCheck >=2.14.2 && <2.15,
464-
regex-base >=0.94.0.2 && <0.95,
465-
split >=0.2.3.4 && <0.3,
466-
typed-process >=0.2.10.1 && <0.3
460+
QuickCheck >=2.14.3 && <2.15,
461+
regex-base >=0.94.0.3 && <0.95,
462+
split >=0.2.5 && <0.3,
463+
typed-process >=0.2.12.0 && <0.3,
467464
build-tool-depends:
468465
hspec-discover:hspec-discover -any
469466
-- we need the compiler's executable available for the ide tests
@@ -488,6 +485,7 @@ test-suite tests
488485
TestGraph
489486
TestHierarchy
490487
TestIde
488+
TestInteractive
491489
TestMake
492490
TestPrimDocs
493491
TestPsci

src/Language/PureScript/CST/Convert.hs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ module Language.PureScript.CST.Convert
1616
) where
1717

1818
import Prelude hiding (take)
19+
import Protolude (headDef)
1920

2021
import Data.Bifunctor (bimap, first)
2122
import Data.Char (toLower)
@@ -446,7 +447,7 @@ convertDeclaration :: String -> Declaration a -> [AST.Declaration]
446447
convertDeclaration fileName decl = case decl of
447448
DeclData _ (DataHead _ a vars) bd -> do
448449
let
449-
ctrs :: SourceToken -> DataCtor a -> [(SourceToken, DataCtor a)] -> [AST.DataConstructorDeclaration]
450+
ctrs :: SourceToken -> DataCtor b -> [(SourceToken, DataCtor b)] -> [AST.DataConstructorDeclaration]
450451
ctrs st (DataCtor _ name fields) tl
451452
= AST.DataConstructorDeclaration (sourceAnnCommented fileName st (nameTok name)) (nameValue name) (zip ctrFields $ convertType fileName <$> fields)
452453
: (case tl of
@@ -460,7 +461,7 @@ convertDeclaration fileName decl = case decl of
460461
(goTypeVar <$> vars)
461462
(convertType fileName bd)
462463
DeclNewtype _ (DataHead _ a vars) st x ys -> do
463-
let ctrs = [AST.DataConstructorDeclaration (sourceAnnCommented fileName st (snd $ declRange decl)) (nameValue x) [(head ctrFields, convertType fileName ys)]]
464+
let ctrs = [AST.DataConstructorDeclaration (sourceAnnCommented fileName st (snd $ declRange decl)) (nameValue x) [(headDef (internalError "No constructor name") ctrFields, convertType fileName ys)]]
464465
pure $ AST.DataDeclaration ann Env.Newtype (nameValue a) (goTypeVar <$> vars) ctrs
465466
DeclClass _ (ClassHead _ sup name vars fdeps) bd -> do
466467
let

src/Language/PureScript/CST/Monad.hs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -102,9 +102,11 @@ mkParserError stack toks ty =
102102
, errType = ty
103103
}
104104
where
105-
range = case toks of
106-
[] -> SourceRange (SourcePos 0 0) (SourcePos 0 0)
107-
_ -> widen (tokRange . tokAnn $ head toks) (tokRange . tokAnn $ last toks)
105+
range = case NE.nonEmpty toks of
106+
Nothing -> SourceRange (SourcePos 0 0) (SourcePos 0 0)
107+
Just neToks -> widen
108+
(tokRange . tokAnn $ NE.head neToks)
109+
(tokRange . tokAnn $ NE.last neToks)
108110

109111
addFailure :: [SourceToken] -> ParserErrorType -> Parser ()
110112
addFailure toks ty = Parser $ \st _ ksucc ->

src/Language/PureScript/CST/Utils.hs

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
module Language.PureScript.CST.Utils where
22

33
import Prelude
4+
import Protolude (headDef)
45

56
import Control.Monad (unless)
67
import Data.Coerce (coerce)
@@ -86,16 +87,20 @@ unexpectedLabel :: SourceToken -> Label
8687
unexpectedLabel tok = Label tok "<unexpected>"
8788

8889
unexpectedExpr :: Monoid a => [SourceToken] -> Expr a
89-
unexpectedExpr toks = ExprIdent mempty (unexpectedQual (head toks))
90+
unexpectedExpr toks =
91+
ExprIdent mempty (unexpectedQual (headDef placeholder toks))
9092

9193
unexpectedBinder :: Monoid a => [SourceToken] -> Binder a
92-
unexpectedBinder toks = BinderVar mempty (unexpectedName (head toks))
94+
unexpectedBinder toks =
95+
BinderVar mempty (unexpectedName (headDef placeholder toks))
9396

9497
unexpectedRecordUpdate :: Monoid a => [SourceToken] -> RecordUpdate a
95-
unexpectedRecordUpdate toks = RecordUpdateLeaf (unexpectedLabel (head toks)) (head toks) (unexpectedExpr toks)
98+
unexpectedRecordUpdate toks =
99+
RecordUpdateLeaf (unexpectedLabel (headDef placeholder toks)) (headDef placeholder toks) (unexpectedExpr toks)
96100

97101
unexpectedRecordLabeled :: [SourceToken] -> RecordLabeled a
98-
unexpectedRecordLabeled toks = RecordPun (unexpectedName (head toks))
102+
unexpectedRecordLabeled toks =
103+
RecordPun (unexpectedName (headDef placeholder toks))
99104

100105
rangeToks :: TokenRange -> [SourceToken]
101106
rangeToks (a, b) = [a, b]

src/Language/PureScript/CodeGen/JS.hs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ module Language.PureScript.CodeGen.JS
77
) where
88

99
import Prelude
10-
import Protolude (ordNub)
10+
import Protolude (ordNub, headDef)
1111

1212
import Control.Monad (forM, replicateM, void)
1313
import Control.Monad.Except (MonadError, throwError)
@@ -310,7 +310,8 @@ moduleBindToJs mn = bindToJs
310310
let (f, args) = unApp e []
311311
args' <- mapM valueToJs args
312312
case f of
313-
Var (_, _, Just IsNewtype) _ -> return (head args')
313+
Var (_, _, Just IsNewtype) _ ->
314+
return (headDef (internalError "Newtype constructor without constructor name") args')
314315
Var (_, _, Just (IsConstructor _ fields)) name | length args == length fields ->
315316
return $ AST.Unary Nothing AST.New $ AST.App Nothing (qualifiedToJS id name) args'
316317
_ -> flip (foldl (\fn a -> AST.App Nothing fn [a])) args' <$> valueToJs f

src/Language/PureScript/CoreImp/Optimizer/TCO.hs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ import Prelude
55

66
import Control.Applicative (empty)
77
import Control.Monad (guard)
8-
import Control.Monad.State (State, evalState, get, modify)
9-
import Data.Functor (($>), (<&>))
8+
import Control.Monad.State (State, evalState, gets, modify)
9+
import Data.Functor (($>))
1010
import Data.Set qualified as S
1111
import Data.Text (Text, pack)
1212
import Language.PureScript.CoreImp.AST (AST(..), InitializerEffects(..), UnaryOperator(..), everything, everywhereTopDownM)
@@ -23,7 +23,7 @@ tco = flip evalState 0 . everywhereTopDownM convert where
2323
copyVar arg = "$copy_" <> arg
2424

2525
tcoDoneM :: State Int Text
26-
tcoDoneM = get <&> \count -> "$tco_done" <>
26+
tcoDoneM = gets $ \count -> "$tco_done" <>
2727
if count == 0 then "" else pack . show $ count
2828

2929
tcoLoop :: Text

0 commit comments

Comments
 (0)