Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 81 lines (57 sloc) 1.705 kB
e94b997 @bergmark Initial commit. Functioning!
bergmark authored
1 Snaplet Fay
2 ===========
3
4 Snaplet Fay integrates [Snap](http://www.snapframework.com) with
5 [Fay](http://www.fay-lang.org). Snap is a
6 [Haskell](http://www.haskell.org) web framework and Fay is a compiler
9e94ef4 @bergmark minor README edit
bergmark authored
7 from a proper subset of Haskell to JavaScript. Snaplet Fay integrates
e94b997 @bergmark Initial commit. Functioning!
bergmark authored
8 them nicely with each other allowing automatic (re)compilation of Fay
9 source files. Snap provides this for both static content and haskell
10 sources preventing web server restarts and here we add Fay to this
63dbbdb @bergmark * Updated README
bergmark authored
11 list as well. This lets us write both front and back-end code in Haskell.
12
e94b997 @bergmark Initial commit. Functioning!
bergmark authored
13
14 Installation
15 ------------
16
17 You will need Haskell, Snap and Fay installed. The simplest way to get
18 up and running with Haskell is to install
19 [The Haskell Platform](http://hackage.haskell.org/platform/).
20
63dbbdb @bergmark * Updated README
bergmark authored
21 Snap and Fay are available on hackage, but use chrisdone's master for now:
e94b997 @bergmark Initial commit. Functioning!
bergmark authored
22
23 ```
63dbbdb @bergmark * Updated README
bergmark authored
24 cabal install snap
27bd343 @bergmark new fay repository location
bergmark authored
25 git clone https://github.com/faylang/fay.git && cd fay && cabal install
e94b997 @bergmark Initial commit. Functioning!
bergmark authored
26 ```
27
28 Clone this repository and install the package:
29 ```
30 cabal install
31 ````
32
559dae6 @bergmark Updated README with Example usage
bergmark authored
33 Example Usage
34 -------------
35
36 Site.hs:
37 ```
9e94ef4 @bergmark minor README edit
bergmark authored
38 import Snap.Snaplet.Fay
559dae6 @bergmark Updated README with Example usage
bergmark authored
39
40 app :: SnapletInit App App
77dd6f9 @bergmark Using snaplet configs
bergmark authored
41 app = makeSnaplet "app" "A snaplet example application." Nothing $ do
42 fay' <- nestSnaplet "fay" fay initFay
559dae6 @bergmark Updated README with Example usage
bergmark authored
43 return $ App { _fay = fay' }
44 ```
45
46 Application.hs:
47 ```
48 import Snap.Snaplet.Fay
49
50 data App = App { _fay :: Snaplet Fay }
51
52 makeLens ''App
53 ```
54
55
e94b997 @bergmark Initial commit. Functioning!
bergmark authored
56 Development Status
57 ------------------
58
f60be42 @bergmark Minor README typo
bergmark authored
59 Snaplet Fay is functioning and will be updated to keep up with
e94b997 @bergmark Initial commit. Functioning!
bergmark authored
60 both Snap and Fay.
61
62
63 Contributions
64 -----------
65
66 Fork on!
67
68 Any enhancements are welcome.
69
70 To run the tests, do:
71 ```
72 cabal configure -ftest
73 cabal build
74 ./dist/build/test/test
75 ```
63dbbdb @bergmark * Updated README
bergmark authored
76
77 Contact
78 -------
79
80 File an issue, e-mail or visit `#fay @ irc.freenode.net`.
Something went wrong with that request. Please try again.