mirror of
https://github.com/ilyakooo0/elm-bridge.git
synced 2024-09-11 14:05:55 +03:00
add readme
This commit is contained in:
parent
dc3438c1a9
commit
a6956da995
55
README.md
Normal file
55
README.md
Normal file
@ -0,0 +1,55 @@
|
||||
Elm Bridge
|
||||
=====
|
||||
|
||||
[![Build Status](https://travis-ci.org/agrafix/elm-bridge.svg)](https://travis-ci.org/agrafix/elm-bridge)
|
||||
|
||||
[![Hackage Deps](https://img.shields.io/hackage-deps/v/elm-bridge.svg)](http://packdeps.haskellers.com/reverse/elm-bridge)
|
||||
|
||||
## Intro
|
||||
|
||||
Hackage: [elm-bridge](http://hackage.haskell.org/package/elm-bridge)
|
||||
|
||||
**WARNING: Work in progress!**
|
||||
|
||||
Building the bridge from [Haskell](http://haskell.org) to [Elm](http://elm-lang.org) and back. Define types once, use on both sides and enjoy easy (de)serialisation. Cheers!
|
||||
|
||||
## Usage
|
||||
|
||||
```haskell
|
||||
{-# LANGUAGE TemplateHaskell #-}
|
||||
import Elm.Derive
|
||||
import Elm.TyRender
|
||||
import Elm.TyRep
|
||||
|
||||
import Data.Proxy
|
||||
|
||||
data Foo
|
||||
= Foo
|
||||
{ f_name :: String
|
||||
, f_blablub :: Int
|
||||
} deriving (Show, Eq)
|
||||
|
||||
main :: IO ()
|
||||
main =
|
||||
putStrLn $ renderElm $ compileElmDef (Proxy :: Proxy Foo)
|
||||
```
|
||||
|
||||
Output will be:
|
||||
|
||||
```elm
|
||||
type alias Foo =
|
||||
{ f_name: String
|
||||
, f_blablub: Int
|
||||
}
|
||||
```
|
||||
|
||||
For more usage examples check the tests.
|
||||
|
||||
## Install
|
||||
|
||||
* Using cabal: `cabal install elm-bridge`
|
||||
* From Source: `git clone https://github.com/agrafix/elm-bridge.git && cd elm-bridge && cabal install`
|
||||
|
||||
## Todo
|
||||
|
||||
* Generate Elm JSON Serializer/Parser
|
@ -2,7 +2,7 @@ name: elm-bridge
|
||||
version: 0.1.0.0
|
||||
synopsis: Derive Elm types from Haskell types
|
||||
description: Building the bridge from Haskell to Elm and back. Define types once,
|
||||
use on both sides and enjoy free (de)serialisation. Cheers!
|
||||
use on both sides and enjoy easy (de)serialisation. Cheers!
|
||||
homepage: http://github.com/agrafix/derive-elm
|
||||
license: BSD3
|
||||
license-file: LICENSE
|
||||
|
Loading…
Reference in New Issue
Block a user