Popularity
7.7
Declining
Activity
0.0
Stable
33
4
7
Monthly Downloads: 40
Programming language: Haskell
License: ISC License
Latest version: v0.3.0.2
fn alternatives and similar packages
Based on the "Web" category.
Alternatively, view fn alternatives based on common mentions on social networks and blogs.
-
servant
Main repository for the servant libraries — DSL for describing, serving, querying, mocking, documenting web applications and more! -
swagger-petstore
swagger-codegen contains a template-driven engine to generate documentation, API clients and server stubs in different languages by parsing your OpenAPI / Swagger definition. -
haskell-bitmex-rest
swagger-codegen contains a template-driven engine to generate documentation, API clients and server stubs in different languages by parsing your OpenAPI / Swagger definition. -
neuron
Future-proof note-taking and publishing based on Zettelkasten (superseded by Emanote: https://github.com/srid/emanote) -
tagsoup
Haskell library for parsing and extracting information from (possibly malformed) HTML/XML documents -
keera-hails-reactive-htmldom
Keera Hails: Haskell on Rails - Reactive Programming Framework for Interactive Haskell applications -
ghcjs-base
base library for GHCJS for JavaScript interaction and marshalling, used by higher level libraries like JSC -
ghcjs-dom
Make Document Object Model (DOM) apps that run in any browser and natively using WebKitGtk
WorkOS - The modern identity platform for B2B SaaS
The APIs are flexible and easy-to-use, supporting authentication, user identity, and complex enterprise features like SSO and SCIM provisioning.
Promo
workos.com
* Code Quality Rankings and insights are calculated and provided by Lumnify.
They vary from L1 to L5 with "L5" being the highest.
Do you think we are missing an alternative of fn or a related project?
README
Fn (eff-enn) - a functional web framework.
Or, how to do away with the monad transformers, and just use plain functions.
Example
See the example
directory for a full example, but a minimal
application is the following:
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE TemplateHaskell #-}
import Control.Lens
import Data.Monoid
import Data.Text (Text)
import qualified Data.Text as T
import Network.HTTP.Types
import Network.Wai
import Network.Wai.Handler.Warp
import qualified Network.Wai.Util as W
import Web.Fn
data Ctxt = Ctxt { _req :: Request
}
makeLenses ''Ctxt
instance RequestContext Ctxt where
requestLens = req
initializer :: IO Ctxt
initializer = return (Ctxt defaultRequest)
main :: IO ()
main = do context <- initializer
run 8000 $ toWAI context app
app :: Ctxt -> IO Response
app ctxt =
route ctxt [ end ==> index
, path "foo" // segment // path "baz" // param "id" ==> handler]
`fallthrough` notFoundText "Page not found."
index :: IO (Maybe Response)
index = okText "This is the index page! Try /foo/bar/baz?id=10"
handler :: Text -> Int -> Ctxt -> IO (Maybe Response)
handler fragment i _ = okText (fragment <> " - " <> T.pack (show i))