Skip to content

Add JNull value #20

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 8, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions src/Data/Argonaut/Core.purs
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ module Data.Argonaut.Core
, toString
, toArray
, toObject
, jNull
, jsonNull
, jsonTrue
, jsonFalse
Expand All @@ -49,11 +50,12 @@ module Data.Argonaut.Core

import Prelude

import Data.Tuple (Tuple)
import Data.Maybe (Maybe(..))
import Data.Function.Uncurried (Fn5, runFn5, Fn7, runFn7)

import Data.Maybe (Maybe(..))
import Data.StrMap as M
import Data.Tuple (Tuple)

import Unsafe.Coerce (unsafeCoerce)

-- | A Boolean value inside some JSON data. Note that this type is exactly the
-- | same as the primitive `Boolean` type; this synonym acts only to help
Expand Down Expand Up @@ -195,6 +197,9 @@ foreign import fromObject :: JObject -> Json

-- Defaults

jNull :: JNull
jNull = (unsafeCoerce :: Json -> JNull) jsonNull

foreign import jsonNull :: Json

jsonTrue :: Json
Expand Down