On 05/04/2008, Paul Johnson <[EMAIL PROTECTED]> wrote:
>  myProblem :: (ArrowXml a) -> a XmlTree String
>  myProblem = proc xml do
>   name <- getAttrValue "name" -< xml
>   fmt <- arr lookupFormatter -< name
>   fmt -< xml
>

GHC has a special syntax for using ArrowApply (which HXT is an
instance of). Whenever the expression to the left of -< needs to
involve a local variable, you can replace -< with -<< and it should
work. To understand better what it means, you can read
http://www.haskell.org/ghc/docs/latest/html/users_guide/arrow-notation.html
-- it's basically just a shorthand for using 'app'.

>  myProblem :: (ArrowXml a) -> a XmlTree String
>  myProblem = proc xml do
>   name <- getAttrValue "name" -< xml
>   fmt <- arr lookupFormatter -< name
>   fmt -<< xml

Try that and see how it goes.

 - Cale
_______________________________________________
Haskell-Cafe mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to