Skip to content
This repository was archived by the owner on Jun 15, 2023. It is now read-only.

Commit fcc5c05

Browse files
authored
Updates for PureScript v0.11 (#79)
1 parent d89cc23 commit fcc5c05

File tree

9 files changed

+58
-46
lines changed

9 files changed

+58
-46
lines changed

bower.json

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -22,17 +22,17 @@
2222
"package.json"
2323
],
2424
"dependencies": {
25-
"purescript-const": "^2.0.0",
26-
"purescript-functors": "^1.1.0",
27-
"purescript-lists": "^3.4.0",
28-
"purescript-parsing": "^3.2.1",
25+
"purescript-const": "^3.0.0",
26+
"purescript-functors": "^2.0.0",
27+
"purescript-lists": "^4.0.0",
28+
"purescript-parsing": "^4.0.0",
2929
"purescript-partial": "^1.2.0",
30-
"purescript-precise": "^1.1.0",
31-
"purescript-prelude": "^2.5.0",
32-
"purescript-sets": "^2.0.1",
33-
"purescript-strings": "^2.1.0",
34-
"purescript-strongcheck": "^2.1.0",
35-
"purescript-validation": "^2.0.0",
36-
"purescript-datetime": "^2.2.0"
30+
"purescript-precise": "^2.0.0",
31+
"purescript-prelude": "^3.0.0",
32+
"purescript-sets": "^3.0.0",
33+
"purescript-strings": "^3.0.0",
34+
"purescript-strongcheck": "^3.0.0",
35+
"purescript-validation": "^3.0.0",
36+
"purescript-datetime": "^3.0.0"
3737
}
3838
}

package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@
22
"private": true,
33
"scripts": {
44
"clean": "rimraf output && rimraf .pulp-cache",
5-
"build": "pulp build --censor-lib --strict",
5+
"build": "pulp build -- --censor-lib --strict",
66
"test": "pulp test"
77
},
88
"devDependencies": {
9-
"pulp": "^9.0.1",
10-
"purescript": "^0.10.1",
11-
"purescript-psa": "^0.3.9",
9+
"pulp": "^11.0.0",
10+
"purescript": "^0.11.4",
11+
"purescript-psa": "^0.5.0",
1212
"rimraf": "^2.5.4"
1313
}
1414
}

src/Text/Markdown/SlamDown/Eval.purs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,8 @@ type LanguageId = String
2424

2525
eval
2626
m a
27-
. (Monad m, SD.Value a)
27+
. Monad m
28+
SD.Value a
2829
{ code M.Maybe LanguageId String m a
2930
, textBox SD.TextBox (Const String) m (SD.TextBox Identity)
3031
, value String m a

src/Text/Markdown/SlamDown/Parser/Inline.purs

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ inlines = L.many inline2 <* PS.eof
172172
String
173173
P.Parser String (SD.Inline a)
174174
emphasis p f s = do
175-
PS.string s
175+
_ ← PS.string s
176176
f <$> PC.manyTill p (PS.string s)
177177

178178
emph P.Parser String (SD.Inline a) P.Parser String (SD.Inline a)
@@ -230,7 +230,7 @@ inlines = L.many inline2 <* PS.eof
230230

231231
autolink P.Parser String (SD.Inline a)
232232
autolink = do
233-
PS.string "<"
233+
_ ← PS.string "<"
234234
url ← (S.fromCharArray <<< A.fromFoldable) <$> (PS.anyChar `PC.many1Till` PS.string ">")
235235
pure $ SD.Link (L.singleton $ SD.Str (autoLabel url)) (SD.InlineLink url)
236236
where
@@ -241,7 +241,7 @@ inlines = L.many inline2 <* PS.eof
241241

242242
entity P.Parser String (SD.Inline a)
243243
entity = do
244-
PS.string "&"
244+
_ ← PS.string "&"
245245
s ← (S.fromCharArray <<< A.fromFoldable) <$> (PS.noneOf (S.toCharArray ";") `PC.many1Till` PS.string ";")
246246
pure $ SD.Entity $ "&" <> s <> ";"
247247

@@ -254,7 +254,7 @@ inlines = L.many inline2 <* PS.eof
254254
required
255255
fe ← do
256256
PU.skipSpaces
257-
PS.string "="
257+
_ ← PS.string "="
258258
PU.skipSpaces
259259
formElement
260260
pure $ map (SD.FormField l r) fe
@@ -288,7 +288,7 @@ inlines = L.many inline2 <* PS.eof
288288
case mdef of
289289
M.Just def → do
290290
PU.skipSpaces
291-
PS.string ")"
291+
_ ← PS.string ")"
292292
pure $ Right $ SD.TextBox $ SD.transTextBox (M.Just >>> Compose) def
293293
M.Nothing
294294
pure $ Left case template of
@@ -319,21 +319,21 @@ inlines = L.many inline2 <* PS.eof
319319

320320
where
321321
parseDateTimeTemplate prec = do
322-
parseDateTemplate
322+
_ ← parseDateTemplate
323323
PU.skipSpaces
324324
parseTimeTemplate prec
325325

326326
parseDateTemplate = do
327-
und
327+
_ ← und
328328
PU.skipSpaces *> dash *> PU.skipSpaces
329-
und
329+
_ ← und
330330
PU.skipSpaces *> dash *> PU.skipSpaces
331331
und
332332

333333
parseTimeTemplate prec = do
334-
und
334+
_ ← und
335335
PU.skipSpaces *> colon *> PU.skipSpaces
336-
und
336+
_ ← und
337337
when (prec == SD.Seconds) do
338338
PU.skipSpaces *> colon *> PU.skipSpaces
339339
void und
@@ -535,6 +535,6 @@ expr f p =
535535

536536
unevaluated b. P.Parser String (SD.Expr b)
537537
unevaluated = do
538-
PS.string "!"
538+
_ ← PS.string "!"
539539
ticks ← someOf (\x → S.singleton x == "`")
540540
SD.Unevaluated <<< S.fromCharArray <<< A.fromFoldable <$> PC.manyTill PS.anyChar (PS.string ticks)

src/Text/Markdown/SlamDown/Parser/References.purs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,10 @@ linkReference ∷ ∀ a. P.Parser String (SD.Block a)
2323
linkReference = do
2424
l ←
2525
charsToString <$> do
26-
PS.string "["
26+
_ ← PS.string "["
2727
PU.skipSpaces
2828
PC.manyTill PS.anyChar (PS.string "]")
29-
PS.string ":"
29+
_ ← PS.string ":"
3030
PU.skipSpaces
3131
uri ← charsToString <$> PC.manyTill PS.anyChar PS.eof
3232
pure $ SD.LinkReference l uri

src/Text/Markdown/SlamDown/Syntax/FormField.purs

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,13 @@ module Text.Markdown.SlamDown.Syntax.FormField
1515
import Prelude
1616

1717
import Data.Array as A
18+
import Data.Eq (class Eq1)
1819
import Data.Functor.Compose (Compose(..))
1920
import Data.Identity (Identity(..))
2021
import Data.List as L
2122
import Data.Maybe as M
2223
import Data.Newtype (unwrap)
24+
import Data.Ord (class Ord1)
2325
import Data.Set as Set
2426
import Data.Traversable as TR
2527
import Data.Tuple (uncurry)
@@ -51,7 +53,7 @@ transFormField eta =
5153

5254
traverseFormField
5355
f g h a
54-
. (Applicative h)
56+
. Applicative h
5557
( x. f x h (g x))
5658
FormFieldP f a
5759
h (FormFieldP g a)
@@ -220,18 +222,18 @@ instance coarbitraryFormFieldIdentity ∷ (SCA.Coarbitrary a) ⇒ SCA.Coarbitrar
220222
case field of
221223
TextBox tb → SCA.coarbitrary $ TB.transTextBox (unwrap >>> map (unwrap >>> ArbIdentity) >>> ArbCompose) tb
222224
RadioButtons x xs → \gen → do
223-
SCA.coarbitrary (ArbIdentity $ unwrap x) gen
225+
_← SCA.coarbitrary (ArbIdentity $ unwrap x) gen
224226
SCA.coarbitrary (ArbIdentity $ unwrap xs) gen
225227
CheckBoxes sel xs → \gen → do
226-
SCA.coarbitrary (ArbIdentity $ unwrap sel) gen
228+
_← SCA.coarbitrary (ArbIdentity $ unwrap sel) gen
227229
SCA.coarbitrary (ArbIdentity $ unwrap xs) gen
228230
DropDown mx xs → \gen → do
229-
SCA.coarbitrary (ArbIdentity <<< unwrap <$> mx) gen
231+
_← SCA.coarbitrary (ArbIdentity <<< unwrap <$> mx) gen
230232
SCA.coarbitrary (ArbIdentity $ unwrap xs) gen
231233

232234
listOf1
233235
f a
234-
. (Monad f)
236+
. Monad f
235237
Gen.GenT f a
236238
Gen.GenT f (L.List a)
237239
listOf1 =
@@ -259,15 +261,17 @@ listOfLength i =
259261

260262
distinctListOf1
261263
f a
262-
. (Monad f, Eq a)
264+
. Monad f
265+
Eq a
263266
Gen.GenT f a
264267
Gen.GenT f (L.List a)
265268
distinctListOf1 =
266269
map (map L.nub) listOf1
267270

268271
distinctListOf
269272
f a
270-
. (Monad f, Eq a)
273+
. Monad f
274+
Eq a
271275
Gen.GenT f a
272276
Gen.GenT f (L.List a)
273277
distinctListOf =
@@ -300,6 +304,12 @@ instance showExpr ∷ (Show a) ⇒ Show (Expr a) where
300304
derive instance eqExprEq a Eq (Expr a)
301305
derive instance ordExprOrd a Ord (Expr a)
302306

307+
instance eq1Eq1 Expr where
308+
eq1 = eq
309+
310+
instance ord1ExprOrd1 Expr where
311+
compare1 = compare
312+
303313
genExpr a. Gen.Gen a Gen.Gen (Expr a)
304314
genExpr g = do
305315
b ← SCA.arbitrary

src/Text/Markdown/SlamDown/Syntax/TextBox.purs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,10 +89,10 @@ instance coarbitraryTextBox ∷ (Functor f, SCA.Coarbitrary (f String), SCA.Coar
8989
Numeric d -> SCA.coarbitrary $ HN.toNumber <$> d
9090
Date d -> SCA.coarbitrary (ADT.ArbDate <$> d)
9191
Time prec d -> do
92-
SCA.coarbitrary prec
92+
_ ← SCA.coarbitrary prec
9393
SCA.coarbitrary (ADT.ArbTime <$> d)
9494
DateTime prec d -> do
95-
SCA.coarbitrary prec
95+
_ ← SCA.coarbitrary prec
9696
SCA.coarbitrary (ADT.ArbDateTime <$> d)
9797

9898
eraseMillis DT.Time DT.Time

src/Text/Markdown/SlamDown/Traverse.purs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ import Text.Markdown.SlamDown.Syntax as SD
1919

2020
everywhereM
2121
m a
22-
. (Monad m)
22+
. Monad m
2323
(SD.Block a m (SD.Block a))
2424
(SD.Inline a m (SD.Inline a))
2525
SD.SlamDownP a
@@ -54,7 +54,7 @@ everywhere b i =
5454

5555
everywhereTopDownM
5656
m a
57-
. (Monad m)
57+
. Monad m
5858
(SD.Block a m (SD.Block a))
5959
(SD.Inline a m (SD.Inline a))
6060
SD.SlamDownP a
@@ -91,7 +91,8 @@ everywhereTopDown b i =
9191

9292
everythingM
9393
m a r
94-
. (Monad m, Monoid r)
94+
. Monad m
95+
Monoid r
9596
(SD.Block a m r)
9697
(SD.Inline a m r)
9798
SD.SlamDownP a
@@ -115,7 +116,7 @@ everythingM b i (SD.SlamDown bs) =
115116

116117
everything
117118
r a
118-
. (Monoid r)
119+
. Monoid r
119120
(SD.Block a r)
120121
(SD.Inline a r)
121122
SD.SlamDownP a

test/src/Test/Main.purs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ import Partial.Unsafe (unsafePartial)
3838
type TestEffects e =
3939
( console C.CONSOLE
4040
, random Rand.RANDOM
41-
, err Exn.EXCEPTION
41+
, exception Exn.EXCEPTION
4242
| e
4343
)
4444

@@ -304,7 +304,7 @@ generated = do
304304
10 (Gen.GenState { size: 10, seed })
305305
(SDPR.prettyPrintMd <<< runTestSlamDown <$> SCA.arbitrary)
306306

307-
TR.traverse C.log docs
307+
_ ← TR.traverse C.log docs
308308

309309
SC.quickCheck' 100 \(TestSlamDown sd) →
310310
let
@@ -343,7 +343,7 @@ three ∷ ∀ a. a → a → a → Array a
343343
three a b c = [a, b, c]
344344

345345

346-
blocks a. (SCA.Arbitrary a, SD.Value a) Gen.Gen (Array (SD.Block a))
346+
blocks a. SCA.Arbitrary a SD.Value a Gen.Gen (Array (SD.Block a))
347347
blocks =
348348
Gen.oneOf (smallArrayOf block0)
349349
[ A.singleton <$> bq
@@ -375,7 +375,7 @@ blocks =
375375
<$> Gen.oneOf (SD.Bullet <$> (Gen.elements "-" $ L.fromFoldable ["+", "*"])) [ SD.Ordered <$> (Gen.elements ")" $ L.singleton ".")]
376376
<*> (L.fromFoldable <$> tinyArrayOf (L.fromFoldable <$> (tinyArrayOf block0)))
377377

378-
inlines a. (SCA.Arbitrary a, SD.Value a) Gen.Gen (Array (SD.Inline a))
378+
inlines a. SCA.Arbitrary a SD.Value a Gen.Gen (Array (SD.Inline a))
379379
inlines =
380380
Gen.oneOf inlines0
381381
[ A.singleton <$> link

0 commit comments

Comments
 (0)