[Hugs-users] Network.CGI missing in Hugs

Bjorn Bringert bringert at cs.chalmers.se
Mon Jan 8 17:57:30 EST 2007


On Jan 7, 2007, at 19:10 , Bjorn Bringert wrote:

> On Jan 7, 2007, at 19:03 , Ian Lynagh wrote:
>
>> On Fri, Jan 05, 2007 at 06:14:31PM +0100, Bjorn Bringert wrote:
>>> On Jan 5, 2007, at 18:04 , Ross Paterson wrote:
>>>>
>>>> 	instance (MonadTrans t, MonadCGI m, Monad (t m)) => MonadCGI (t m)
>>>
>>> I added that instance reluctantly, but it is quite useful when you
>>> write your own monad transformers and want to wrap CGIT. Removing it
>>> would break some existing code (Hope is the only one I know of),
>>
>> Some of my code needs it too (I think I might have requested it be  
>> added
>> in the first place?). I find it very useful to be able to write  
>> code in
>> the style shown in
>> http://www.haskell.org/pipermail/haskell-cafe/2007-January/ 
>> 021085.html
>>
>> Hugs compatibility is also important, though, and undecidable  
>> instances
>> are marked "probably no" for Haskell'.
>>
>> It feels like a bit of a sledgehammer, but maybe the instance  
>> should be
>> put in its own package cgi-undecidable or something?
>
> Yes, you were the one who requested it in the first place. It was  
> initially in a separate module. As far as I recall, I only moved it  
> to Network.CGI.Monad to avoid it being an orphan instance. This  
> isn't really important I guess. I would be ok with moving it  
> somewhere else. A separate package would probably be the cleanest,  
> since it would allow applications to declare that they need it.

Done. Thanks for the suggestion Ian! The undecidable instance is now  
in a separate package, available from here:

http://darcs.haskell.org/packages/cgi-undecidable/

The cgi package still does not work under Hugs due to the missing  
getEnvironment. I think that it really needs to use getEnvironment,  
and not getEnv as the old Network.CGI did. I would like all  
environment variables to be available, not just the standard ones.  
The is needed for request-specific variables like HTTP_* and for  
server-specific ones like REQUEST_URI (set by mod_rewrite). It's not  
ok to force the user to call getEnv for those either, since the  
program might be running under FastCGI where the variables do not  
come from the program environment variables.

/Björn


More information about the Hugs-Users mailing list