All Projects → positiondev → fn

positiondev / fn

Licence: other
A functional web framework

Programming Languages

haskell
3896 projects

Projects that are alternatives of or similar to fn

Falco
A functional-first toolkit for building brilliant ASP.NET Core applications using F#.
Stars: ✭ 214 (+529.41%)
Mutual labels:  functional, web-framework
Farwest
Framework for building RESTful HATEOAS-driven applications.
Stars: ✭ 18 (-47.06%)
Mutual labels:  functional, web-framework
Cowboy
Small, fast, modern HTTP server for Erlang/OTP.
Stars: ✭ 6,533 (+19114.71%)
Mutual labels:  functional, web-framework
Spirit
Modern modular library for building web applications
Stars: ✭ 241 (+608.82%)
Mutual labels:  functional, web-framework
sublime-coconut
Coconut syntax highlighting for Sublime Text and VSCode.
Stars: ✭ 18 (-47.06%)
Mutual labels:  functional
typed-prelude
Reliable, standards-oriented software for browsers & Node.
Stars: ✭ 48 (+41.18%)
Mutual labels:  functional
inject
A web framework inspired by spring boot, base on echo framework and dependency injection
Stars: ✭ 17 (-50%)
Mutual labels:  web-framework
lunala
💎│ The official Lunala's source code! Yet a modern space exploration bot.
Stars: ✭ 24 (-29.41%)
Mutual labels:  functional
geronimo-specs
Mirror of Apache Geronimo specs
Stars: ✭ 20 (-41.18%)
Mutual labels:  web-framework
swift-di-explorations
Functional DI explorations in Swift
Stars: ✭ 28 (-17.65%)
Mutual labels:  functional
justuse
Just use() code from anywhere - a functional import alternative with advanced features like inline version checks, autoreload, module globals injection before import and more.
Stars: ✭ 49 (+44.12%)
Mutual labels:  functional
ParsecSharp
The faster monadic parser combinator library for C#
Stars: ✭ 23 (-32.35%)
Mutual labels:  functional
ekzo
💫 Functional Sass framework for rapid and painless development
Stars: ✭ 32 (-5.88%)
Mutual labels:  functional
tush
No description or website provided.
Stars: ✭ 23 (-32.35%)
Mutual labels:  functional
futils
Utilities for generic functional programming
Stars: ✭ 21 (-38.24%)
Mutual labels:  functional
pen
The parallel, concurrent, and functional programming language for scalable software development
Stars: ✭ 394 (+1058.82%)
Mutual labels:  functional
ninglex
Easy to learn, quick and dirty, bare-bones web framework for Common Lisp
Stars: ✭ 31 (-8.82%)
Mutual labels:  web-framework
pipe
Pipe operator for nim.
Stars: ✭ 51 (+50%)
Mutual labels:  functional
php-validation-dsl
A DSL for validating data in a functional fashion
Stars: ✭ 47 (+38.24%)
Mutual labels:  functional
pyfuncol
Functional collections extension functions for Python
Stars: ✭ 32 (-5.88%)
Mutual labels:  functional

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))
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].