~singpolyma/xml-types-haskell

eedf85614a9fabc3314753f6164a2ac7973b8eba — John Millikin 11 years ago 997fda1
Reorganized combinator exports
1 files changed, 15 insertions(+), 4 deletions(-)

M Data/XML/Types.hs
M Data/XML/Types.hs => Data/XML/Types.hs +15 -4
@@ 23,6 23,7 @@

module Data.XML.Types
	( -- * Types
	
	  -- ** Document prologue
	  Document (..)
	, Prologue (..)


@@ 43,19 44,26 @@ module Data.XML.Types
	-- ** Incremental processing
	, Event (..)
	
	-- * Predicates
	-- * Combinators
	
	-- ** Filters
	, isElement
	, isInstruction
	, isContent
	, isComment
	, isNamed
	
	-- * Filters
	, nodeChildren
	-- ** Element traversal
	, elementChildren
	, elementContent
	, attributeContent
	
	-- ** Node traversal
	, nodeChildren
	, nodeContent
	
	-- ** Attributes
	, hasAttribute
	, attributeContent
	) where
import Control.Monad ((>=>))
import qualified Data.Map as M


@@ 202,6 210,9 @@ elementContent = elementNodes >=> isContent
nodeChildren :: Node -> [Node]
nodeChildren = isElement >=> elementNodes

nodeContent :: Node -> [Content]
nodeContent = nodeChildren >=> isContent

hasAttribute :: Name -> Element -> [Element]
hasAttribute name e = [e | isJust (attributeContent name e)]