BT
x Your opinion matters! Please fill in the InfoQ Survey about your reading habits!

rest: Open Source REST Framework For Haskell

by Roopesh Shenoy on Jul 07, 2014 |

Silk has recently open-sourced a REST framework for Haskell, called "rest". It provides a DSL for defining REST services which can then be run in popular web frameworks such as happstack. This comes with features such as type-safe URLs, abstraction of format-type support, and a clean separation of API specification and business logic.

rest comprises of 3 main components -

  • rest-core: A DSL for defining versioned REST resources
  • rest-gen: Automatic generation of documentation and Haskell, JavaScript and Ruby clients from a rest API
  • rest-snap, rest-happstack, rest-wai: Drivers for runnnig resources using the corresponding web server

There are several other packages such as rest-client, rest-types, json-schema, generic-aeson and so on, which are used by and can be used along with rest. You can learn more about these in detail in the announcement.

The popular Haskell web frameworks already provide support for features such as type-safe urls, routing, templating etc. The main advantage of using "rest" is that it allows separation of business logic from the API definition concerns such as routing, parsing/serializing to input/output formats and request-types supported for a particular resource. To do this, it provides various "smart" constructors that you can use to wrap your strongly-typed functions. 

Have a look at this tutorial, to learn more and get started with rest.

Hello stranger!

You need to Register an InfoQ account or or login to post comments. But there's so much more behind being registered.

Get the most out of the InfoQ experience.

Tell us what you think

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Email me replies to any of my messages in this thread
Community comments

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Email me replies to any of my messages in this thread

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Email me replies to any of my messages in this thread

Discuss

Educational Content

General Feedback
Bugs
Advertising
Editorial
InfoQ.com and all content copyright © 2006-2014 C4Media Inc. InfoQ.com hosted at Contegix, the best ISP we've ever worked with.
Privacy policy
BT