git.iko.soy/rowtype-yoga/purescript-yoga-json
on main help sign in
Update spago and fix warnings
commitb3fc0a8b7db59cd7ec35f19b5dba8d41fae1914a authorMark Eibes <mark.eibes@gmail.com> dateSat 1 Mar 2025, 10:55 (2 years ago) parent247014e
5 files changed+8−52
packages.dhall−7 spago.dhall−39 src/Yoga/JSON.purs+4−4 test/BasicsSpec.purs+1 test/Main.purs+3−2
packages.dhalldeleted−7
@@ -1,7 +0,0 @@
1−let upstream =
2− https://github.com/purescript/package-sets/releases/download/psc-0.15.4-20221116/packages.dhall
3− sha256:a0b88cbba414b046d9e7660fb77ed433d238d4c6ab20e75a479c9c6c823f2812
4−
5−in upstream
6− with
7− js-bigints.version = "v2.0.0"
spago.dhalldeleted−39
@@ -1,39 +0,0 @@
1−{ name = "yoga-json"
2−, license = "MIT"
3−, repository = "https://github.com/rowtype-yoga/purescript-yoga-json.git"
4−, dependencies =
5− [ "arrays"
6− , "bifunctors"
7− , "control"
8− , "datetime"
9− , "effect"
10− , "either"
11− , "exceptions"
12− , "foldable-traversable"
13− , "foreign"
14− , "foreign-object"
15− , "free"
16− , "identity"
17− , "integers"
18− , "js-bigints"
19− , "js-date"
20− , "lists"
21− , "maybe"
22− , "newtype"
23− , "nullable"
24− , "numbers"
25− , "ordered-collections"
26− , "partial"
27− , "prelude"
28− , "record"
29− , "strings"
30− , "transformers"
31− , "tuples"
32− , "typelevel-prelude"
33− , "unsafe-coerce"
34− , "variant"
35− , "yoga-tree"
36− ]
37−, packages = ./packages.dhall
38−, sources = [ "src/**/*.purs" ]
39−}
src/Yoga/JSON.purs+4−4
@@ -60,7 +60,7 @@ import Data.Set as Set
6060import Data.String.NonEmpty.Internal (NonEmptyString)
6161import Data.String.NonEmpty.Internal as NonEmptyString
6262import Data.Symbol (class IsSymbol, reflectSymbol)
63−import Data.Time.Duration (Days(..), Hours(..), Milliseconds(..), Minutes(..), Seconds(..))
63+import Data.Time.Duration (Days, Hours, Milliseconds, Minutes, Seconds)
6464import Data.Traversable (traverse)
6565import Data.Tuple (Tuple(..))
6666import Data.Variant (Variant, inj, on)
@@ -117,7 +117,7 @@ readJSON_ = hush <<< readJSON
117117foreign import _unsafeStringify ∷ ∀ a. a → String
118118
119119-- | JSON.stringify with a number of spaces
120−foreign import _unsafePrettyStringify ∷ ∀ a. Int -> a → String
120+foreign import _unsafePrettyStringify ∷ ∀ a. Int → a → String
121121
122122unsafeStringify ∷ ∀ a. a → String
123123unsafeStringify = _unsafeStringify
@@ -579,10 +579,10 @@ else instance (Newtype nt key, ReadForeign (Map key value)) ⇒ ReadForeign (Map
579579
580580-- Set instances
581581instance (WriteForeign a) ⇒ WriteForeign (Set a) where
582− writeImpl set = writeImpl (Set.toUnfoldable set :: Array a)
582+ writeImpl set = writeImpl (Set.toUnfoldable set ∷ Array a)
583583
584584instance (Ord a, ReadForeign a) ⇒ ReadForeign (Set a) where
585− readImpl f = Set.fromFoldable <$> (readImpl f :: F (Array a))
585+ readImpl f = Set.fromFoldable <$> (readImpl f ∷ F (Array a))
586586
587587-- Date instances
588588instance WriteForeign JSDate where
test/BasicsSpec.purs+1
@@ -230,4 +230,5 @@ derive newtype instance Ord BigInty
230230derive newtype instance WriteForeign BigInty
231231derive newtype instance ReadForeign BigInty
232232
233+big ∷ BigInt
233234big = unsafePartial $ fromJust $ BigInt.fromString "18014398509481982"
test/Main.purs+3−2
@@ -4,11 +4,12 @@ import Prelude
44
55import Effect (Effect)
66import Effect.Aff (launchAff_)
7+import Effect.Class (liftEffect)
78import Test.Spec.Discovery (discover)
89import Test.Spec.Reporter (consoleReporter)
9−import Test.Spec.Runner (runSpec)
10+import Test.Spec.Runner.Node (runSpecAndExitProcess)
1011
1112main ∷ Effect Unit
1213main = launchAff_ $
1314 discover """\..*Spec"""
14− >>= runSpec [ consoleReporter ]
15+ >>= runSpecAndExitProcess [ consoleReporter ] >>> liftEffect