Hello! It is I, your editor Jeremy Shaw. I am pleased to bring you Happstack Irregular News Issue #2. Some exciting things have happened since the last issue!
The biggest news since the last issue is the release of clckwrks:
clckwrks is a Haskell-based blog and CMS framework with support for editing pages via the browser plus downloadable themes and plugins.
clckwrks is now powering happstack.com and clckwrks.com.
We are currently focusing on making the clckwrks blogging portion solid. We have moved the official Happstack blog to clckwrks in order to encourage us to make it better :)
If you want to help out, you can browse our bug list and find something to take action on. We are more than happy to provide guidance and other assistance.
The other new big release was
reform is a form
generation library that continues in the footsteps of
digestive-functors <= 0.2.
digestive-functors 0.3 has gone off to
explore a different direction, and we wanted to continue pushing the
development in this direction. There are still many ideas we can share
between the two libraries. Two changes we want to make in the next
Bifunctors package instead of homebrewed
IndexedApplicative (thanks to Leonid Onokhov for pointing that
out). (Another alternative might be
index-core, though it does not
yet export the
consider using a
Free Applicative /
Operational Applicative for
reform applicative instances.
0.3 does something like this and Jasper Van der Jeugt said it was
very beneficial and we should try it in
reform as well.
Dag Odenhall has released
happstack-yui, which makes it easy to use
YUI with Happstack. According the YUI website:
Niklas Broberg and I (Jeremy Shaw) did some work on HSX. It now builds
with GHC 7.4 and we also fixed some hidden bugs in
HSX.Transform. One thing we have been experimenting with is a
QuasiQuoter for HSX. A demo version can be found here:
darcs get http://src.seereason.com/hsx-qq/
The QQ provides an alternative to the
trhsx preprocessor and
allows you to write things like:
html :: (XMLGenerator m) => XMLGenT m (XMLType m) html = [hsx| <p class="foo"><% map toUpper "hello, world!" %></p> |]
This should be included in the next release of HSX.
The next release of HSX will also contain a major refactoring of the
packages. Mostly we are just planning to move modules into different
packages and divide things up differently. One major benefit of the
new arrangement is that you will no longer be required to install
HJScript even though you probably never use them.
changed types in
happstack-lite so that
work better together, and added
happstack-jmacro to work with older versions of
ixset.cabal so that it does not require the latest
Cabal to build
I have started research into why hackage2 requires so much RAM to run. I will be blogging about that separately. I do expect that we can substantially reduce that amount of RAM it requires. So far I have uncovered two minor issues:
it turns out that
mapM Lazy.readFile fileList returns the file
contents lazily but opens all the files immediately. This means you
can run out of file descriptors if you have a lot of checkpoints or
event files. A patch has been submitted for
acid-state and it will
be fixed in the next release.
acid-state reads the entire checkpoint file into RAM before
decoding it. There are a couple places in the code that cause this to
happen. The first place is in
function does return a lazy
ByteString.. but it does it by first
reading a strict
ByteString of the required length and then
converting it into a lazy
ByteString. Changing the behavior of
getLazyByteString is actually quite difficult, as
designed to allow for value-level error handling, instead of throwing
We can probably work around this by using
runGetState to get
one-chunk at a time and build the lazy
ByteString that way. That
might actually be a lot less hackish than it sounds at first, because
it allows us to explicity detect and handle failure cases and control
how much and when things are read into RAM. Though, at that point, it
starts to feel a bit like enumerators/iteratee/etc. Perhaps we will
pipes at some point in time.
pipes provides streaming for
pure (non-IO) values -- which is probably what we want here.
Evan Czaplicki has been doing a ton of work on ELM recently. As described on the ELM Language Homepage:
It is easy to use ELM with Happstack -- no special support is
required. (i.e., we do not need
happstack-elm). Vincent Ambo has
created a simple demo here:
Vincent also wrote a nice blog post showing how to combine
(type-safe URL routing) with
QuasiQuoter for generating
blaze-html from HTML-like syntax):
when it comes to generating CSS. The
library already contains combinators and a syntax ADT for CSS3.
If it had a parser, then we could also create a syntax-checking
I have discussed the idea with Anton Kholomiov, and he is interested -- but we could use some one else to help write the parser. If you love writing parsers, this should be a fun little project.
Finally, if you could suggest one thing that would make the happstack.com website nicer that would be awesome. There are four things we already plan to change:
use black on white text instead of gray on white
fix the paragraph width so that paragraphs are around 45em wide.
fix the grid alignment so that things are properly aligned to the grid
add more dates to the pages so that it clear that the site and project is still active
If you have other suggestions, we would love to hear them! If you want to hack on the theme directly, that is even better!
Until next time, happy hacking.