react-haskell-2.0.1: react-haskell.cabal
name: react-haskell
version: 2.0.1
synopsis: Haskell React bindings
description:
This package provides high level bindings to Facebook's <http://facebook.github.io/react/ React> library, meant for use with GHCJS.
.
React is a JavaScript library for building user interfaces. React (and React-Haskell) is focused on just UI - it's not a framework.
.
Currently React-Haskell can render simple stateful components, but not what React calls classes. Put another way, React-Haskell doesn't support lifecycle methods yet.
.
Here's a simple example which demonstrates basic elements, attributes, state, and handling events.
.
> page_ :: ReactNode Void
> page_ =
> let cls = smartClass
> -- this is a record and these should really be curly braces,
> -- but haddock breaks on them.
> [ name = "page"
>
> -- initially the input is empty
> , initialState = ""
>
> -- always transition to the input's new value
> , transition = \(_, value) -> (value, Nothing)
>
> , renderFn = \_ str -> div_ [ class_ "container" ] $ do
> input_ [ value_ str, onChange (Just . value . target) ]
> ]
> in classLeaf cls ()
>
> main :: IO ()
> main = do
> Just doc <- currentDocument
> Just elem <- documentGetElementById doc ("elem" :: JSString)
> render page_ elem
license: MIT
license-file: LICENSE
author: Joel Burget
maintainer: joelburget@gmail.com
category: Web
build-type: Simple
cabal-version: >=1.10
homepage: https://github.com/joelburget/react-haskell
bug-reports: https://github.com/joelburget/react-haskell/issues
data-dir: lib
data-files: stubs.js, react.js
source-repository head
type: git
location: https://github.com/joelburget/react-haskell.git
flag ghcjs
description: tell cabal we're using ghcjs
default: True
library
exposed-modules:
React,
React.DOM,
React.GHCJS,
React.Rebindable
other-modules:
React.Attrs,
React.Class,
React.Elements,
React.Events,
React.Imports,
React.Interpret,
React.Local,
React.PropTypes,
React.Registry,
React.Render,
React.Types
other-extensions:
CPP,
FlexibleInstances,
FlexibleContexts,
ForeignFunctionInterface,
GADTs,
GeneralizedNewtypeDeriving,
LambdaCase,
MultiParamTypeClasses,
NamedFieldPuns,
OverloadedStrings
build-depends:
base >= 4.5 && < 5,
transformers,
monads-tf,
deepseq,
lens-family,
void == 0.7,
aeson,
text,
unordered-containers
if flag(ghcjs)
build-depends:
ghcjs-base >= 0.1,
ghcjs-prim >= 0.1.0.0,
ghcjs-dom >= 0.1
hs-source-dirs: src
default-language: Haskell2010