This repository has been archived by the owner on Dec 18, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
adds JSON.stringify as unsafeStringify
- Loading branch information
creek
committed
Sep 5, 2015
1 parent
d5b0bf8
commit 1b2e526
Showing
3 changed files
with
25 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
## Module Global.Unsafe | ||
|
||
#### `unsafeStringify` | ||
|
||
``` purescript | ||
unsafeStringify :: forall a. a -> String | ||
``` | ||
|
||
Uses the global JSON object to turn anything into a string. Careful! Trying | ||
to serialize functions returns undefined | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
/* globals exports JSON*/ | ||
"use strict"; | ||
|
||
// module Global.Unsafe | ||
|
||
exports.unsafeStringify = function(x){ | ||
return JSON.stringify(x); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
module Global.Unsafe where | ||
|
||
-- | Uses the global JSON object to turn anything into a string. Careful! Trying | ||
-- | to serialize functions returns undefined | ||
foreign import unsafeStringify :: forall a. a -> String |