Projects
positiondev/fn has 34 GitHub stars and 7 forks. GitHot measured 0 stars in 24 hours. Last checked 2026-11-15 17:53 UTC. Last push 2022-01-22.
Measured star growth
- in 24h
- 0
- in 7 days
- Collecting history
- in 15 days
- Collecting history
- in 1 month
- Collecting history
Net star changes over overlapping periods, not daily totals. Missing measurements are left blank. Stars measure attention, not software quality.
About
A functional web framework
Web & AppsREADME.md
OriginalFn (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))