Odt reader: replaced collectRights with rights from Data.Either.
This commit is contained in:
parent
c0a1286025
commit
21c4281b13
2 changed files with 2 additions and 6 deletions
|
@ -124,8 +124,3 @@ instance ChoiceVector SuccessList where
|
||||||
spreadChoice = Right . SuccessList . (foldr unTagRight []) . collectNonFailing
|
spreadChoice = Right . SuccessList . (foldr unTagRight []) . collectNonFailing
|
||||||
where unTagRight (Right x) = (x:)
|
where unTagRight (Right x) = (x:)
|
||||||
unTagRight _ = id
|
unTagRight _ = id
|
||||||
|
|
||||||
-- | Like 'catMaybes', but for 'Either'.
|
|
||||||
collectRights :: [Either _l r] -> [r]
|
|
||||||
collectRights = collectNonFailing . untag . spreadChoice . SuccessList
|
|
||||||
where untag = fromLeft (error "Unexpected Left")
|
|
||||||
|
|
|
@ -71,6 +71,7 @@ import Control.Applicative hiding ( liftA, liftA2 )
|
||||||
import Control.Monad ( MonadPlus )
|
import Control.Monad ( MonadPlus )
|
||||||
import Control.Arrow
|
import Control.Arrow
|
||||||
|
|
||||||
|
import Data.Either ( rights )
|
||||||
import qualified Data.Map as M
|
import qualified Data.Map as M
|
||||||
import Data.Default
|
import Data.Default
|
||||||
import Data.Maybe
|
import Data.Maybe
|
||||||
|
@ -604,7 +605,7 @@ tryAll :: (NameSpaceID nsID)
|
||||||
-> XMLConverter nsID extraState b [a]
|
-> XMLConverter nsID extraState b [a]
|
||||||
tryAll nsID name a = prepareIteration nsID name
|
tryAll nsID name a = prepareIteration nsID name
|
||||||
>>> iterateS (switchingTheStack a)
|
>>> iterateS (switchingTheStack a)
|
||||||
>>^ collectRights
|
>>^ rights
|
||||||
|
|
||||||
--------------------------------------------------------------------------------
|
--------------------------------------------------------------------------------
|
||||||
-- Matching children
|
-- Matching children
|
||||||
|
|
Loading…
Reference in a new issue