Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master' into restaumatic
Browse files Browse the repository at this point in the history
  • Loading branch information
jborkowski committed Sep 3, 2024
2 parents 988c913 + e06b9cc commit 8648583
Show file tree
Hide file tree
Showing 17 changed files with 73 additions and 34 deletions.
26 changes: 5 additions & 21 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ defaults:
env:
CI_PRERELEASE: "${{ github.event_name == 'push' && github.ref == 'refs/heads/master' }}"
CI_RELEASE: "${{ github.event_name == 'release' }}"
STACK_VERSION: "2.9.3"
STACK_VERSION: "2.15.1"

concurrency:
# We never want two prereleases building at the same time, since they would
Expand All @@ -55,8 +55,8 @@ jobs:
include:
- # If upgrading the Haskell image, also upgrade it in the lint job below
os: ["ubuntu-latest"]
image: haskell:9.2.5@sha256:2597b0e2458165a6635906204f7fac43c22e7d2a46aca1235a811194bb6cd419
- os: ["macOS-11"]
image: haskell:9.2.8@sha256:b3b2f3909c7381bb96b8f18766f9407a3d6f61e0f07ea95e812583ac4f442cbb
- os: ["macOS-14"]
- os: ["windows-2019"]

runs-on: "${{ matrix.os }}"
Expand All @@ -67,15 +67,6 @@ jobs:
version: "${{ steps.build.outputs.version }}"

steps:
- # We need a proper Git repository, but the checkout step will unpack a tarball instead of doing a clone
# if the Git version is less than 2.18.
name: "(Linux only) Install a newer version of Git"
if: "contains(matrix.os, 'ubuntu-latest')"
run: |
. /etc/os-release
echo deb http://deb.debian.org/debian "$VERSION_CODENAME"-backports main >> /etc/apt/sources.list
apt-get update && apt-get install -y git/"$VERSION_CODENAME"-backports
- # We need `gh` installed on the Linux version. Otherwise, release artifacts won't be uploaded.
name: "(Linux only) Install gh"
if: "contains(matrix.os, 'ubuntu-latest')"
Expand All @@ -97,7 +88,7 @@ jobs:
# and their Haskell environment is instead provided by a nix-shell
# See https://github.com/purescript/purescript/pulls/4455
if: "!contains(matrix.os, 'ubuntu-latest') && !contains(matrix.os, 'self-hosted')"
uses: "haskell/actions/setup@v1"
uses: "haskell-actions/setup@v2"
with:
enable-stack: true
stack-version: "${{ env.STACK_VERSION }}"
Expand Down Expand Up @@ -233,16 +224,9 @@ jobs:
# means our published binaries will work on the widest number of platforms.
# But the HLint binary downloaded by this job requires a newer glibc
# version.
container: haskell:9.2.5@sha256:2597b0e2458165a6635906204f7fac43c22e7d2a46aca1235a811194bb6cd419
container: haskell:9.2.8@sha256:b3b2f3909c7381bb96b8f18766f9407a3d6f61e0f07ea95e812583ac4f442cbb

steps:
- # We need a proper Git repository, but the checkout step will unpack a tarball instead of doing a clone
# if the Git version is less than 2.18.
name: "Install a newer version of Git"
run: |
. /etc/os-release
echo deb http://deb.debian.org/debian "$VERSION_CODENAME"-backports main >> /etc/apt/sources.list
apt-get update && apt-get install -y git/"$VERSION_CODENAME"-backports
- uses: "actions/checkout@v2"
- name: "Fix working directory ownership"
run: |
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.d/fix_issue-4535.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* Fix compiler crash when a type operator is used in a type argument
1 change: 1 addition & 0 deletions CHANGELOG.d/internal_remove-git-upgrade-step-in-ci.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* Remove the step that upgraded Git from the CI workflow
1 change: 1 addition & 0 deletions CHANGELOG.d/misc_ghc-bump.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* Update Stackage snapshot to lts-20.26 and GHC to 9.2.8
4 changes: 2 additions & 2 deletions INSTALL.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@ If you are having difficulty installing the PureScript compiler, feel free to as

## Requirements

The PureScript compiler is built using GHC 9.2.5, and should be able to run on any operating system supported by GHC 9.2.5. In particular:
The PureScript compiler is built using GHC 9.2.8, and should be able to run on any operating system supported by GHC 9.2.8. 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_2_5.html> for more details about the operating systems which GHC 9.2.5 supports.
See also <https://www.haskell.org/ghc/download_ghc_9_2_8.html> for more details about the operating systems which GHC 9.2.8 supports.

## Official prebuilt binaries

Expand Down
2 changes: 1 addition & 1 deletion app/Command/Docs.hs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import Prelude
import Command.Docs.Html (asHtml, writeHtmlModules)
import Command.Docs.Markdown (asMarkdown, writeMarkdownModules)
import Control.Applicative (Alternative(..), optional)
import Control.Monad.Writer (when)
import Control.Monad (when)
import Control.Monad.Trans.Except (runExceptT)
import Data.Maybe (fromMaybe)
import Data.Text qualified as T
Expand Down
2 changes: 1 addition & 1 deletion app/Command/Docs/Html.hs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import Prelude

import Control.Applicative (Alternative(..))
import Control.Arrow ((&&&))
import Control.Monad.Writer (guard)
import Control.Monad (guard)
import Data.List (sort)
import Data.Text (Text)
import Data.Text.Lazy (toStrict)
Expand Down
2 changes: 1 addition & 1 deletion purescript.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ common defaults
TypeFamilies
ViewPatterns
build-tool-depends:
happy:happy ==1.20.0
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
3 changes: 2 additions & 1 deletion src/Control/Monad/Supply.hs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ import Prelude

import Control.Applicative (Alternative)
import Control.Monad.Error.Class (MonadError(..))
import Control.Monad.Reader (MonadPlus, MonadReader, MonadTrans)
import Control.Monad.Reader (MonadReader, MonadTrans)
import Control.Monad (MonadPlus)
import Control.Monad.State (StateT(..))
import Control.Monad.Writer (MonadWriter)

Expand Down
3 changes: 2 additions & 1 deletion src/Language/PureScript/Errors.hs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ import Control.Lens (both, head1, over)
import Control.Monad (forM, unless)
import Control.Monad.Error.Class (MonadError(..))
import Control.Monad.Trans.State.Lazy (State, evalState, get, put)
import Control.Monad.Writer (Last(..), MonadWriter(..), censor)
import Control.Monad.Writer (MonadWriter(..), censor)
import Data.Monoid (Last(..))
import Data.Bifunctor (first, second)
import Data.Bitraversable (bitraverse)
import Data.Char (isSpace)
Expand Down
3 changes: 2 additions & 1 deletion src/Language/PureScript/Renamer.hs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ module Language.PureScript.Renamer (renameInModule) where

import Prelude

import Control.Monad.State (MonadState(..), State, gets, modify, runState, (>=>))
import Control.Monad.State (MonadState(..), State, gets, modify, runState)
import Control.Monad ((>=>))

import Data.Functor ((<&>))
import Data.List (find)
Expand Down
3 changes: 3 additions & 0 deletions src/Language/PureScript/Sugar/Operators.hs
Original file line number Diff line number Diff line change
Expand Up @@ -409,6 +409,9 @@ updateTypes goType = (goDecl, goExpr, goBinder)
goExpr pos (TypedValue check v ty) = do
ty' <- goType' pos ty
return (pos, TypedValue check v ty')
goExpr pos (VisibleTypeApp v ty) = do
ty' <- goType' pos ty
return (pos, VisibleTypeApp v ty')
goExpr pos other = return (pos, other)

goBinder :: SourceSpan -> Binder -> m (SourceSpan, Binder)
Expand Down
2 changes: 1 addition & 1 deletion src/Language/PureScript/Sugar/Operators/Common.hs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ module Language.PureScript.Sugar.Operators.Common where

import Prelude

import Control.Monad.State (guard, join)
import Control.Monad (guard, join)
import Control.Monad.Except (MonadError(..))

import Data.Either (rights)
Expand Down
6 changes: 4 additions & 2 deletions src/Language/PureScript/TypeChecker/Entailment.hs
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,11 @@ import Protolude (ordNub, headMay)

import Control.Arrow (second, (&&&))
import Control.Monad.Error.Class (MonadError(..))
import Control.Monad.State (MonadState(..), MonadTrans(..), StateT(..), evalStateT, execStateT, foldM, gets, guard, join, modify, zipWithM, zipWithM_, (<=<))
import Control.Monad.State (MonadState(..), MonadTrans(..), StateT(..), evalStateT, execStateT, gets, modify)
import Control.Monad (foldM, guard, join, zipWithM, zipWithM_, (<=<))
import Control.Monad.Supply.Class (MonadSupply(..))
import Control.Monad.Writer (Any(..), MonadWriter(..), WriterT(..))
import Control.Monad.Writer (MonadWriter(..), WriterT(..))
import Data.Monoid (Any(..))

import Data.Either (lefts, partitionEithers)
import Data.Foldable (for_, fold, toList)
Expand Down
3 changes: 2 additions & 1 deletion src/Language/PureScript/TypeChecker/Monad.hs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ import Prelude

import Control.Arrow (second)
import Control.Monad.Error.Class (MonadError(..))
import Control.Monad.State (MonadState(..), StateT(..), forM_, gets, guard, join, modify, when, (<=<))
import Control.Monad.State (MonadState(..), StateT(..), gets, modify)
import Control.Monad (forM_, guard, join, when, (<=<))
import Control.Monad.Writer.Class (MonadWriter(..), censor)

import Data.Maybe (fromMaybe)
Expand Down
2 changes: 1 addition & 1 deletion stack.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Please update Haskell image versions under .github/workflows/ci.yml together to use the same GHC version
# (or the CI build will fail)
resolver: lts-20.9
resolver: lts-20.26
pvp-bounds: both
packages:
- '.'
Expand Down
43 changes: 43 additions & 0 deletions tests/purs/passing/4535.purs
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
module Main where

import Prelude

import Data.Maybe (Maybe(..))
import Data.Tuple.Nested ((/\), type (/\))
import Effect (Effect)
import Effect.Console (log)
import Type.Proxy (Proxy(..))

singleArgument :: forall @a. a -> Unit
singleArgument _ = unit

multiArgument :: forall @a @b. a -> b -> Unit
multiArgument _ _ = unit

singleApplication :: Int /\ Number -> Unit
singleApplication = singleArgument @(Int /\ Number)

-- Like expression applications, visible type applications are left-associative.
-- This test accounts for subsequent type applications nested in this manner.
appNestingWorks :: Int /\ Number -> Number /\ Int -> Unit
appNestingWorks = multiArgument @(Int /\ Number) @(Number /\ Int)

-- This test accounts for type applications nested within other AST nodes.
otherNestingWorks :: Array (Maybe (Int /\ Number))
otherNestingWorks = [Just @(Int /\ Number) (0 /\ 0.0), Just @(Int /\ Number) (1 /\ 1.0)]

type InSynonym = Int /\ Number

-- This test accounts for type synonyms used as type arguments.
-- Since expansion happens during checking, InSynonym would expand
-- to an already-desugared type operator. This test exists for the
-- sake of redundancy.
inSynonym :: InSynonym -> Unit
inSynonym = singleArgument @InSynonym

-- This test accounts for type operators used as type arguments directly.
operatorAsArgument :: Proxy (/\)
operatorAsArgument = Proxy @(/\)

main :: Effect Unit
main = log "Done"

0 comments on commit 8648583

Please sign in to comment.