💃 an applicative functor that seamlessly talks to HTML inputs
Clone or download
Latest commit 070cdc9 Jan 20, 2019
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.travis connect to CI Jan 4, 2019
app update PR Jan 14, 2019
src/Web Set "selected" attribute on selected dropdown option Jan 20, 2019
test suavemente Jan 1, 2019
.gitignore json backend Jan 4, 2019
.travis.yml remove travis for resolvers that don't work Jan 4, 2019
CONTRIBUTORS contributors Jan 20, 2019
ChangeLog.md update PR Jan 14, 2019
LICENSE suavemente Jan 1, 2019
README.md don't use FromJSON or ToMarkup Jan 12, 2019
Setup.hs suavemente Jan 1, 2019
package.yaml colorPicker, no orphans Jan 14, 2019
stack.yaml it WORKS Jan 3, 2019

README.md

suavemente

Build Status | Hackage

Dedication

Today's kitchen is all about a well-planned space that makes cooking a completely interactive experience among family and friends.

Candice Olson

Overview

Suavemente is an applicative functor capable of seamlessly talking to HTML elements. Running a suavemente program automatically spins up a webserver and hooks up its pages with websockets. The use case is to quickly deploy simple, interactive Haskell programs without needing to figure out how the fuck GHCJS works.

Example

{-# LANGUAGE ApplicativeDo #-}

module Main where

import Diagrams.Backend.SVG
import Diagrams.Prelude hiding (rad)
import Web.Suavemente
import Web.Suavemente.Diagrams


main :: IO ()
main = suavemente sendDiagram $ do
  rad <- slider "Radius" 1 10 5
  r   <- realSlider "Red" 0 1 0.05 1
  g   <- realSlider "Green" 0 1 0.05 1
  b   <- realSlider "Blue" 0 1 0.05 1
  x   <- slider "X" 0 20 10
  y   <- slider "Y" 0 20 10

  pure (
    circle rad
            # fc (sRGB r g b)
            # translate (r2 (x, y))
            # rectEnvelope (p2 (0, 0)) (r2 (20, 20))
    :: Diagram B)

Hit localhost:8080 to see it in action!