The bird package

[Tags: bsd3, library, program]

Bird is a hack-compatible framework for simple websites.


[Skip to ReadMe]

Properties

Versions0.0.1, 0.0.2, 0.0.3, 0.0.6, 0.0.7, 0.0.8, 0.0.9, 0.0.10, 0.0.11, 0.0.12, 0.0.13, 0.0.14, 0.0.15, 0.0.16, 0.0.17, 0.0.18, 0.0.19
Change logNone available
Dependenciesbase (>=4.0 && <5), bytestring, containers, data-default (>=0.2), hack (>=2009.10.30), hack-handler-happstack, haskell98, parsec (>=2.1.0.1), process, rallod [details]
LicenseBSD3
AuthorParker, Matt
MaintainerParker, Matt <moonmaster9000@gmail.com>
CategoryWeb
Home pagehttp://github.com/moonmaster9000/bird
Executablesbird
UploadedSat Jul 3 13:24:27 UTC 2010 by MattParker
Downloads2522 total (145 in last 30 days)
Votes
0 []
StatusDocs uploaded by user
Build status unknown [no reports yet]

Modules

[Index]

Downloads

Maintainers' corner

For package maintainers and hackage trustees

Readme for bird-0.0.6

Bird

A sinatra-ish web framework written in haskell, riding on top of Hack.

Why?

Sinatra has a beautiful, simple, elegant syntax, but it's essentially an attempt to bring pattern matching to a language never intended for pattern matching. Why not attempt something similar in a language with not just beautiful pattern matching, but with all the declarative bells and whistles: lazy evaluation, first-class functions, currying, polymorphism?

Install

λ cabal update && cabal install bird

Note: make sure $HOME/.cabal/bin is in your PATH.

Create an app

λ bird MyApp 

Compile your app

λ cd MyApp
λ bird nest 

Start your app (runs on port 3000)

λ bird fly

Try it out

λ curl http://localhost:3000
  404 Not Found

Improvise!

-- MyApp.hs
module MyApp where
import Bird
import Data.String.Utils

get, post, put, delete :: Request -> IO Reply
get Request { path = ("howdy":xs) } 
  = ok $ "Howdy " ++ (join ", " xs) ++ "!"

get _ = return notFound_
post _ = return notFound_
put _ = return notFound_
delete _ = return notFound_

now:

λ curl http://localhost:3000/howdy/there/pardna
    Howdy there, pardna!

Notes

This project is still in its infancy. Coming features: