Update for 0.15 syntax and libs (#94)

* Update for 0.15 syntax and libs

* Use 0.14 in CI
This commit is contained in:
Nathan Faubion 2022-04-30 08:55:15 -07:00 committed by GitHub
parent 9e18cef330
commit 728f08b602
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 44 additions and 34 deletions

View File

@ -12,6 +12,8 @@ jobs:
steps:
- uses: actions/checkout@v2
- uses: purescript-contrib/setup-purescript@main
with:
purescript: "0.14.7"
- uses: actions/cache@v2
# This cache uses the .dhall files to know when it should reinstall
# and rebuild packages. It caches both the installed packages from

View File

@ -30,7 +30,6 @@
, "parallel"
, "partial"
, "prelude"
, "psci-support"
, "purescript-language-cst-parser"
, "refs"
, "strings"

View File

@ -23,7 +23,7 @@ let additions =
]
, repo =
"https://github.com/natefaubion/purescript-language-cst-parser.git"
, version = "v0.10.1"
, version = "v0.11.0"
}
, dodo-printer =
{ dependencies =

View File

@ -30,7 +30,8 @@ main = do
let genCmd = Path.concat [ cwdPath, "bin", "index.js" ] <> " generate-operators '.spago/*/*/src/**/*.purs'"
writeTextFile UTF8 (Path.concat [ tmpPath, "spago.dhall" ]) defaultSpagoDhall
_ <- ChildProcess.execSync "spago install" opts
writeTextFile UTF8 (Path.concat [ tmpPath, "package.json" ]) defaultPackageJson
_ <- ChildProcess.execSync "npm install" opts
output <- Buffer.toString UTF8 =<< catchException
( \err -> do
stdout <- Buffer.toString UTF8 ((unsafeCoerce err).stdout :: Buffer)
@ -68,6 +69,21 @@ main = do
writeTextFile UTF8 (Path.concat [ cwdPath, "src", "Tidy", "Operators", "Defaults.purs" ]) contents
defaultPackageJson :: String
defaultPackageJson =
"""
{
"private": true,
"dependencies": {
"purescript": "^0.15.0",
"spago": "^0.20.8"
},
"scripts": {
"postinstall": "spago install"
}
}
"""
defaultSpagoDhall :: String
defaultSpagoDhall =
"""
@ -128,7 +144,6 @@ defaultSpagoDhall =
, "lcg"
, "lists"
, "machines"
, "math"
, "matryoshka"
, "maybe"
, "media-types"
@ -177,7 +192,7 @@ defaultSpagoDhall =
, "uri"
, "validation"
]
, packages = https://github.com/purescript/package-sets/releases/download/psc-0.14.3-20210811/packages.dhall sha256:a2de7ef2f2e753733eddfa90573a82da0c7c61d46fa87d015b7f15ef8a6e97d5
, packages = https://github.com/purescript/package-sets/releases/download/psc-0.15.0-20220429/packages.dhall
, sources = [] : List Text
}
"""

View File

@ -269,8 +269,6 @@ formatExport conf = case _ of
formatToken conf t `space` anchor (formatName conf n)
ExportClass t n ->
formatToken conf t `space` anchor (formatName conf n)
ExportKind t n ->
formatToken conf t `space` anchor (formatName conf n)
ExportModule t n ->
formatToken conf t `space` anchor (formatName conf n)
ExportError e ->
@ -342,8 +340,6 @@ sortImportsIde (Wrapped { open, value: Separated { head, tail }, close }) = do
ImportTypeOpCmp name
ImportClass _ (Name { name }) ->
ImportClassCmp name
ImportKind _ (Name { name }) ->
ImportTypeCmp name true []
ImportError _ ->
ImportErrorCmp
@ -370,8 +366,6 @@ formatImport conf = case _ of
formatToken conf t `space` anchor (formatName conf n)
ImportClass t n ->
formatToken conf t `space` anchor (formatName conf n)
ImportKind t n ->
formatToken conf t `space` anchor (formatName conf n)
ImportError e ->
conf.formatError e
@ -688,6 +682,8 @@ formatHangingMonotype conf = case _ of
hangBreak $ formatName conf n
TypeString t _ ->
hangBreak $ formatToken conf t
TypeInt t _ ->
hangBreak $ formatToken conf t
TypeArrowName t ->
hangBreak $ formatToken conf t
TypeOpName n ->
@ -701,8 +697,6 @@ formatHangingMonotype conf = case _ of
`hangApp` map (formatHangingType conf) tail
TypeParens ty ->
hangBreak $ formatParensBlock formatType conf ty
TypeUnaryRow t ty ->
hangBreak $ formatToken conf t `space` formatType conf ty
TypeKinded ty1 t ty2 ->
hangBreak $ formatType conf ty1 `space` indent do
anchor (formatToken conf t)

View File

@ -104,19 +104,6 @@ defaultOperators =
, """Control.MonadPlus.(=<<) 1"""
, """Control.MonadPlus.(>=>) 1"""
, """Control.MonadPlus.(>>=) 1"""
, """Control.MonadZero.($>) 4"""
, """Control.MonadZero.(*>) 4"""
, """Control.MonadZero.(<#>) 1"""
, """Control.MonadZero.(<$) 4"""
, """Control.MonadZero.(<$>) 4"""
, """Control.MonadZero.(<*) 4"""
, """Control.MonadZero.(<*>) 4"""
, """Control.MonadZero.(<=<) 1"""
, """Control.MonadZero.(<@>) 4"""
, """Control.MonadZero.(<|>) 3"""
, """Control.MonadZero.(=<<) 1"""
, """Control.MonadZero.(>=>) 1"""
, """Control.MonadZero.(>>=) 1"""
, """Control.Plus.($>) 4"""
, """Control.Plus.(<#>) 1"""
, """Control.Plus.(<$) 4"""
@ -278,6 +265,7 @@ defaultOperators =
, """Data.Monoid.(<>) 5"""
, """Data.NaturalTransformation.(~>) type 4"""
, """Data.NonEmpty.(:|) 5"""
, """Data.Number.(%) 7"""
, """Data.Number.Approximate.(~=) 4"""
, """Data.Number.Approximate.(≅) 4"""
, """Data.Number.Approximate.(≇) 4"""
@ -299,7 +287,23 @@ defaultOperators =
, """Data.Tuple.Nested.(/\) type 6"""
, """Data.Tuple.Nested.(/\) 6"""
, """Foreign.Index.(!) 9"""
, """Math.(%) 7"""
, """Parsing.Combinators.(!!) 8"""
, """Parsing.Combinators.($>) 4"""
, """Parsing.Combinators.(..) 8"""
, """Parsing.Combinators.(:) 6"""
, """Parsing.Combinators.(<#>) 1"""
, """Parsing.Combinators.(<$) 4"""
, """Parsing.Combinators.(<$>) 4"""
, """Parsing.Combinators.(<?>) 4"""
, """Parsing.Combinators.(<??>) 3"""
, """Parsing.Combinators.(<@>) 4"""
, """Parsing.Combinators.(<|>) 3"""
, """Parsing.Combinators.(<~?>) 4"""
, """Parsing.Combinators.(\\) 5"""
, """Parsing.Indent.(<*/>) 11"""
, """Parsing.Indent.(<+/>) 9"""
, """Parsing.Indent.(<-/>) 10"""
, """Parsing.Indent.(<?/>) 12"""
, """Pathy.(<..>) 6"""
, """Pathy.(<.>) 6"""
, """Pathy.(</>) 6"""
@ -336,6 +340,8 @@ defaultOperators =
, """Prelude.(>>=) 1"""
, """Prelude.(>>>) 9"""
, """Prelude.(||) 2"""
, """StringParser.(<?>) 4"""
, """StringParser.Combinators.(<?>) 4"""
, """Test.QuickCheck.(/==) 2"""
, """Test.QuickCheck.(/=?) 2"""
, """Test.QuickCheck.(<=?) 2"""
@ -345,13 +351,7 @@ defaultOperators =
, """Test.QuickCheck.(==?) 2"""
, """Test.QuickCheck.(>=?) 2"""
, """Test.QuickCheck.(>?) 2"""
, """Text.Parsing.Indent.(<*/>) 11"""
, """Text.Parsing.Indent.(<+/>) 9"""
, """Text.Parsing.Indent.(<-/>) 10"""
, """Text.Parsing.Indent.(<?/>) 12"""
, """Text.Parsing.Parser.Combinators.(<?>) 3"""
, """Text.Parsing.Parser.Combinators.(<??>) 3"""
, """Text.Parsing.StringParser.Combinators.(<?>) 3"""
, """Type.Function.(#) type 1"""
, """Type.Function.($) type 0"""
, """Type.Prelude.(+) type 0"""
, """Type.Row.(+) type 0"""