Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
patches for hsx, hjscript, and hsp plus work on an hsx quasi-quoter
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  3 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Jeremy Shaw  
View profile  
 More options Apr 16 2012, 7:05 pm
From: Jeremy Shaw <jer...@n-heptane.com>
Date: Mon, 16 Apr 2012 18:05:31 -0500
Local: Mon, Apr 16 2012 7:05 pm
Subject: patches for hsx, hjscript, and hsp plus work on an hsx quasi-quoter

Hello,

I have attached patches to hsx, hjscript, and hsp updating them to
work with GHC > 7, and also updating the maintainer email address and
the source web pages. I did not patch HJavaScript, or any of the other
packages to update the maintainer information. Also, I did not change
where 'darcs send' goes. I think you can only change that by editing
your account information on patch-tag.

Additionally, there are some extra patches to HSX. In HSX.Transform, a
number of locations had code like:

 (var nothing_name)

But Nothing is a constructor not a variable. This has not been a
problem until now because the pretty-printer does not care, and so
everything just works out ok in the end.

However, if you use haskell-src-meta to translate the HSE AST to TH,
then you will get a compile-time splice error because TH does care. So
I patch that (hopefully correctly).

Additionally, I renamed transformExp to transformExpM, and exported a
new function:

> transformExp :: Exp -> Exp

Using this new function it is now easy to implement a HSX
quasi-quoter. I have attached a prototype and a demo that uses it.
(The demo also requires haskell-src-meta and happstack-hsp).

Once the new HSX is released, I can release a package like, hsx-qq. Or
we could put the QuasiQuoter in HSX itself. It does add a dependency
on haskell-src-meta though. Not sure if that matters or not.

Using the new quoter you can now do:

> html :: (XMLGenerator m) => XMLGenT m (HSX.XML m)
> html = [hsx| <p><% map toUpper "hello, world!"  %></p> |]

> main :: IO ()
> main = putStrLn $ renderAsHTML $ evalIdentity html

GHCi>
<p

>HELLO, WORLD!</p

This has a few advantages over trhsx:

 1. it does not require an external pre-processor to be installed and
findable. Nor does it require the odd looking {-# OPTIONS_GHC -F
-pgmFtrhsx #-} pragma
 2. It should leave haddock comments intact
 3. line numbers in error messages are possibly more correct
 4. it ought to work better if you want to use literal XML inside
normal TH  (though some Lift instances are likely required)
 5. it will make hamlet users feel more at home

The external trhxs tool is useful as well. This is intended to
compliment not replace it.

- jeremy

  hjscript-fixes-for-ghc7.dpatch
20K Download

  hsp-fixes-for-ghc7.dpatch
18K Download

  hsx-bug-fixes-and-export-transformExp.dpatch
42K Download

  HSXQQ.hs
1K Download

  Test.hs
< 1K Download

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
dag.odenhall@gmail.com  
View profile  
 More options Apr 16 2012, 9:15 pm
From: "dag.odenh...@gmail.com" <dag.odenh...@gmail.com>
Date: Tue, 17 Apr 2012 03:15:27 +0200
Local: Mon, Apr 16 2012 9:15 pm
Subject: Re: patches for hsx, hjscript, and hsp plus work on an hsx quasi-quoter

On Tue, Apr 17, 2012 at 1:05 AM, Jeremy Shaw <jer...@n-heptane.com> wrote:

>  1. it does not require an external pre-processor to be installed and
> findable. Nor does it require the odd looking {-# OPTIONS_GHC -F
> -pgmFtrhsx #-} pragma
>  2. It should leave haddock comments intact
>  3. line numbers in error messages are possibly more correct
>  4. it ought to work better if you want to use literal XML inside
> normal TH  (though some Lift instances are likely required)
>  5. it will make hamlet users feel more at home

6. It will work in GHCi!

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Thomas Hartman  
View profile  
 More options Apr 16 2012, 9:18 pm
From: Thomas Hartman <tho...@marketpsychdata.com>
Date: Mon, 16 Apr 2012 18:18:08 -0700
Local: Mon, Apr 16 2012 9:18 pm
Subject: Re: patches for hsx, hjscript, and hsp plus work on an hsx quasi-quoter

> 3. line numbers in error messages are possibly more correct

This drove (drives) me nuts. Is it really fixed? I have to check it out...

On Mon, Apr 16, 2012 at 6:15 PM, dag.odenh...@gmail.com

--
--
_____________________
Thomas Hartman
MarketPsych LLC
MarketPsy Capital  LLC
2400 Broadway, Suite 220
Santa Monica, CA, USA
Tel:  +1.310.573.8523
______________________

This e-mail message and any attachments may contain information that
is confidential, proprietary or privileged, and is for the named
person’s use only.  No confidentiality or privilege is waived or lost
by any mistransmission.  If you are not the intended recipient or
agent responsible for delivering it to the intended recipient, you are
hereby notified that any dissemination, distribution, copying or other
use of this message or its attachments is strictly prohibited.  If you
have received this message in error, please notify us immediately and
destroy all copies of this message and attachments without disclosing
the contents to anyone.  Neither this message nor any information
included herein constitute an offer to sell or the solicitation of an
offer to buy any securities or investment product, or legal, tax,
accounting, or investment advice.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »