Twinside / ClosureExternalProducer

Haskell module to help writing closure compiler type definition, from one type definition, provide export and ToJSON instance

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Closure External Producer

Typing all the way down.

When creating a web service using Json message, it is useful to use the "Google Closure Compiler" to validate the client side javascript. Type verification in the closure compiler require type definitions known as externs.

When coding in haskell, all the types are already there, so let's try to use the compiler to provide the type definitions for us, or at least, help us in this task.

Serialization

The Aeson library provide an useful typeclass to serialize to JSON data. The ideal solution is to provide one description for the typing and the serialization.

The trick is that the typing language is richer than the serializable one, for instance JSON cannot serialize function nor tuples, thus need to be excluded of serialization capability.

About

Haskell module to help writing closure compiler type definition, from one type definition, provide export and ToJSON instance

License:BSD 3-Clause "New" or "Revised" License


Languages

Language:Haskell 100.0%