ANNOUNCE: hsx-0.10.1, hjscript-0.6.0, hsp-0.7.0

10 views
Skip to first unread message

Niklas Broberg

unread,
Apr 23, 2012, 10:05:16 AM4/23/12
to Haskell Server Pages, Haskell-cafe, web-devel
Hi all,

I'm pleased to announce the release of the latest versions of the libraries in the Haskell Server Pages suite. 

Haskell Server Pages enables literal XML syntax to be used mixed with Haskell code (like e.g. PHP), in a sane way (unlike said PHP). In principle the functionality could be used together with any Haskell web framework, but is (currently) best integrated in and supported by Happstack. For this release I owe much to Jeremy Shaw, both for inspiration and for actual patches. 

There are some grand plans in the pipeline for some more extensive changes to the suite, to shape it up to be worthy of the current exciting state-of-the-art of Haskell web development. Stay tuned!

Cheers,

/Niklas


Specific changes in this release:

* In the XMLGen class, the following associated types have been renamed to avoid frequent name clashes, and to better match the intention of those types: XML => XMLType, Child => ChildType, Attribute => AttributeType.

* Literal CDATA strings are now given an explicit type signature in the post-processed code. This to avoid ambiguities when OverloadedStrings is enabled.

* class XMLGenerator m now has EmbedAsChild m () as another premise.

* HSX.Transform now exports a method transformExp :: Exp -> Exp, intended to be used with quasi-quotation.

* trhsx no longer performs fixity resolution before transforming, allowing the tool to be used on files using operators with (locally) unknown fixity.

* hsp and hjscript updated to work with hsx-0.10.

Jeremy Shaw

unread,
Apr 23, 2012, 4:19:23 PM4/23/12
to haskell-se...@googlegroups.com
Awesome.

Looks like hsx needs to bump the lower bounds on HSE?

$ cabal install hsp
Resolving dependencies...
Downloading hsx-0.10.1...
Configuring hsx-0.10.1...
Building hsx-0.10.1...
Preprocessing executable 'trhsx' for hsx-0.10.1...
[1 of 2] Compiling HSX.Transform ( src/HSX/Transform.hs,
dist/build/trhsx/trhsx-tmp/HSX/Transform.o )

src/HSX/Transform.hs:23:38:
Module `Language.Haskell.Exts.SrcLoc' does not export `noLoc'
cabal: Error: some packages failed to install:
HJScript-0.6.0 depends on hsx-0.10.1 which failed to install.
hsp-0.7.0 depends on hsx-0.10.1 which failed to install.
hsx-0.10.1 failed during the building phase. The exception was:
ExitFailure 1

Upgrading to a newer HSE fixed that error.

- jeremy
> --
> You received this message because you are subscribed to the Google Groups
> "Haskell Server Pages" group.
> To post to this group, send email to haskell-se...@googlegroups.com.
> To unsubscribe from this group, send email to
> haskell-server-p...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/haskell-server-pages?hl=en.

Jeremy Shaw

unread,
Apr 23, 2012, 4:39:48 PM4/23/12
to haskell-se...@googlegroups.com
Also, there are two other errors building HSP.

1. When trying to build hsp I get this error message:

$ runhaskell Setup.hs build
Building hsp-0.7.0...
Preprocessing library hsp-0.7.0...

src/HSP/HJScript.hs:1:1: Parse error: #

If I run trhsx by hand and replace HJScript.hs with the output of
trhsx I still get the error. If I think delete the {-# OPTIONS_GHC -F
-pgmFtrhsx #-} pragma from the generated file it builds fine.

2. I think get a type error in this line:

{-# LINE 376 "XMLGenerator.hsx" #-}
flP ((x : y) : xs) bs
= case (x, y) of
(CDATA e1 s1, CDATA e2 s2) | e1 == e2 ->
flP (CDATA e1 (s1 ++ s2) : xs) bs
_ -> flP (y : xs) (x : bs)

You will notice that it has generated, ((x : y) : xs) instead of (x :
y : xs). Probably related to the recent infix change?

Sorry I didn't test this earlier :-/

- jeremy

Niklas Broberg

unread,
Apr 24, 2012, 2:45:14 AM4/24/12
to haskell-se...@googlegroups.com
On Mon, Apr 23, 2012 at 10:19 PM, Jeremy Shaw <jash...@gmail.com> wrote:
Looks like hsx needs to bump the lower bounds on HSE?

Stupid. That HSE change was done *only* to accomodate this change in hsx, and yet I forgot to bump it. I need a build server.

/Niklas

Niklas Broberg

unread,
Apr 24, 2012, 3:04:18 AM4/24/12
to haskell-se...@googlegroups.com
This is even worse. I tried installing all the libraries in turn before releasing, but must have forgotten to clear some cache. Installing a-fresh I get the same errors.


 1. When trying to build hsp I get this error message:

$ runhaskell Setup.hs build
Building hsp-0.7.0...
Preprocessing library hsp-0.7.0...

src/HSP/HJScript.hs:1:1:  Parse error: #

Ok, this is GHC being nasty, inserting a bunch of extra lines before the preprocessor stage. I can rail all I want about it, but then I invariably need to just bite the bullet and accept reality. And update HSE to account for it. For now though, rolling back to hsx-0.10.0 (as opposed to 0.10.1) will fix both this and the next problem.


2. I think get a type error in this line:

       {-# LINE 376 "XMLGenerator.hsx" #-}
       flP ((x : y) : xs) bs
         = case (x, y) of
               (CDATA e1 s1, CDATA e2 s2) | e1 == e2 ->
                                            flP (CDATA e1 (s1 ++ s2) : xs) bs
               _ -> flP (y : xs) (x : bs)

You will notice that it has generated, ((x : y) : xs) instead of (x :
y : xs). Probably related to the recent infix change?

Ah yes, of course. So the infix change wasn't harmless after all, I should have figured. So then the ability to handle unknown problematic fixities will have to wait until I've had time to switch over to the exact-printer.
 
Sorry I didn't test this earlier :-/

Well, sorry for being sloppy and not testing enough. I really need a test suite for this.

At any rate - use hsx-0.10.0 for the time being, and I'll upload 0.10.2 in a short while.

Cheers,

/Niklas

Niklas Broberg

unread,
Apr 24, 2012, 4:16:39 AM4/24/12
to haskell-se...@googlegroups.com
At any rate - use hsx-0.10.0 for the time being, and I'll upload 0.10.2 in a short while.

On hackage now: hsx-0.10.2, hjscript-0.6.1, hsp-0.7.1

Cheers,

/Niklas

Jeremy Shaw

unread,
Apr 24, 2012, 11:42:36 AM4/24/12
to haskell-se...@googlegroups.com
On Tue, Apr 24, 2012 at 1:45 AM, Niklas Broberg
<niklas....@gmail.com> wrote:

> I need a build server.

A server might be overkill. But the command-line version of scoutess
could be perfect. You run it, it reads the config file, builds
everything against several different versions of the Haskell
platform/GHC, generates cross-linked haddock documentation, checks if
there are newer build dependencies you are not able to use, and
generates a nice easy to read report.

It would pull all the HSX code from darcs, run, cabal sdist and
uploaded it to a local hackage server, and install it via 'cabal
install' attempting to simulate what would happen if you actually
uploaded the packages to hackage and then run cabal install.

The server version would run all the time, checking for changes in
darcs, get, etc, or packages on hackage that you depend on, performing
builds to ensure nothing broke, and informing you that something
happened, etc.

Coming soon!

- jeremy

Niklas Broberg

unread,
Apr 27, 2012, 6:06:57 AM4/27/12
to haskell-se...@googlegroups.com
I've seen the plans, and I very much look forward to it! :-)

Cheers,

/Niklas 
Reply all
Reply to author
Forward
0 new messages