hl/README.md

80 lines
1.7 KiB
Markdown
Raw Normal View History

2014-03-01 18:51:02 +00:00
haskell-lang
=====
Haskell web site.
2014-05-27 15:53:23 +00:00
2014-05-27 15:59:14 +00:00
## Building
2014-05-27 15:53:23 +00:00
Clone the repo:
$ git clone git@github.com:chrisdone/hl.git
2014-05-27 16:17:32 +00:00
You need one of these GHC versions:
2014-05-27 16:10:52 +00:00
2014-05-27 16:17:32 +00:00
* GHC 7.6
* GHC 7.8
2014-05-27 16:10:52 +00:00
2014-05-27 16:09:29 +00:00
Create an [hsenv](http://hackage.haskell.org/package/hsenv):
2014-05-27 15:53:23 +00:00
$ cd hl
$ hsenv
$ source .hsenv/bin/activate
2014-05-27 16:17:32 +00:00
You need the right package set. Add the following to your
`.hsenv/cabal/config`, replacing the Hackage reference:
2014-05-27 15:53:23 +00:00
2014-05-27 16:17:32 +00:00
* If you have GHC 7.6:
2014-05-27 15:53:23 +00:00
2014-05-27 16:17:32 +00:00
remote-repo: stackage:http://www.stackage.org/stackage/1ba546f8f281c02d135ec3babd86516f726b4453
* If you have GHC 7.8:
2014-05-27 15:53:23 +00:00
2014-05-27 16:17:32 +00:00
remote-repo: stackage:http://www.stackage.org/stackage/160b97ce7459820d4de720d6a867b85297ab4351
2014-05-27 15:53:23 +00:00
2014-05-27 16:17:32 +00:00
Now just run:
2014-05-27 16:04:35 +00:00
$ sh scripts/pull-build
To do the above cabal update, submodule, install, etc.
2014-05-27 15:53:23 +00:00
Done!
## Running
It runs at: http://localhost:1990/
Manually running the binary:
$ dist/build/hl/hl
Running from inside GHCi:
> :l DevelMain
> DevelMain.update
2014-05-27 16:28:14 +00:00
Run this every time you want to update the web handler in-place, as in
[this demo](https://github.com/chrisdone/ghci-reload-demo).
2014-05-27 15:53:23 +00:00
If you use Emacs, you can just bind it to a key:
``` lisp
2014-05-28 02:01:58 +00:00
(define-key html-mode-map [f12] 'haskell-process-reload-devel-main)
2014-05-27 15:53:23 +00:00
```
Just hit f12 to recompile and restart.
2014-05-27 15:56:16 +00:00
## Architecture
It uses Yesod and an MVC organization.
* HL.M.* -- [models](https://github.com/chrisdone/hl/tree/master/src/HL/M)
* HL.V.* -- [views](https://github.com/chrisdone/hl/tree/master/src/HL/V)
* HL.C.* -- [controllers](https://github.com/chrisdone/hl/tree/master/src/HL/C)
Templates are written in [senza](https://github.com/chrisdone/senza),
a convenience wrapper to blaze-html. There is presently no database.
2014-05-27 15:59:14 +00:00
## Style
I use [this style](https://github.com/chrisdone/haskell-style-guide)
for code.