miso: A tasty Haskell front-end framework

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

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]
Versions [faq] 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
Dependencies aeson, base (<5), 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 Wed Jun 28 02:50:29 UTC 2017
Distributions LTSHaskell:0.21.2.0, NixOS:0.21.2.0, Stackage:0.21.2.0
Executables tests, simple, mario, todo-mvc
Downloads 8645 total (710 in the last 30 days)
Rating 2.0 (votes: 1) [estimated by rule of succession]
Your Rating
  • λ
  • λ
  • λ
Status Hackage Matrix CI
Docs available [build log]
Last success reported on 2017-06-28 [all 1 reports]

Modules

[Index]

Flags

NameDescriptionDefaultType
examples

Builds Miso's examples

DisabledAutomatic
tests

Builds Miso's tests

DisabledAutomatic

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

Downloads

Maintainer's Corner

For package maintainers and hackage trustees


Readme for miso-0.1.0.2

[back to package description]

:ramen: miso

Hackage Haskell Programming Language BSD3 License <a href="https://www.irccloud.com/invite?channel=%23haskell-miso&amp;hostname=irc.freenode.net&amp;port=6697&amp;ssl=1" target="_blank"><img src="https://img.shields.io/badge/IRC-%23haskell--miso-1e72ff.svg?style=flat" height="20"></a> Slack Status Build Status

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

Documentation

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 "-" ]
 ]
 ```