We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 823b832 commit 7b33c92Copy full SHA for 7b33c92
src/JSON.purs
@@ -13,6 +13,7 @@ module JSON
13
, toNull
14
, toBoolean
15
, toNumber
16
+ , toInt
17
, toString
18
, toArray
19
, toJArray
@@ -123,7 +124,7 @@ toNumber json = runFn7 Internal._case fail fail Just fail fail fail json
123
124
-- | Converts a `JSON` `Number` into an `Int`.
125
-- |
126
-- | This is provided for convenience only.
-toInt :: Json -> Maybe Int
127
+toInt :: JSON -> Maybe Int
128
toInt = toNumber >=> Int.fromNumber
129
130
-- | Converts a `JSON` value to `String` if the `JSON` is a string.
0 commit comments