Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,10 @@ jobs:
fail-fast: false # do not cancel builds for other OSes if one fails
matrix:
include:
- image: haskell:9.6.6 # Also upgrade version in the lint job below
- image: haskell:9.8.4 # Also upgrade version in the lint job below
os: ubuntu-latest # Exact version is not important, as it's only the container host)

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

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

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

steps:
Expand All @@ -220,7 +220,7 @@ jobs:

- run: "ci/fix-home ci/run-hlint.sh --git"
env:
VERSION: "3.5"
VERSION: "3.10"

- name: Install weeder
run: |
Expand Down
2 changes: 2 additions & 0 deletions CHANGELOG.d/internal_upgrade_to_ghc_9.8.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
* 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`
* Use [HLint 3.10](https://github.com/ndmitchell/hlint/blob/master/CHANGES.txt) in CI
4 changes: 2 additions & 2 deletions INSTALL.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@ If you are having difficulty installing the PureScript compiler, feel free to as

## Requirements

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.
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.
In particular:

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

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.
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.

## Official prebuilt binaries

Expand Down
2 changes: 1 addition & 1 deletion cabal.project
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ packages:
source-repository-package
type: git
location: https://github.com/purescript/cheapskate.git
tag: 8bfaf4beeb108e97a274ed51303f278905979e87
tag: 633c69024e061ad956f1aecfc137fb99a7a7a20b
108 changes: 53 additions & 55 deletions purescript.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ common defaults
-Wno-missing-export-lists
-Wno-missing-kind-signatures
-Wno-partial-fields
-Wno-missing-role-annotations
default-language: Haskell2010
default-extensions:
BangPatterns
Expand Down Expand Up @@ -124,8 +125,6 @@ common defaults
TupleSections
TypeFamilies
ViewPatterns
build-tool-depends:
happy:happy ==1.20.1.1
build-depends:
-- NOTE: Please do not edit these version constraints manually. They are
-- deliberately made narrow because changing the dependency versions in
Expand Down Expand Up @@ -159,65 +158,63 @@ common defaults
-- modules must be parseable by this library otherwise the compiler
-- will reject them. It should therefore always be pinned to a single
-- specific version.
aeson >=2.0.3.0 && <2.2,
aeson >=2.2.3.0 && <2.3,
aeson-better-errors >=0.9.1.3 && <0.10,
ansi-terminal >=0.11.3 && <1.1,
array >=0.5.4.0 && <0.6,
intern,
base >=4.16.2.0 && <4.19,
blaze-html >=0.9.1.2 && <0.10,
ansi-terminal >=1.1.2 && <1.2,
array >=0.5.8.0 && <0.6,
base >=4.19.2.0 && <4.20,
blaze-html >=0.9.2.0 && <0.10,
bower-json >=1.1.0.0 && <1.2,
boxes >=0.1.5 && <0.2,
bytestring >=0.11.3.1 && <0.12,
bytestring >=0.12.1.0 && <0.13,
Cabal >=3.10.3.0 && <3.11,
cborg >=0.2.7.0 && <0.3,
cborg >=0.2.10.0 && <0.3,
cheapskate >=0.1.1.2 && <0.2,
clock >=0.8.3 && <0.9,
containers >=0.6.5.1 && <0.7,
-- unordered-containers,
-- hashable,
cryptonite ==0.30.*,
clock >=0.8.4 && <0.9,
containers >=0.6.8 && <0.7,
cryptonite >=0.30 && <0.31,
data-ordlist >=0.4.7.0 && <0.5,
deepseq >=1.4.6.1 && <1.5,
directory >=1.3.6.2 && <1.4,
dlist ==1.0.*,
deepseq >=1.5.1.0 && <1.6,
directory >=1.3.8.5 && <1.4,
dlist >=1.0 && <1.1,
edit-distance >=0.2.2.1 && <0.3,
file-embed >=0.0.15.0 && <0.1,
filepath >=1.4.2.2 && <1.5,
file-embed >=0.0.16.0 && <0.1,
filepath >=1.4.301.0 && <1.5,
Glob >=0.10.2 && <0.11,
haskeline ==0.8.2,
intern >=0.9.2 && <0.10,
language-javascript ==0.7.0.0,
lens >=5.1.1 && <5.3,
lifted-async >=0.10.2.2 && <0.11,
lens >=5.3.4 && <5.4,
lifted-async >=0.10.2.7 && <0.11,
lifted-base >=0.2.3.12 && <0.3,
memory >=0.17.0 && <0.19,
memory >=0.18.0 && <0.19,
monad-control >=1.0.3.1 && <1.1,
monad-logger >=0.3.36 && <0.4,
monoidal-containers >=0.6.2.0 && <0.7,
mtl >=2.2.2 && <2.4,
monad-logger >=0.3.42 && <0.4,
monoidal-containers >=0.6.6.0 && <0.7,
mtl >=2.3.1 && <2.4,
parallel >=3.2.2.0 && <3.3,
parsec >=3.1.15.0 && <3.2,
process >=1.6.19.0 && <1.7,
protolude >=0.3.1 && <0.4,
regex-tdfa >=1.3.1.2 && <1.4,
safe >=0.3.19 && <0.4,
scientific >=0.3.7.0 && <0.4,
semialign >=1.2.0.1 && <1.4,
semigroups ==0.20.*,
serialise >=0.2.5.0 && <0.3,
parsec >=3.1.17.0 && <3.2,
process >=1.6.25.0 && <1.7,
protolude >=0.3.4 && <0.4,
regex-tdfa >=1.3.2.3 && <1.4,
safe >=0.3.21 && <0.4,
scientific >=0.3.8.0 && <0.4,
semialign >=1.3.1 && <1.4,
semigroups >=0.20 && <0.21,
serialise >=0.2.6.1 && <0.3,
sourcemap >=0.1.7 && <0.2,
sqlite-simple,
stm >=2.5.0.2 && <2.6,
sqlite-simple >= 0.4.18 && <0.5,
stm >=2.5.3.1 && <2.6,
stringsearch >=0.3.6.6 && <0.4,
template-haskell >=2.18.0.0 && <2.21,
text >=1.2.5.0 && <2.1,
these >=1.1.1.1 && <1.3,
time >=1.11.1.1 && <1.13,
transformers >=0.5.6.2 && <0.7,
template-haskell >=2.21.0.0 && <2.22,
text >=2.1.1 && <2.2,
these >=1.2.1 && <1.3,
time >=1.12.2 && <1.13,
transformers >=0.6.1.0 && <0.7,
transformers-base >=0.4.6 && <0.5,
utf8-string >=1.0.2 && <1.1,
vector >=0.12.3.1 && <0.14,
witherable >=0.4.2 && <0.5,
vector >=0.13.2.0 && <0.14,
witherable >=0.5 && <0.6,

library
import: defaults
Expand Down Expand Up @@ -418,17 +415,17 @@ executable purs
main-is: Main.hs
ghc-options: -fno-warn-unused-do-bind -threaded -rtsopts -with-rtsopts=-N -Wno-unused-packages
build-depends:
prettyprinter >=1.6 && <1.8,
prettyprinter-ansi-terminal >=1.1.1 && <1.2,
exceptions >=0.10.4 && <0.11,
network >=3.1.2.7 && <3.2,
optparse-applicative >=0.17.0.0 && <0.19,
prettyprinter >=1.7.1 && <1.8,
prettyprinter-ansi-terminal >=1.1.3 && <1.2,
exceptions >=0.10.7 && <0.11,
network >=3.2.7.0 && <3.3,
optparse-applicative >=0.18.1.0 && <0.19,
purescript
if flag(release)
cpp-options: -DRELEASE
else
build-depends:
gitrev >=1.2.0 && <1.4
gitrev >=1.3.1 && <1.4,
other-modules:
Command.Bundle
Command.Compile
Expand Down Expand Up @@ -457,13 +454,13 @@ test-suite tests
build-depends:
purescript,
generic-random >=1.5.0.1 && <1.6,
hspec >= 2.11.10 && < 3,
hspec >=2.11.12 && <2.12,
HUnit >=1.6.2.0 && <1.7,
newtype >=0.2.2.0 && <0.3,
QuickCheck >=2.14.2 && <2.15,
regex-base >=0.94.0.2 && <0.95,
split >=0.2.3.4 && <0.3,
typed-process >=0.2.10.1 && <0.3
QuickCheck >=2.14.3 && <2.15,
regex-base >=0.94.0.3 && <0.95,
split >=0.2.5 && <0.3,
typed-process >=0.2.12.0 && <0.3,
build-tool-depends:
hspec-discover:hspec-discover -any
-- we need the compiler's executable available for the ide tests
Expand All @@ -488,6 +485,7 @@ test-suite tests
TestGraph
TestHierarchy
TestIde
TestInteractive
TestMake
TestPrimDocs
TestPsci
Expand Down
5 changes: 3 additions & 2 deletions src/Language/PureScript/CST/Convert.hs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ module Language.PureScript.CST.Convert
) where

import Prelude hiding (take)
import Protolude (headDef)

import Data.Bifunctor (bimap, first)
import Data.Char (toLower)
Expand Down Expand Up @@ -446,7 +447,7 @@ convertDeclaration :: String -> Declaration a -> [AST.Declaration]
convertDeclaration fileName decl = case decl of
DeclData _ (DataHead _ a vars) bd -> do
let
ctrs :: SourceToken -> DataCtor a -> [(SourceToken, DataCtor a)] -> [AST.DataConstructorDeclaration]
ctrs :: SourceToken -> DataCtor b -> [(SourceToken, DataCtor b)] -> [AST.DataConstructorDeclaration]
ctrs st (DataCtor _ name fields) tl
= AST.DataConstructorDeclaration (sourceAnnCommented fileName st (nameTok name)) (nameValue name) (zip ctrFields $ convertType fileName <$> fields)
: (case tl of
Expand All @@ -460,7 +461,7 @@ convertDeclaration fileName decl = case decl of
(goTypeVar <$> vars)
(convertType fileName bd)
DeclNewtype _ (DataHead _ a vars) st x ys -> do
let ctrs = [AST.DataConstructorDeclaration (sourceAnnCommented fileName st (snd $ declRange decl)) (nameValue x) [(head ctrFields, convertType fileName ys)]]
let ctrs = [AST.DataConstructorDeclaration (sourceAnnCommented fileName st (snd $ declRange decl)) (nameValue x) [(headDef (internalError "No constructor name") ctrFields, convertType fileName ys)]]
pure $ AST.DataDeclaration ann Env.Newtype (nameValue a) (goTypeVar <$> vars) ctrs
DeclClass _ (ClassHead _ sup name vars fdeps) bd -> do
let
Expand Down
8 changes: 5 additions & 3 deletions src/Language/PureScript/CST/Monad.hs
Original file line number Diff line number Diff line change
Expand Up @@ -102,9 +102,11 @@ mkParserError stack toks ty =
, errType = ty
}
where
range = case toks of
[] -> SourceRange (SourcePos 0 0) (SourcePos 0 0)
_ -> widen (tokRange . tokAnn $ head toks) (tokRange . tokAnn $ last toks)
range = case NE.nonEmpty toks of
Nothing -> SourceRange (SourcePos 0 0) (SourcePos 0 0)
Just neToks -> widen
(tokRange . tokAnn $ NE.head neToks)
(tokRange . tokAnn $ NE.last neToks)

addFailure :: [SourceToken] -> ParserErrorType -> Parser ()
addFailure toks ty = Parser $ \st _ ksucc ->
Expand Down
13 changes: 9 additions & 4 deletions src/Language/PureScript/CST/Utils.hs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
module Language.PureScript.CST.Utils where

import Prelude
import Protolude (headDef)

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

unexpectedExpr :: Monoid a => [SourceToken] -> Expr a
unexpectedExpr toks = ExprIdent mempty (unexpectedQual (head toks))
unexpectedExpr toks =
ExprIdent mempty (unexpectedQual (headDef placeholder toks))

unexpectedBinder :: Monoid a => [SourceToken] -> Binder a
unexpectedBinder toks = BinderVar mempty (unexpectedName (head toks))
unexpectedBinder toks =
BinderVar mempty (unexpectedName (headDef placeholder toks))

unexpectedRecordUpdate :: Monoid a => [SourceToken] -> RecordUpdate a
unexpectedRecordUpdate toks = RecordUpdateLeaf (unexpectedLabel (head toks)) (head toks) (unexpectedExpr toks)
unexpectedRecordUpdate toks =
RecordUpdateLeaf (unexpectedLabel (headDef placeholder toks)) (headDef placeholder toks) (unexpectedExpr toks)

unexpectedRecordLabeled :: [SourceToken] -> RecordLabeled a
unexpectedRecordLabeled toks = RecordPun (unexpectedName (head toks))
unexpectedRecordLabeled toks =
RecordPun (unexpectedName (headDef placeholder toks))

rangeToks :: TokenRange -> [SourceToken]
rangeToks (a, b) = [a, b]
Expand Down
5 changes: 3 additions & 2 deletions src/Language/PureScript/CodeGen/JS.hs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ module Language.PureScript.CodeGen.JS
) where

import Prelude
import Protolude (ordNub)
import Protolude (ordNub, headDef)

import Control.Monad (forM, replicateM, void)
import Control.Monad.Except (MonadError, throwError)
Expand Down Expand Up @@ -310,7 +310,8 @@ moduleBindToJs mn = bindToJs
let (f, args) = unApp e []
args' <- mapM valueToJs args
case f of
Var (_, _, Just IsNewtype) _ -> return (head args')
Var (_, _, Just IsNewtype) _ ->
return (headDef (internalError "Newtype constructor without constructor name") args')
Var (_, _, Just (IsConstructor _ fields)) name | length args == length fields ->
return $ AST.Unary Nothing AST.New $ AST.App Nothing (qualifiedToJS id name) args'
_ -> flip (foldl (\fn a -> AST.App Nothing fn [a])) args' <$> valueToJs f
Expand Down
6 changes: 3 additions & 3 deletions src/Language/PureScript/CoreImp/Optimizer/TCO.hs
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import Prelude

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

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

tcoLoop :: Text
Expand Down
4 changes: 2 additions & 2 deletions src/Language/PureScript/Docs/AsHtml.hs
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ nullRenderContext = HtmlRenderContext

packageAsHtml
:: (InPackage P.ModuleName -> Maybe HtmlRenderContext)
-> Package a
-> Package x
-> HtmlOutput Html
packageAsHtml getHtmlCtx Package{..} =
HtmlOutput indexFile modules
Expand Down Expand Up @@ -242,7 +242,7 @@ codeAsHtml r = outputWith elemAsHtml

isOp = isRight . runParser CST.parseOperator

runParser :: CST.Parser a -> Text -> Either String a
runParser :: CST.Parser x -> Text -> Either String x
runParser p' =
bimap (CST.prettyPrintError . NE.head) snd
. CST.runTokenParser p'
Expand Down
2 changes: 1 addition & 1 deletion src/Language/PureScript/Docs/Types.hs
Original file line number Diff line number Diff line change
Expand Up @@ -875,7 +875,7 @@ instance A.ToJSON a => A.ToJSON (InPackage a) where
Local y -> withPackage (Nothing :: Maybe ()) y
FromDep pn y -> withPackage (Just pn) y
where
withPackage :: (A.ToJSON p, A.ToJSON x) => p -> x -> A.Value
withPackage :: (A.ToJSON p, A.ToJSON y) => p -> y -> A.Value
withPackage p y =
A.object [ "package" .= p
, "item" .= y
Expand Down
Loading
Loading