
-- trying to parse the text below using Parsec: -- ACT I. -- SCENE I. An open place. -- [An open place. Thunder and lightning. Enter three Witches.] -- FIRST WITCH. -- When shall we three meet again -- In thunder, lightning, or in rain? -- Here's the code I have import Text.Parsec import Control.Applicative import Data.Traversable (sequenceA) section s = sequenceA [string s, string " ", many1 letter] `endBy` char '.' act = section "ACT" scene = section "SCENE" main = do parseTest act "ACT I.\n" parseTest scene "SCENE I." -- this returns: -- λ> main -- [["ACT"," ","I"]] -- [["SCENE"," ","I"]] -- Am I using Parsec correctly so far? -- After this I want to match acts (many1 act) and scenes (many1 scene) and I believe I see how to do that, just wanting to make sure I'm on the right track.