Skip to content

Commit 1d6d2ac

Browse files
committed
Initial reflex-0.4 version
0 parents  commit 1d6d2ac

File tree

6 files changed

+108
-0
lines changed

6 files changed

+108
-0
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
.stack-work

LICENSE

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
Copyright (c) 2012 Kirill Zaborsky
2+
3+
Permission is hereby granted, free of charge, to any person obtaining a copy of
4+
this software and associated documentation files (the "Software"), to deal in
5+
the Software without restriction, including without limitation the rights to
6+
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
7+
of the Software, and to permit persons to whom the Software is furnished to do
8+
so, subject to the following conditions:
9+
10+
The above copyright notice and this permission notice shall be included in all
11+
copies or substantial portions of the Software.
12+
13+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
19+
SOFTWARE.

Makefile

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
LOCAL_ROOT=$(shell stack path --local-install-root)
2+
3+
build:
4+
stack build
5+
6+
open: build
7+
xdg-open $(LOCAL_ROOT)/bin/reflex-huge-table.jsexe/index.html

reflex-huge-table.cabal

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
name: reflex-huge-table
2+
version: 0.1.0.0
3+
synopsis: test app
4+
description: testing reflex
5+
homepage: http://github.com/qrilka/reflex-huge-table
6+
license: MIT
7+
license-file: LICENSE
8+
author: Kirill Zaborsky
9+
maintainer: qrilka@gmail.com
10+
category: Web
11+
build-type: Simple
12+
cabal-version: >=1.10
13+
14+
executable reflex-huge-table
15+
hs-source-dirs: src
16+
main-is: Main.hs
17+
default-language: Haskell2010
18+
ghc-options: -Wall -Werror -dedupe
19+
20+
build-depends: base
21+
, reflex
22+
, reflex-dom
23+
, string-class
24+
, text

src/Main.hs

+33
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
{-# LANGUAGE OverloadedStrings #-}
2+
{-# LANGUAGE RecordWildCards #-}
3+
module Main where
4+
5+
import Control.Monad
6+
import Data.String.Class
7+
import Data.Text (Text)
8+
import Reflex
9+
import Reflex.Dom
10+
11+
main :: IO ()
12+
main =
13+
mainWidget $ do
14+
clicked <- button "Go"
15+
void . widgetHold blank $ ffor clicked $ \_ -> do
16+
let colNames = ["a","b","c","d"]
17+
elClass "table" "table" $ do
18+
el "thead" . el "tr" $ forM_ colNames $ \n ->
19+
el "th" (text n)
20+
el "tbody" . forM_ table $ \Entry{..} -> do
21+
let cells = [toString a, toString b, show c, show d]
22+
el "tr" . forM_ cells $ \cell -> do
23+
el "td" (text cell)
24+
25+
data Entry = Entry
26+
{ a :: Text
27+
, b :: Text
28+
, c :: Double
29+
, d :: Int
30+
}
31+
32+
table :: [Entry]
33+
table = replicate 1000 Entry {a = "Some", b = "Text here", c = 1.23, d = 424242}

stack.yaml

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
resolver: lts-7.3
2+
compiler: ghcjs-0.2.1.9007003_ghc-8.0.1
3+
4+
setup-info:
5+
ghcjs:
6+
source:
7+
ghcjs-0.2.1.9007003_ghc-8.0.1:
8+
url: http://ghcjs.tolysz.org/ghc-8.0-2016-10-11-lts-7.3-9007003.tar.gz
9+
sha1: 3196fd5eaed670416083cf3678396d02c50096de
10+
11+
packages:
12+
- '.'
13+
- location:
14+
git: git@github.com:reflex-frp/reflex.git
15+
commit: 312b1905557671ae223813e7430ab07d2b65d0f7
16+
- location:
17+
git: git@github.com:qrilka/reflex-dom.git
18+
commit: ad83d0b6b1e3388713f8ae31a8efd2542ea372f9
19+
20+
extra-deps:
21+
- ghcjs-dom-0.2.4.0
22+
- ref-tf-0.4.0.1
23+
- data-default-0.6.0
24+
- data-default-instances-base-0.1.0.1

0 commit comments

Comments
 (0)