From f07e2de9a5368fedf155bfa1df2e2f187ac19204 Mon Sep 17 00:00:00 2001 From: joshvera Date: Fri, 18 Dec 2015 14:43:45 -0500 Subject: [PATCH] Use text in constructorForProductions --- src/Parser.hs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Parser.hs b/src/Parser.hs index 7967d8e41..8f85c55f1 100644 --- a/src/Parser.hs +++ b/src/Parser.hs @@ -12,10 +12,10 @@ import qualified Data.Text as T type Parser = T.Text -> IO (Term T.Text Info) -- | Given a source string and a term’s annotation & production/child pairs, construct the term. -type Constructor = String -> Info -> [(String, Term String Info)] -> Term String Info +type Constructor = T.Text -> Info -> [(T.Text, Term T.Text Info)] -> Term T.Text Info -- | Given two sets of production names, produce a Constructor. -constructorForProductions :: Set.Set String -> Set.Set String -> Constructor +constructorForProductions :: Set.Set T.Text -> Set.Set T.Text -> Constructor constructorForProductions keyed fixed source info@(Info range categories) = (info :<) . construct where construct [] = Leaf (substring range source) construct children | not . Set.null $ Set.intersection fixed categories = Fixed $ fmap snd children