-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Update GHC to 9.0.2 #3239
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update GHC to 9.0.2 #3239
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
with-compiler: ghc-8.10.7 | ||
with-compiler: ghc-9.0.2 | ||
|
||
packages: . | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -75,8 +75,9 @@ RUN_CMD="cabal --project-dir=${PROJECT_ROOT} run wasp-cli -- ${ARGS[@]}" | |
|
||
# Utility | ||
GHCID_CMD="ghcid --command=cabal repl" | ||
# ghc version below should be the one from `cabal.project` file, `with-compiler` field. | ||
GHCUP_SET="ghcup set ghc 8.10.7 && ghcup set hls 2.2.0.0" | ||
# HLS version below should be one that works with the GHC version from the | ||
# `with-compiler` field in `cabal.project` | ||
GHCUP_SET="ghcup set hls 2.2.0.0" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. GHC setting is redundant because cabal chooses the compiler version specified in There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What happens when this compiler version is not installed? Does ghcup automatically install too? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. So maybe we can modify this command to |
||
DEV_TOOLS_BIN="$PROJECT_ROOT/.bin" | ||
function install_dev_tool() { | ||
echo "cabal --project-file=$PROJECT_ROOT/dev-tool.project install $1 --installdir=$DEV_TOOLS_BIN --install-method=copy --overwrite-policy=always" | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,7 +9,6 @@ where | |
import Control.Applicative ((<|>)) | ||
import qualified Data.HashMap.Strict as H | ||
import Language.Haskell.TH | ||
import Language.Haskell.TH.Syntax (VarBangType) | ||
import qualified Wasp.Analyzer.Evaluator.Evaluation as E | ||
import qualified Wasp.Analyzer.Type as T | ||
import Wasp.Analyzer.TypeDefinitions (DeclType (..), EnumType (..), IsDeclType (..), IsEnumType (..)) | ||
|
@@ -147,7 +146,8 @@ makeIsDeclTypeInstanceDefinition typeName _dataConstructor@(NormalC conName [(_, | |
-- The constructor is in the form @data Type = Type x1 x2 ... xn@, which is not valid for a decl | ||
makeIsDeclTypeInstanceDefinition typeName _dataConstructor@(NormalC _ values) = | ||
fail $ | ||
"makeDeclType expects given type " ++ show typeName | ||
"makeDeclType expects given type " | ||
++ show typeName | ||
++ " to be a record or to have one data constructor with exactly 1 value, " | ||
++ "but instead it was given a data constructor with " | ||
++ show (length values) | ||
|
@@ -188,7 +188,7 @@ genIsDeclTypeInstanceDefinition typeName dataConstructorName bodyTypeE evaluateE | |
{ dtName = $(nameToLowerFirstStringLiteralExpr dataConstructorName), | ||
dtBodyType = $bodyTypeE, | ||
dtEvaluate = \typeDefs bindings declName declBodyExpr -> | ||
makeDecl @ $(conT typeName) declName <$> declEvaluate typeDefs bindings declBodyExpr | ||
makeDecl @($(conT typeName)) declName <$> declEvaluate typeDefs bindings declBodyExpr | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. GHC 9.0.2 changed whitespace sensitivity around some special characters, one of them being This is the part that concerns us: ![]() Because the splice Same goes for the rest of the file. |
||
} | ||
|], | ||
genVal 'declEvaluate evaluateE | ||
|
@@ -218,19 +218,19 @@ genWaspTypeAndEvaluationForHaskellType typ = | |
KJSON -> return ([|T.QuoterType "json"|], [|E.json|]) | ||
KDeclRef t -> | ||
return | ||
( [|T.DeclType $ dtName $ declType @ $(pure t)|], | ||
[|E.declRef @ $(pure t)|] | ||
( [|T.DeclType $ dtName $ declType @($(pure t))|], | ||
[|E.declRef @($(pure t))|] | ||
) | ||
KEnum -> | ||
return | ||
( [|T.EnumType $ etName $ enumType @ $(pure typ)|], | ||
[|E.enum @ $(pure typ)|] | ||
( [|T.EnumType $ etName $ enumType @($(pure typ))|], | ||
[|E.enum @($(pure typ))|] | ||
) | ||
KRecord dataConName fields -> genDictWaspTypeAndEvaluationForRecord dataConName fields | ||
KCustomEvaluation -> | ||
return | ||
( [|HasCustomEvaluation.waspType @ $(pure typ)|], | ||
[|HasCustomEvaluation.evaluation @ $(pure typ)|] | ||
( [|HasCustomEvaluation.waspType @($(pure typ))|], | ||
[|HasCustomEvaluation.evaluation @($(pure typ))|] | ||
) | ||
KOptional _ -> fail "Maybe is only allowed in record fields" | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,5 @@ | ||
{-# LANGUAGE AllowAmbiguousTypes #-} | ||
{-# LANGUAGE BlockArguments #-} | ||
{-# LANGUAGE GADTs #-} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This has nothing to do with the update but I noticed the redundancy and removed it. |
||
{-# LANGUAGE TemplateHaskell #-} | ||
{-# OPTIONS_GHC -Wno-unused-matches #-} | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -126,7 +126,7 @@ library | |
, aeson ^>= 1.5.6 | ||
, aeson-pretty ^>= 0.8 | ||
, text ^>= 1.2.4 | ||
, template-haskell ^>= 2.16.0 | ||
, template-haskell ^>= 2.17.0 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I couldn't update GHC without updating Our |
||
, unordered-containers ^>= 0.2.16 | ||
, mtl ^>= 2.2.2 | ||
, async ^>= 2.2.4 | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
#3240