forked from joelburget/react-haskell
-
Notifications
You must be signed in to change notification settings - Fork 0
/
react-haskell.cabal
91 lines (86 loc) · 2.62 KB
/
react-haskell.cabal
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
name: react-haskell
version: 1.3.0.0
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 <http://haste-lang.org Haste>.
.
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.
.
> -- We're creating a class with JSString state
> data Example
> instance ReactKey Example where
> type ClassState Example = JSString
> type AnimationState Example = ()
> type Signal Example = JSString
>
> -- updating to the new state without animation
> transition :: JSString -> JSString -> (JSString, [AnimConfig Example])
> transition oldState signal = (signal, [])
>
> view :: JSString -> React Example ()
> view str = div_ [ class_ "container" ] $ do
> input_ [ value_ str, onChange (Just . targetValue) ]
>
> main :: IO ()
> main = withElem "id" $ \elem ->
> render elem =<< createClass view transition "" () []
license: MIT
license-file: LICENSE
author: Joel Burget
maintainer: [email protected]
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, bezier.js
flag haste-inst
description: Built with haste-inst/hastec
default: False
source-repository head
type: git
location: https://github.com/joelburget/react-haskell.git
library
exposed-modules: React
other-modules:
React.Anim,
React.Attrs,
React.Class,
React.Elements,
React.Events,
React.Imports,
React.Interpret,
React.Local,
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
if flag(haste-inst)
build-depends:
haste-lib >= 0.4 && <0.6
else
build-depends:
haste-compiler
hs-source-dirs: src
default-language: Haskell2010