[Haskell-cafe] Parsec: Where's +++?
Donald Bruce Stewart
dons at cse.unsw.edu.au
Fri Dec 1 21:16:24 EST 2006
garious:
> Koen Claessen's "Parallel Parsing Processes," suggests their parsing
> combinators have been integrated into Parsec. If so, where is the +++
> operator hiding?
Hoogle says:
Control.Arrow.(+++) :: ArrowChoice a => a b c -> a b' c' -> a (Either b b') (Either c c')
Text.Html.(+++) :: (HTML a, HTML b) => a -> b -> Html
Text.ParserCombinators.ReadP.(+++) :: ReadP a -> ReadP a -> ReadP a
Text.ParserCombinators.ReadPrec.(+++) :: ReadPrec a -> ReadPrec a -> ReadPrec a
> Also, how do I determine what instances a datatype supports? Is
> Parsec an instance of Applicative?
Try :info on your type in ghci:
Prelude Control.Applicative> :info Applicative
class (Functor f) => Applicative f where
pure :: a -> f a
(<*>) :: f (a -> b) -> f a -> f b
-- Defined in Control.Applicative
instance (Monad m) => Applicative (WrappedMonad m)
-- Defined in Control.Applicative
instance Applicative Maybe -- Defined in Control.Applicative
instance Applicative [] -- Defined in Control.Applicative
instance Applicative IO -- Defined in Control.Applicative
instance Applicative ((->) a) -- Defined in Control.Applicative
instance Applicative ZipList -- Defined in Control.Applicative
-- Don
More information about the Haskell-Cafe
mailing list