[web-devel] Confusing double use of chooseRep in runHandler

Tyson Whitehead twhitehead at gmail.com
Wed Jun 8 22:59:35 CEST 2011


I believe there may be an unneeded pass through chooseRep in at the end of 
runHandler in the HCContent branch of the content case construct

  HCContent status a -> do
    (ct, c) <- liftIO $ chooseRep a cts
    return $ YARPlain status (headers []) ct c finalSession

The chooseRep instance will just be id as a is already of type ChooseRep.

While I doubt there would be any performance benefit, as I would hope it is 
optimized out, it did cause me some confusion while reading to code, so think 
it would be worth removing for clarity.  I've attached a patch for this.

Cheers!  -Tyson
-------------- next part --------------
A non-text attachment was scrubbed...
Name: chooseRep_2.patch
Type: text/x-patch
Size: 372 bytes
Desc: not available
URL: <http://www.haskell.org/pipermail/web-devel/attachments/20110608/39cc614d/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 490 bytes
Desc: This is a digitally signed message part.
URL: <http://www.haskell.org/pipermail/web-devel/attachments/20110608/39cc614d/attachment.pgp>


More information about the web-devel mailing list