git.iko.soy/rowtype-yoga/purescript-yoga-json
on main help sign in
Update spago and fix warnings
b3fc0a8Mark Eibes
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
60import Data.String.NonEmpty.Internal (NonEmptyString)
60import Data.String.NonEmpty.Internal (NonEmptyString)
61import Data.String.NonEmpty.Internal as NonEmptyString
61import Data.String.NonEmpty.Internal as NonEmptyString
62import Data.Symbol (class IsSymbol, reflectSymbol)
62import 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)
64import Data.Traversable (traverse)
64import Data.Traversable (traverse)
65import Data.Tuple (Tuple(..))
65import Data.Tuple (Tuple(..))
66import Data.Variant (Variant, inj, on)
66import Data.Variant (Variant, inj, on)
@@ -117,7 +117,7 @@ readJSON_ = hush <<< readJSON
117foreign import _unsafeStringify ∷ ∀ a. a → String
117foreign import _unsafeStringify ∷ ∀ a. a → String
118
118
119-- | JSON.stringify with a number of spaces
119-- | JSON.stringify with a number of spaces
120−foreign import _unsafePrettyStringify ∷ ∀ a. Int -> a → String
120+foreign import _unsafePrettyStringify ∷ ∀ a. Int → a → String
121
121
122unsafeStringify ∷ ∀ a. a → String
122unsafeStringify ∷ ∀ a. a → String
123unsafeStringify = _unsafeStringify
123unsafeStringify = _unsafeStringify
@@ -579,10 +579,10 @@ else instance (Newtype nt key, ReadForeign (Map key value)) ⇒ ReadForeign (Map
579
579
580-- Set instances
580-- Set instances
581instance (WriteForeign a) ⇒ WriteForeign (Set a) where
581instance (WriteForeign a) ⇒ WriteForeign (Set a) where
582− writeImpl set = writeImpl (Set.toUnfoldable set :: Array a)
582+ writeImpl set = writeImpl (Set.toUnfoldable set ∷ Array a)
583
583
584instance (Ord a, ReadForeign a) ⇒ ReadForeign (Set a) where
584instance (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))
586
586
587-- Date instances
587-- Date instances
588instance WriteForeign JSDate where
588instance WriteForeign JSDate where
test/BasicsSpec.purs+1
@@ -230,4 +230,5 @@ derive newtype instance Ord BigInty
230derive newtype instance WriteForeign BigInty
230derive newtype instance WriteForeign BigInty
231derive newtype instance ReadForeign BigInty
231derive newtype instance ReadForeign BigInty
232
232
233+big ∷ BigInt
233big = unsafePartial $ fromJust $ BigInt.fromString "18014398509481982"
234big = unsafePartial $ fromJust $ BigInt.fromString "18014398509481982"
test/Main.purs+3−2
@@ -4,11 +4,12 @@ import Prelude
4
4
5import Effect (Effect)
5import Effect (Effect)
6import Effect.Aff (launchAff_)
6import Effect.Aff (launchAff_)
7+import Effect.Class (liftEffect)
7import Test.Spec.Discovery (discover)
8import Test.Spec.Discovery (discover)
8import Test.Spec.Reporter (consoleReporter)
9import Test.Spec.Reporter (consoleReporter)
9−import Test.Spec.Runner (runSpec)
10+import Test.Spec.Runner.Node (runSpecAndExitProcess)
10
11
11main ∷ Effect Unit
12main ∷ Effect Unit
12main = launchAff_ $
13main = launchAff_ $
13 discover """\..*Spec"""
14 discover """\..*Spec"""
14− >>= runSpec [ consoleReporter ]
15+ >>= runSpecAndExitProcess [ consoleReporter ] >>> liftEffect