Skip to content
This repository has been archived by the owner on Dec 18, 2020. It is now read-only.

Commit

Permalink
Merge pull request #6 from kRITZCREEK/json-stringify
Browse files Browse the repository at this point in the history
adds JSON.stringify as unsafeStringify
  • Loading branch information
paf31 committed Sep 5, 2015
2 parents d5b0bf8 + 1b2e526 commit 5ac0116
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 0 deletions.
12 changes: 12 additions & 0 deletions docs/Global/Unsafe.md
@@ -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


8 changes: 8 additions & 0 deletions src/Global/Unsafe.js
@@ -0,0 +1,8 @@
/* globals exports JSON*/
"use strict";

// module Global.Unsafe

exports.unsafeStringify = function(x){
return JSON.stringify(x);
};
5 changes: 5 additions & 0 deletions src/Global/Unsafe.purs
@@ -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

0 comments on commit 5ac0116

Please sign in to comment.