[Haskell-cafe] Re: XML transformation difficulties

Brandon Moore brandonm at yahoo-inc.com
Mon Jul 17 17:34:42 EDT 2006


Greg Fitzgerald wrote:
> Assuming my last post was too hideous for anyone to take the time to 
> attempt to comprehend, let me try to simplify:
> How can I extract the input of an arrow so that I can use it as a 
> parameter of a normal function?
> 
> How do I implement 'f' such that it can call 'g'?
> f :: (ArrowXml a) => XmlTree -> a String XmlTree
> g :: (ArrowXml a) => String -> a XmlTree XmlTree

ArrowXml is a subclass of ArrowApply, so it is possible. For example:
f xml = pure (\s -> (g s, xml)) >>> app

The $< operator from Control.Arrow.ArrowList might also be useful
($<) :: (c -> a b d) -> a b c ->  a b d

Brandon


More information about the Haskell-Cafe mailing list