ANN: HSP 0.7.2, happstack-fay, happstack-fay-ajax, fay-hsx, mastermind

77 views
Skip to first unread message

Jeremy Shaw

unread,
Mar 5, 2013, 2:07:56 PM3/5/13
to HAppS
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

gavino

unread,
May 5, 2013, 11:26:50 PM5/5/13
to ha...@googlegroups.com



Example sites using hsp?


 

Michael Lauria

unread,
Jun 5, 2013, 4:57:00 PM6/5/13
to ha...@googlegroups.com
I'm going through the happstack tutorial with a mind to figuring out mastermind before working on my own thing. 
I can't get cabal to install happstack-hsp because it has 0.8 and can't get 0.7.*. Is there anything I can do about this?

Thanks,
Michael

Jeremy Shaw

unread,
Jun 5, 2013, 6:27:08 PM6/5/13
to HAppS
Hello,

Right now happstack-hsp does indeed require HSP 0.7. Though, perhaps
it is time to bit the bullet and convert everything to hsp 0.8.

It is highly unlikely that you need hsp 0.8 for anything at this
time. can you just 'cabal unregister hsp' and then 'cabal install
happstack-hsp' ?

cabal error messages would be useful in figuring out what is wrong if
that does not work.

Thanks!
- jeremy
> --
> You received this message because you are subscribed to the Google Groups
> "HAppS" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to happs+un...@googlegroups.com.
> To post to this group, send email to ha...@googlegroups.com.
> Visit this group at http://groups.google.com/group/happs?hl=en.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
Reply all
Reply to author
Forward
0 new messages