Re: [Haskell-cafe] Backtracking in HXT

2013-01-01 Thread Mateusz Kowalczyk
Ah, zeroArrow looks exactly like what I need here! Thanks, this helps. Mateusz Kowalczyk On 01/01/13 01:08, dag.odenh...@gmail.com wrote: (">>>" is my GHCi prompt, might be a bit confusing for an arrow example.) On Tue, Jan 1, 2013 at 2:05 AM, dag.odenh...@gmail.com

Re: [Haskell-cafe] Backtracking in HXT

2012-12-31 Thread dag.odenh...@gmail.com
(">>>" is my GHCi prompt, might be a bit confusing for an arrow example.) On Tue, Jan 1, 2013 at 2:05 AM, dag.odenh...@gmail.com < dag.odenh...@gmail.com> wrote: > Use arrow notation and zeroArrow, like so: > > {-# LANGUAGE Arrows #-} > import Text.XML.HXT.Core > getA = > hasName "a" >>> proc

Re: [Haskell-cafe] Backtracking in HXT

2012-12-31 Thread dag.odenh...@gmail.com
Use arrow notation and zeroArrow, like so: {-# LANGUAGE Arrows #-} import Text.XML.HXT.Core getA = hasName "a" >>> proc elem -> do text <- getText <<< getChildren -< elem if text == "Hello Two!" then getAttrValue "href" -< elem else zeroArrow -< () >>> runX $ readString []

[Haskell-cafe] Backtracking in HXT

2012-12-31 Thread Mateusz Kowalczyk
Hello, I'm not sure if this is the right place to ask this but here goes. I'm currently working with HXT and I quite like it. There's one issue I can't solve (at least now without some dirty, dirty hacking) and I'm sure it's fairly simple. Consider the following mark-up Hello One! Hello Two! N