git.iko.soy/rowtype-yoga/purescript-yoga-json
on main help sign in
Make the type variable in `read*` functions visibly-applicable (#24)

This would make syntax slightly more convenient for cases where the type of parsing result couldn't be infered.

commit247014ed3bb408d437e5126d8296e8741cd68890 authorpostsolar <120750161+postsolar@users.noreply.github.com> dateFri 13 Sep 2024, 17:13 (2 years ago) parent6b9bb4a
2 files changed+10−6
CHANGELOG.md+4 src/Yoga/JSON.purs+6−6
CHANGELOG.md+4
@@ -1,5 +1,9 @@
11# Changelog
22
3+## v4.0.1
4+
5+- Allow the type of `read*` functions to be visibly applied (#24 by @postsolar)
6+
37## v4.0.0
48- Replace `bigints` dependency with `js-bigints` so that no more external npm dependency is needed (#11 by @sigma-andex)
59
src/Yoga/JSON.purs+6−6
@@ -90,7 +90,7 @@ type E a = Either MultipleErrors a
9090-- | Read a JSON string to a type `a` while returning a `MultipleErrors` if the
9191-- | parsing failed.
9292readJSON ∷
93− ∀ a.
93+ ∀ @a.
9494 ReadForeign a ⇒
9595 String →
9696 E a
@@ -98,7 +98,7 @@ readJSON = runExcept <<< (readImpl <=< parseJSON)
9898
9999-- | Read a JSON string to a type `a` using `F a`. Useful with record types.
100100readJSON' ∷
101− ∀ a.
101+ ∀ @a.
102102 ReadForeign a ⇒
103103 String →
104104 F a
@@ -107,7 +107,7 @@ readJSON' = readImpl <=< parseJSON
107107-- | Read a JSON string to a type `a` while returning `Nothing` if the parsing
108108-- | failed.
109109readJSON_ ∷
110− ∀ a.
110+ ∀ @a.
111111 ReadForeign a ⇒
112112 String →
113113 Maybe a
@@ -147,14 +147,14 @@ write = writeImpl
147147
148148-- | Read a Foreign value to a type
149149read ∷
150− ∀ a.
150+ ∀ @a.
151151 ReadForeign a ⇒
152152 Foreign →
153153 E a
154154read = runExcept <<< readImpl
155155
156156read' ∷
157− ∀ a.
157+ ∀ @a.
158158 ReadForeign a ⇒
159159 Foreign →
160160 F a
@@ -162,7 +162,7 @@ read' = readImpl
162162
163163-- | Read a Foreign value to a type, as a Maybe of type
164164read_ ∷
165− ∀ a.
165+ ∀ @a.
166166 ReadForeign a ⇒
167167 Foreign →
168168 Maybe a