Skip to content

Commit e463743

Browse files
authored
Merge pull request #126 from natefaubion/0.12
Bump version to 0.12
2 parents d536394 + 8747a1e commit e463743

File tree

5 files changed

+26
-37
lines changed

5 files changed

+26
-37
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-8.5
1+
resolver: lts-12.0
22
flags: {}
33
packages:
44
- '.'
55
extra-deps:
6-
- purescript-0.11.7
6+
- purescript-0.12.3
77
- pipes-http-1.0.5

staging/core/psc-package.json

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "core",
3-
"set": "psc-0.11.7",
3+
"set": "psc-0.12.2",
44
"source": "https://github.com/purescript/package-sets.git",
55
"depends": [
66
"arrays",
@@ -10,28 +10,25 @@
1010
"contravariant",
1111
"control",
1212
"distributive",
13-
"eff",
13+
"effect",
1414
"either",
1515
"enums",
1616
"exceptions",
1717
"exists",
1818
"foldable-traversable",
1919
"foreign",
20+
"foreign-object",
2021
"free",
2122
"functions",
2223
"functors",
23-
"generics",
2424
"generics-rep",
2525
"globals",
26-
"graphs",
2726
"identity",
28-
"inject",
2927
"integers",
3028
"lazy",
31-
"maps",
3229
"math",
3330
"maybe",
34-
"monoid",
31+
"ordered-collections",
3532
"prelude",
3633
"profunctor",
3734
"proxy",
@@ -40,7 +37,6 @@
4037
"record",
4138
"refs",
4239
"semirings",
43-
"sets",
4440
"st",
4541
"strings",
4642
"tailrec",

staging/core/src/TryPureScript.purs

Lines changed: 9 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
module TryPureScript
22
( Inline
33
, Doc
4-
, DOM
54
, text
65
, p
76
, link
@@ -19,29 +18,23 @@ module TryPureScript
1918
) where
2019

2120
import Prelude
22-
import Control.Monad.Eff (kind Effect, Eff)
2321
import Data.Foldable (class Foldable, foldMap)
2422
import Data.String (joinWith)
25-
import Data.Monoid (class Monoid)
23+
import Effect (Effect)
2624

27-
foreign import data DOM :: Effect
28-
29-
foreign import setInnerHTML
30-
:: forall eff
31-
. String
32-
-> Eff (dom :: DOM | eff) Unit
25+
foreign import setInnerHTML :: String -> Effect Unit
3326

3427
foreign import encode :: String -> String
3528

3629
foreign import withConsoleImpl
37-
:: forall eff a
38-
. Eff eff a
39-
-> Eff eff (Array String)
30+
:: forall a
31+
. Effect a
32+
-> Effect (Array String)
4033

4134
withConsole
42-
:: forall eff a
43-
. Eff eff a
44-
-> Eff eff Doc
35+
:: forall a
36+
. Effect a
37+
-> Effect Doc
4538
withConsole f = map toDoc (withConsoleImpl f) where
4639
toDoc = Doc <<< tag' "pre" <<< tag' "code" <<< joinWith "\n"
4740

@@ -73,7 +66,7 @@ newtype Doc = Doc String
7366
unDoc :: Doc -> String
7467
unDoc (Doc html) = html
7568

76-
render :: forall eff. Doc -> Eff (dom :: DOM | eff) Unit
69+
render :: Doc -> Effect Unit
7770
render (Doc html) = setInnerHTML html
7871

7972
derive newtype instance semigroupDoc :: Semigroup Doc

trypurescript.cabal

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

0 commit comments

Comments
 (0)