Skip to content

Commit 247014e

Browse files
authored
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.
1 parent 6b9bb4a commit 247014e

File tree

2 files changed

+10
-6
lines changed

2 files changed

+10
-6
lines changed

CHANGELOG.md

+4
Original file line numberDiff line numberDiff line change
@@ -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
Original file line numberDiff line numberDiff line change
@@ -90,15 +90,15 @@ type E a = Either MultipleErrors a
9090
-- | Read a JSON string to a type `a` while returning a `MultipleErrors` if the
9191
-- | parsing failed.
9292
readJSON
93-
a.
93+
@a.
9494
ReadForeign a
9595
String
9696
E a
9797
readJSON = runExcept <<< (readImpl <=< parseJSON)
9898

9999
-- | Read a JSON string to a type `a` using `F a`. Useful with record types.
100100
readJSON'
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.
109109
readJSON_
110-
a.
110+
@a.
111111
ReadForeign a
112112
String
113113
Maybe a
@@ -147,22 +147,22 @@ write = writeImpl
147147

148148
-- | Read a Foreign value to a type
149149
read
150-
a.
150+
@a.
151151
ReadForeign a
152152
Foreign
153153
E a
154154
read = runExcept <<< readImpl
155155

156156
read'
157-
a.
157+
@a.
158158
ReadForeign a
159159
Foreign
160160
F a
161161
read' = readImpl
162162

163163
-- | Read a Foreign value to a type, as a Maybe of type
164164
read_
165-
a.
165+
@a.
166166
ReadForeign a
167167
Foreign
168168
Maybe a

0 commit comments

Comments
 (0)