code | 15 Sep 22:18 2012

ANNOUNCE: adt.js (Algebraic Data Types, JavaScript library)

Hi all, I'm pleased to give you adt.js - algebraic data types for JavaScript.

* https://github.com/rehno-lindeque/adt.js (The source code & README)
* https://groups.google.com/forum/#!forum/adtjs (A place to chat)

adt.js is an unusual take on algebraic data types for JavaScript, that  
may be useful to Haskell web developers. Specifically, the adt.js  
serializer/deserializer attempts to imitate Haskell's default  
(deriving) Show and Read implementations for common data types. This  
allows you to pass data values between server-side Haskell and  
browser-side JavaScript with ease (simply apply show/read in Haskell  
and adt.serialize/adt.deserialize in JavaScript).

It differs from other attempts in that it embraces JavaScript's  
built-in types in its interfaces and makes a few less obvious design  
choices (illustrated by examples in the README).

This is more of a "I coded this and I'm finding it useful"  
announcement than an official release (or 0.0, if you will). Before  
making an official release, the idea is to dice up the library into  
multiple versions - each of which will be progressively more  
heavy-weight and implement more advanced features from the library. I  
haven't had time to implement such an advanced build system, however  
I'm already using the library for some relatively serious projects to  
be put into production at a later date.

There's also a few related libraries I'm working on (however, fair  
warning, documentation is really not great right now):

https://github.com/rehno-lindeque/adt-html.js (HTML should have been an ADT)
(Continue reading)


Gmane