Skip to content

Commit bed12ee

Browse files
committed
Updates for 0.12.3
1 parent 2867382 commit bed12ee

File tree

3 files changed

+12
-12
lines changed

3 files changed

+12
-12
lines changed

server/Main.hs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -109,17 +109,17 @@ server bundled externs initEnv port = do
109109
search = fst . TS.typeSearch (Just []) initEnv (P.emptyCheckState initEnv)
110110
results = nubBy ((==) `on` fst) $ do
111111
elab <- elabs
112-
let strictMatches = search (replaceTypeVariablesAndDesugar (\nm s -> P.Skolem nm s (P.SkolemScope 0) Nothing) elab)
113-
flexMatches = search (replaceTypeVariablesAndDesugar (const P.TUnknown) elab)
112+
let strictMatches = search (replaceTypeVariablesAndDesugar (\nm s -> P.Skolem P.NullSourceAnn nm s (P.SkolemScope 0)) elab)
113+
flexMatches = search (replaceTypeVariablesAndDesugar (const (P.TUnknown P.NullSourceAnn)) elab)
114114
take 50 (strictMatches ++ flexMatches)
115115
Scotty.json $ A.object [ "results" .= [ P.showQualified id k
116116
| (k, _) <- take 50 results
117117
]
118118
]
119119

120-
lookupAllConstructors :: P.Environment -> P.Type -> [P.Type]
120+
lookupAllConstructors :: P.Environment -> P.SourceType -> [P.SourceType]
121121
lookupAllConstructors env = P.everywhereOnTypesM $ \case
122-
P.TypeConstructor (P.Qualified Nothing tyCon) -> P.TypeConstructor <$> lookupConstructor env tyCon
122+
P.TypeConstructor ann (P.Qualified Nothing tyCon) -> P.TypeConstructor ann <$> lookupConstructor env tyCon
123123
other -> pure other
124124
where
125125
lookupConstructor :: P.Environment -> P.ProperName 'P.TypeName -> [P.Qualified (P.ProperName 'P.TypeName)]
@@ -132,11 +132,11 @@ lookupAllConstructors env = P.everywhereOnTypesM $ \case
132132
-- | (Consistently) replace unqualified type constructors and type variables with unknowns.
133133
--
134134
-- Also remove the @ParensInType@ Constructor (we need to deal with type operators later at some point).
135-
replaceTypeVariablesAndDesugar :: (Text -> Int -> P.Type) -> P.Type -> P.Type
135+
replaceTypeVariablesAndDesugar :: (Text -> Int -> P.SourceType) -> P.SourceType -> P.SourceType
136136
replaceTypeVariablesAndDesugar f ty = State.evalState (P.everywhereOnTypesM go ty) (0, M.empty) where
137137
go = \case
138-
P.ParensInType ty -> pure ty
139-
P.TypeVar s -> do
138+
P.ParensInType _ ty -> pure ty
139+
P.TypeVar _ s -> do
140140
(next, m) <- State.get
141141
case M.lookup s m of
142142
Nothing -> do
@@ -146,7 +146,7 @@ replaceTypeVariablesAndDesugar f ty = State.evalState (P.everywhereOnTypesM go t
146146
Just ty -> pure ty
147147
other -> pure other
148148

149-
tryParseType :: Text -> Maybe P.Type
149+
tryParseType :: Text -> Maybe P.SourceType
150150
tryParseType = hush (P.lex "") >=> hush (P.runTokenParser "" (P.parsePolyType <* Parsec.eof))
151151
where
152152
hush f = either (const Nothing) Just . f

stack.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
resolver: lts-11.7
1+
resolver: lts-12.0
22
flags: {}
33
packages:
44
- '.'
55
extra-deps:
6-
- purescript-0.12.0
6+
- purescript-0.12.3
77
- pipes-http-1.0.5

trypurescript.cabal

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name: trypurescript
2-
version: 0.12.0
2+
version: 0.12.3
33
cabal-version: >=1.8
44
build-type: Simple
55
license: BSD3
@@ -20,7 +20,7 @@ executable trypurescript
2020
filepath -any,
2121
Glob -any,
2222
scotty -any,
23-
purescript ==0.12.0,
23+
purescript ==0.12.3,
2424
containers -any,
2525
http-types >= 0.8.5,
2626
transformers ==0.5.*,

0 commit comments

Comments
 (0)