miso: A tasty Haskell front-end framework

[ bsd3, data-structures, library, miso, web ] [ Propose Tags ] [ Report a vulnerability ]

Miso is a small isomorphic Haskell front-end framework featuring a virtual-dom, diffing / patching algorithm, event delegation, event batching, SVG, Server-sent events, Websockets, and an extensible Subscription-based subsystem. Inspired by Elm, Redux and Bobril. IO and other effects (like XHR) can be introduced into the system via the Effect data type. Miso makes heavy use of the GHCJS FFI and therefore has minimal dependencies.


[Skip to Readme]

Modules

[Index]

Flags

Automatic Flags
NameDescriptionDefault
examples

Builds Miso's examples

Disabled
tests

Builds Miso's tests

Disabled

Use -f <flag> to enable a flag, or -f -<flag> to disable that flag. More info

Downloads

Maintainer's Corner

Package maintainers

For package maintainers and hackage trustees

Candidates

Versions [RSS] 0.1.0.0, 0.1.0.1, 0.1.0.2, 0.1.0.3, 0.1.0.4, 0.1.1.0, 0.1.2.0, 0.1.3.0, 0.1.4.0, 0.1.5.0, 0.2.0.0, 0.2.1.0, 0.3.0.0, 0.4.0.0, 0.5.0.0, 0.6.0.0, 0.7.0.0, 0.7.1.0, 0.7.2.0, 0.7.3.0, 0.7.4.0, 0.7.5.0, 0.7.6.0, 0.7.7.0, 0.7.8.0, 0.8.0.0, 0.9.0.0, 0.10.0.0, 0.11.0.0, 0.12.0.0, 0.13.0.0, 0.14.0.0, 0.15.0.0, 0.16.0.0, 0.17.0.0, 0.18.0.0, 0.19.0.0, 0.20.0.0, 0.20.1.0, 0.21.0.0, 0.21.1.0, 0.21.2.0, 1.0.0.0, 1.1.0.0, 1.2.0.0, 1.3.0.0, 1.4.0.0, 1.5.0.0, 1.5.1.0, 1.5.2.0, 1.6.0.0, 1.7.0.0, 1.7.1.0, 1.8.0.0, 1.8.1.0, 1.8.2.0, 1.8.3.0, 1.8.4.0, 1.8.5.0
Dependencies aeson, base (<5), BoundedChan, bytestring, containers, ghcjs-base, hspec, hspec-core, http-api-data, http-types, lucid, miso, network-uri, scientific, servant, text, transformers, unordered-containers, vector [details]
License BSD-3-Clause
Copyright Copyright (c) 2017 David M. Johnson
Author David M. Johnson <djohnson.m@gmail.com>
Maintainer David M. Johnson <djohnson.m@gmail.com>
Category Web, Miso, Data Structures
Home page http://github.com/dmjio/miso
Source repo head: git clone https://github.com/dmjio/miso.git
Uploaded by DavidJohnson at 2017-07-10T05:09:11Z
Distributions LTSHaskell:1.8.5.0, NixOS:1.8.4.0, Stackage:1.8.5.0
Reverse Dependencies 5 direct, 0 indirect [details]
Executables tests, simple, mario, websocket, todo-mvc
Downloads 34560 total (104 in the last 30 days)
Rating 2.25 (votes: 2) [estimated by Bayesian average]
Your Rating
  • λ
  • λ
  • λ
Status Docs available [build log]
Last success reported on 2017-07-10 [all 1 reports]

Readme for miso-0.1.4.0

[back to package description]

miso

A tasty Haskell front-end framework

Miso Slack Hackage Haskell Hackage LICENSE Miso Hydra IRC #haskell-miso

Miso is a small "isomorphic" Haskell front-end framework featuring a virtual-dom, diffing / patching algorithm, event delegation, event batching, SVG, Server-sent events, Websockets, and an extensible Subscription-based subsystem. Inspired by Elm, Redux and Bobril. IO and other effects (like XHR) can be introduced into the system via the Effect data type. Miso makes heavy use of the GHCJS FFI and therefore has minimal dependencies.

Examples

Haddocks

Getting Started

{-# LANGUAGE RecordWildCards #-}

module Main where

import Miso

type Model = Int

main :: IO ()
main = startApp App {..}
  where
    model  = 0
    update = updateModel
    view   = viewModel
    events = defaultEvents
    subs   = []

updateModel :: Action -> Model -> Effect Model Action
updateModel AddOne m = noEff (m + 1)
updateModel SubtractOne m = noEff (m - 1)

data Action
  = AddOne
  | SubtractOne
  deriving (Show, Eq)

viewModel :: Model -> View Action
viewModel x = div_ [] [
   button_ [ onClick AddOne ] [ text "+" ]
 , text (show x)
 , button_ [ onClick SubtractOne ] [ text "-" ]
 ]