Hello,
I just uploaded hsp 0.7.2. This contains a simple fix so that hsp
compiles with GHC >= 7.6. Obviosuly, we are moving to hsp 0.8, but as
that requires some substation work, this will keep the 0.7 line alive
a bit longer.
I also updated happstack-fay. It has now been split into three packages:
- happstack-fay-ajax -- just the client-side fay library for ajax RPC
- happstack-fay -- just the server-side Haskell library for ajax RPC
- fay-hsx - support for client-side HTML generation
the fay-hsx library is compatible with the output of hsx2hs. So, you
can now do things like:
main :: Fay ()
main =
ready $
do div <- select "#thediv"
newContents <- <div>
<p class="red">This paragraph was added on the
client-side via Fay.</p>
<span></span>
<p class="red">As was this one Fay.</p>
</div>
newContentsJQ <- renderHTML newContents
append newContentsJQ div
return ()
if you do not like the literal XML, you can submit a patch to finish
adding the normal Haskell combinators like this one:
-- | \<tr\>
tr :: [Fay (String, String)] -- ^ attributes
-> [Fay HTML] -- ^ children
-> Fay HTML
tr ats chd = genElement (Nothing, "tr") ats chd
I have updated the mastermind example to use the new fay stuff.
http://hub.darcs.net/stepcut/mastermind
mastermind is now built entirely via cabal with no use of shake.
It uses a custom Setup.hs which examines the .cabal file and
automatically calls hsx2hs and fay.
Have fun!
- jeremy