Skip to content

Extracted core #1

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
Jul 11, 2015
Merged
Show file tree
Hide file tree
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
8 changes: 8 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
/.*
!/.gitignore
!/.travis.yml
bower_components/
node_modules/
output/
dist/
npm-debug.log
13 changes: 13 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
language: node_js
node_js:
- 0.10
env:
- TAG=v0.7.0
install:
- wget -O $HOME/purescript.tar.gz https://github.com/purescript/purescript/releases/download/$TAG/linux64.tar.gz
- sudo tar zxvf $HOME/purescript.tar.gz -C /usr/local/bin purescript/psc{,i,-docs,-bundle} --strip-components=1
- sudo chmod a+x /usr/local/bin/psc{,i,-docs,-bundle}
- npm install bower gulp -g
- npm install && bower install
script:
- gulp test
16 changes: 16 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1 +1,17 @@
[![Build Status](https://travis-ci.org/purescript-contrib/purescript-argonaut-core.svg?branch=master)](https://travis-ci.org/purescript-contrib/purescript-argonaut-core)

# purescript-argonaut-core

Core part of __purescript-argonaut__ contains basic types for `Json`, folds over them, tests, printer and parser

## Installation

```shell
bower install purescript-argonaut-core
```

## Documentation

- [Data.Argonaut.Core](docs/Data/Argonaut/Core.md)
- [Data.Argonaut.Parser](docs/Data/Argonaut/Parser.md)
- [Data.Argonaut.Printer](docs/Data/Argonaut/Printer.md)
29 changes: 29 additions & 0 deletions bower.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{
"name": "purescript-argonaut-core",
"homepage": "https://github.com/purescript-contrib/purescript-argonaut-core",
"authors": [
"Maxim Zimaliev <[email protected]>",
"Hardy Jones <>",
"John A. De Goes <[email protected]>"
],
"description": "Core of purescript-argonaut library, it provides basic types, folds and combinators for `Json`",
"keywords": [
"purescript",
"argonaut",
"json"
],
"license": "MIT",
"dependencies": {
"purescript-prelude": "^0.1.0",
"purescript-functions": "^0.1.0",
"purescript-maybe": "^0.3.2",
"purescript-tuples": "^0.4.0",
"purescript-maps": "^0.4.0"
},
"devDependencies": {
"purescript-eff": "^0.1.0",
"purescript-console": "^0.1.0",
"purescript-strongcheck": "^0.10.0",
"purescript-foldable-traversable": "^0.4.0"
}
}
263 changes: 263 additions & 0 deletions docs/Data/Argonaut/Core.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,263 @@
## Module Data.Argonaut.Core

#### `JBoolean`

``` purescript
type JBoolean = Boolean
```

#### `JNumber`

``` purescript
type JNumber = Number
```

#### `JString`

``` purescript
type JString = String
```

#### `JAssoc`

``` purescript
type JAssoc = Tuple String Json
```

#### `JArray`

``` purescript
type JArray = Array Json
```

#### `JObject`

``` purescript
type JObject = StrMap Json
```

#### `JNull`

``` purescript
data JNull :: *
```

##### Instances
``` purescript
instance eqJNull :: Eq JNull
instance ordJNull :: Ord JNull
instance showJNull :: Show JNull
```

#### `Json`

``` purescript
data Json :: *
```

##### Instances
``` purescript
instance eqJson :: Eq Json
instance ordJson :: Ord Json
instance showJson :: Show Json
```

#### `foldJson`

``` purescript
foldJson :: forall a. (JNull -> a) -> (JBoolean -> a) -> (JNumber -> a) -> (JString -> a) -> (JArray -> a) -> (JObject -> a) -> Json -> a
```

#### `foldJsonNull`

``` purescript
foldJsonNull :: forall a. a -> (JNull -> a) -> Json -> a
```

#### `foldJsonBoolean`

``` purescript
foldJsonBoolean :: forall a. a -> (JBoolean -> a) -> Json -> a
```

#### `foldJsonNumber`

``` purescript
foldJsonNumber :: forall a. a -> (JNumber -> a) -> Json -> a
```

#### `foldJsonString`

``` purescript
foldJsonString :: forall a. a -> (JString -> a) -> Json -> a
```

#### `foldJsonArray`

``` purescript
foldJsonArray :: forall a. a -> (JArray -> a) -> Json -> a
```

#### `foldJsonObject`

``` purescript
foldJsonObject :: forall a. a -> (JObject -> a) -> Json -> a
```

#### `isNull`

``` purescript
isNull :: Json -> Boolean
```

#### `isBoolean`

``` purescript
isBoolean :: Json -> Boolean
```

#### `isNumber`

``` purescript
isNumber :: Json -> Boolean
```

#### `isString`

``` purescript
isString :: Json -> Boolean
```

#### `isArray`

``` purescript
isArray :: Json -> Boolean
```

#### `isObject`

``` purescript
isObject :: Json -> Boolean
```

#### `toNull`

``` purescript
toNull :: Json -> Maybe JNull
```

#### `toBoolean`

``` purescript
toBoolean :: Json -> Maybe JBoolean
```

#### `toNumber`

``` purescript
toNumber :: Json -> Maybe JNumber
```

#### `toString`

``` purescript
toString :: Json -> Maybe JString
```

#### `toArray`

``` purescript
toArray :: Json -> Maybe JArray
```

#### `toObject`

``` purescript
toObject :: Json -> Maybe JObject
```

#### `fromNull`

``` purescript
fromNull :: JNull -> Json
```

#### `fromBoolean`

``` purescript
fromBoolean :: JBoolean -> Json
```

#### `fromNumber`

``` purescript
fromNumber :: JNumber -> Json
```

#### `fromString`

``` purescript
fromString :: JString -> Json
```

#### `fromArray`

``` purescript
fromArray :: JArray -> Json
```

#### `fromObject`

``` purescript
fromObject :: JObject -> Json
```

#### `jsonNull`

``` purescript
jsonNull :: Json
```

#### `jsonTrue`

``` purescript
jsonTrue :: Json
```

#### `jsonFalse`

``` purescript
jsonFalse :: Json
```

#### `jsonZero`

``` purescript
jsonZero :: Json
```

#### `jsonEmptyArray`

``` purescript
jsonEmptyArray :: Json
```

#### `jsonEmptyObject`

``` purescript
jsonEmptyObject :: Json
```

#### `jsonSingletonArray`

``` purescript
jsonSingletonArray :: Json -> Json
```

#### `jsonSingletonObject`

``` purescript
jsonSingletonObject :: String -> Json -> Json
```


9 changes: 9 additions & 0 deletions docs/Data/Argonaut/Parser.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
## Module Data.Argonaut.Parser

#### `jsonParser`

``` purescript
jsonParser :: String -> Either String Json
```


15 changes: 15 additions & 0 deletions docs/Data/Argonaut/Printer.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
## Module Data.Argonaut.Printer

#### `Printer`

``` purescript
class Printer a where
printJson :: Json -> a
```

##### Instances
``` purescript
instance printerString :: Printer String
```


Loading