typed-wire: Language-independent type-safe communication

[ library, mit, program, web ] [ Propose Tags ]

Please see README.md

[Skip to Readme]


Maintainer's Corner

Package maintainers

For package maintainers and hackage trustees


  • No Candidates
Versions [RSS],,,,,,,,
Dependencies base (>=4.7 && <5), containers (>=0.5), directory (>=1.2), filepath (>=1.4), gitrev (>=1.1), http-types (>=0.8.6), mtl (>=2.2), optparse-applicative, parsec (>=3.1), text (>=1.2), typed-wire [details]
License MIT
Copyright (c) 2015 - 2016 Alexander Thiemann <mail@athiemann.net>
Author Alexander Thiemann <mail@athiemann.net>
Maintainer Alexander Thiemann <mail@athiemann.net>
Category Web
Home page http://github.com/typed-wire/typed-wire#readme
Source repo head: git clone https://github.com/typed-wire/typed-wire
Uploaded by AlexanderThiemann at 2016-06-14T22:48:24Z
Executables twirec
Downloads 4892 total (6 in the last 30 days)
Rating (no votes yet) [estimated by Bayesian average]
Your Rating
  • λ
  • λ
  • λ
Status Docs available [build log]
Last success reported on 2016-06-14 [all 1 reports]

Readme for typed-wire-

[back to package description]


Build Status Hackage


Hackage: typed-wire Stackage: typed-wire

Language independent type-safe communication

Motivation / WIP Notice

Here are some details on the library:

  • I wrote this because I have more and more micro-service architectures. The simplest form is a Haskell (REST-Api) Backend talking with an Elm/Purescript/... frontend. I got really tired of defining all data types in Haskell, Elm, PureScript, ... and writing JSON parsing/serialization functions for them in all languages. typed-wire attempts to solve this/my problem: It generates type definitions and matching JSON parsing/serialization for all target languages from a definition file. It can also generate API definitions, but this feature is not finished yet.
  • It's not ready yet - it is still missing some planned features, testing and documentation
  • It's used in production at one of my projects to ensure DRY type-safe communication between an Elm client and a Haskell server (www.bahn-buddy.de , german)
  • If anyone thinks this is cool, needs it too and would like to help out please shoot me an email :-)

Cli Usage: twirec

$ twirec --help
Generate bindings using typed-wire for different languages

Usage: twirec [--version] [-i|--include-dir DIR] [-e|--entrypoint MODULE-NAME]
              [--hs-out DIR] [--elm-out DIR] [--purescript-out DIR]
  Language-independent type-safe communication

Available options:
  -h,--help                Show this help text
  --version                Show version and exit
  -i,--include-dir DIR     Directory to search for modules
  -e,--entrypoint MODULE-NAME
                           Entrypoint for compiler
  --hs-out DIR             Generate Haskell bindings to specified dir
  --elm-out DIR            Generate Elm bindings to specified dir
  --purescript-out DIR     Generate PureScript bindings to specified dir


  • Using cabal: cabal install typed-wire
  • Using Stack: stack install typed-wire
  • From Source (cabal): git clone https://github.com/typed-wire/typed-wire.git && cd typed-wire && cabal install
  • From Source (stack): git clone https://github.com/typed-wire/typed-wire.git && cd typed-wire && stack build


Supported GHC Versions

  • 7.10.2


Released under the MIT license. (c) 2015 - 2016 Alexander Thiemann mail@athiemann.net