BT

New Early adopter or innovator? InfoQ has been working on some new features for you. Learn more

rest: Open Source REST Framework For Haskell

| by Roopesh Shenoy on Jul 07, 2014. Estimated reading time: 1 minute |

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.

Rate this Article

Adoption Stage
Style

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

Login to InfoQ to interact with what matters most to you.


Recover your password...

Follow

Follow your favorite topics and editors

Quick overview of most important highlights in the industry and on the site.

Like

More signal, less noise

Build your own feed by choosing topics you want to read about and editors you want to hear from.

Notifications

Stay up-to-date

Set up your notifications and don't miss out on content that matters to you

BT