lucid alternatives and similar packages
Based on the "Web" category.
Alternatively, view lucid 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! -
scotty
Haskell web framework inspired by Ruby's Sinatra, using WAI and Warp (Official Repository) -
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. -
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. -
neuron
Future-proof note-taking and publishing based on Zettelkasten (superseded by Emanote: https://github.com/srid/emanote) -
haskell-kubernetes
Haskell bindings to the Kubernetes API (via swagger-codegen) -
apecs-gloss
a fast, extensible, type driven Haskell ECS framework for games -
tagsoup
Haskell library for parsing and extracting information from (possibly malformed) HTML/XML documents -
digestive-functors
A general way to consume input using applicative functors -
airship
Helium + Webmachine = Airship. A toolkit for building declarative, RESTful web apps. -
servant-elm
Automatically derive Elm functions to query servant webservices -
kubernetes-client-core
Haskell client for the kubernetes API. A work in progress. -
backprop
Heterogeneous automatic differentiation ("backpropagation") in Haskell -
keera-hails-reactive-htmldom
Keera Hails: Haskell on Rails - Reactive Programming Framework for Interactive Haskell applications -
engine-io
A Haskell server implementation of the Engine.IO and Socket.IO (1.0) protocols -
icepeak
Icepeak is a fast JSON document store with push notification support. -
servant-purescript
Translate servant API to purescript code, with the help of purescript-bridge.
Learn any GitHub repo in 59 seconds
* 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 lucid or a related project?
README
lucid

Clear to write, read and edit DSL for writing HTML
lucid-from-html will convert html to the lucid
DSL, though it is experimental.
Introduction
HTML terms in Lucid are written with a postfix ‘_
’ to indicate data
rather than code. Some examples:
p_
, class_
, table_
, style_
See Lucid.Html5
for a complete list of Html5 combinators.
Plain text is written using the OverloadedStrings
and
ExtendedDefaultRules
extensions, and is automatically escaped:
λ> "123 < 456" :: Html ()
123 < 456
Elements nest by function application:
λ> table_ (tr_ (td_ (p_ "Hello, World!"))) :: Html ()
<table><tr><td><p>Hello, World!</p></td></tr></table>
Elements are juxtaposed via monoidal append:
λ> p_ "hello" <> p_ "sup" :: Html ()
<p>hello</p><p>sup</p>
Or monadic sequencing:
λ> div_ (do p_ "hello"; p_ "sup") :: Html ()
<div><p>hello</p><p>sup</p></div>
Attributes are set by providing an argument list:
λ> p_ [class_ "brand"] "Lucid Inc" :: Html ()
<p class="brand">Lucid Inc</p>
Here is a fuller example of Lucid:
table_ [rows_ "2"]
(tr_ (do td_ [class_ "top",colspan_ "2",style_ "color:red"]
(p_ "Hello, attributes!")
td_ "yay!"))
<table rows="2">
<tr>
<td style="color:red" colspan="2" class="top">
<p>Hello, attributes!</p>
</td>
<td>yay!</td>
</tr>
</table>
Rendering
For proper rendering you can easily run some HTML immediately with:
λ> renderText (p_ "Hello!")
"<p>Hello!</p>"
Or to bytes:
λ> renderBS (p_ [style_ "color:red"] "Hello!")
"<p style=\"color:red\">Hello!</p>"
For ease of use in GHCi, there is a Show
instance, as
demonstrated above.
If the above rendering functions aren't suited for your purpose, you
can run the monad directly via execHtml
and use the more low-level
blaze Builder
, which has a plethora of output modes in
Blaze.ByteString.Builder.
See the documentation for the Lucid
module for information about
using it as a monad transformer.
Transforming
You can use lift
to call parent monads.
λ> runReader (renderTextT (html_ (body_ (do name <- lift ask
p_ [class_ "name"] (toHtml name)))))
("Chris" :: String)
"<html><body><p class=\"name\">Chris</p></body></html>"