| CARVIEW |
nero: Lens-based HTTP toolkit
This package provides the core functionality of the Nero HTTP toolkit.
Check the README for a more detailed explanation.
[Skip to Readme]
Modules
[Index]
Downloads
- nero-0.3.1.tar.gz [browse] (Cabal source package)
- Package description (as included in the package)
Maintainer's Corner
For package maintainers and hackage trustees
Candidates
| Versions [RSS] | 0.1, 0.1.1, 0.2, 0.3, 0.3.1 |
|---|---|
| Change log | CHANGELOG.md |
| Dependencies | base (>=4.6 && <4.9), bifunctors (>=4.1.1.1), bytestring (>=0.10.0.2), containers (>=0.5.0.0), lens (>=4.1.2.1), text (>=0.11.3.1) [details] |
| Tested with | ghc ==7.6.4, ghc ==7.8.4, ghc ==7.10.1 |
| License | BSD-3-Clause |
| Copyright | Copyright (C) 2015 J. Daniel Navarro |
| Author | Danny Navarro |
| Maintainer | Danny Navarro <j@dannynavarro.net> |
| Uploaded | by jdnavarro at 2015-04-16T09:58:50Z |
| Category | Web |
| Home page | https://github.com/plutonbrb/nero |
| Bug tracker | https://github.com/plutonbrb/nero/issues |
| Source repo | head: git clone git://github.com/plutonbrb/nero.git |
| Distributions | |
| Reverse Dependencies | 3 direct, 0 indirect [details] |
| Downloads | 3267 total (20 in the last 30 days) |
| Rating | (no votes yet) [estimated by Bayesian average] |
| Your Rating |
|
| Status | Docs uploaded by user Build status unknown [no reports yet] |
Readme for nero-0.3.1
[back to package description]Nero
A
Lens-based HTTP toolkit.
⚠️ The following is a declaration of intentions. Expect wild
changes in the API until the 1.0.0 release.
-
Not a framework: it may be considered an anti-framework, micro-framework, or just a "library", in the sense that it provides a set of utilities for building custom web applications instead of creating applications from user provided code following certain structure.
-
Pay for what you eat: instead of coming with everything and the kitchen sink, it provides the bare minimum to write applications with minimum implicit behavior. At the same time, it offers diverse paths to grow with you as applications become more complex.
-
Unopinonated: there is no preferred routing method, HTML templating library, session management, web server or database adapter. It comes with some defaults to alleviate the paradox of choice, but most components are expected to be easily swapped in and out either with plain 3rd party Haskell libraries or by writing thin adapters around them.
-
Power of Haskell and
Lens: theLens-based API enables a style familiar to imperative programmersLenswhile being purely functional under the hood. Veteran Haskellers can take advantage of the powerful lens combinators.
Example
{-# LANGUAGE OverloadedStrings #-}
import Nero.Prelude
import Nero (Request, Response, _GET, prefixed, ok)
import Nero.Warp (serve) -- from `nero-warp`
app :: Request -> Maybe Response
app request = request ^? _GET . prefixed "/hello/" <&> \name ->
ok $ "<h1>Hello " <> name <> "</h1>"
main :: IO ()
main = serve 8080 app
More examples in the examples directory.