Skip to content

Commit 7faf67f

Browse files
committed
Update to Purescript 13.8
1 parent 6ebc758 commit 7faf67f

File tree

3 files changed

+25
-18
lines changed

3 files changed

+25
-18
lines changed

src/Purepur/Generate.hs

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
{-# LANGUAGE OverloadedStrings #-}
2+
23
module Purepur.Generate where
34

45
import Control.Applicative
@@ -29,7 +30,7 @@ import Prelude
2930

3031
generateTest :: (FilePath, D.Module) -> Except ParseError (P.ModuleName, T.Text)
3132
generateTest (filePath, D.Module (P.ModuleName sourceModName) maybeComments declarations _) = do
32-
let name = P.ModuleName $ P.ProperName "Test" : P.ProperName "DocTest" : sourceModName
33+
let name = P.moduleNameFromString $ "Test.DocTest." <> sourceModName
3334
moduleComment <- generateTestFromMarkdown (P.runModuleName name) maybeComments
3435
declarationComments <- mconcat <$> mapM generateTestForDeclaration declarations
3536

@@ -71,25 +72,23 @@ generateTestFromMarkdownFile (path, textContent) = do
7172
where
7273
moduleNameFromPath :: FilePath -> P.ModuleName
7374
moduleNameFromPath filePath =
74-
P.ModuleName $
75-
P.ProperName "Test"
76-
: P.ProperName "MarkdownExamples"
77-
: fmap P.ProperName
75+
P.moduleNameFromString $
76+
"Test.MarkdownExamples."
77+
<> T.intercalate
78+
"."
7879
( filter (/= "")
79-
$ T.splitOn "/"
80-
$ T.replace "." ""
81-
$ T.pack (pTraceShowId filePath)
80+
$ T.splitOn "/"
81+
$ T.replace "." ""
82+
$ T.pack (pTraceShowId filePath)
8283
)
8384

8485
-- generates a File, that imports all others tests and runs them.
8586
generateSummaryFile :: [P.ModuleName] -> (PurepurDocument, P.ModuleName)
86-
generateSummaryFile testModules = (doc, P.ModuleName [P.ProperName "DocTest"])
87+
generateSummaryFile testModules = (doc, P.moduleNameFromString "DocTest")
8788
where
8889
doc :: PurepurDocument
8990
doc = mconcat $ documentFromModuleName <$> testModules
90-
9191
documentFromModuleName :: P.ModuleName -> PurepurDocument
9292
documentFromModuleName mod =
9393
documentFromImport (mod, P.Implicit, Just mod)
94-
<>
95-
documentFromSpec (ReferenceSpec $ P.mkQualified (P.Ident "main") mod)
94+
<> documentFromSpec (ReferenceSpec $ P.mkQualified (P.Ident "main") mod)

stack.yaml

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@
1515
# resolver:
1616
# name: custom-snapshot
1717
# location: "./custom-snapshot.yaml"
18-
resolver: lts-13.12
18+
resolver: lts-13.26
19+
1920

2021
# User packages to be built.
2122
# Various formats can be used as shown in the example below.
@@ -40,13 +41,20 @@ packages:
4041
# Dependency packages to be pulled from upstream that are not in the resolver
4142
# (e.g., acme-missiles-0.3)
4243
extra-deps:
43-
- git: https://github.com/purescript/purescript
44-
commit: 738aaa2f21097c7f18aa8100b16ae52316addb04
44+
- happy-1.19.9
45+
- language-javascript-0.7.0.0
46+
- purescript-0.13.8
4547
- network-3.0.1.1
46-
- pipes-http-1.0.5
47-
- ghc-lib-parser-8.10.1.20200412
48+
- these-1.0.1
49+
- semialign-1
4850
# Override default flag values for local packages and extra-deps
4951
# flags: {}
52+
flags:
53+
aeson-pretty:
54+
lib-only: true
55+
these:
56+
assoc: false
57+
quickcheck: false
5058

5159
# Extra package databases containing global packages
5260
# extra-package-dbs: []

test/Spec.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import qualified Language.PureScript.Interactive.Types as Psci
1212
main :: IO ()
1313
main = hspec $
1414
describe "Parse Comment" $ do
15-
let importT = Command $ Psci.Import (Purs.ModuleName [Purs.ProperName "T"], AST.Implicit, Nothing)
15+
let importT = Command $ Psci.Import (Purs.moduleNameFromString "T", AST.Implicit, Nothing)
1616

1717
it "simple output" $
1818
parseInfoBlock "asd" `shouldBe` Right [ExpectedOutput "asd"]

0 commit comments

Comments
 (0)