Open
Description
Thanks to another IRC user, I was able to get Text parsing with Trifecta via this code:
-- Text Rope and parsing
instance Reducer Text Rope where
unit = unit . strand . encodeUtf8
cons = cons . strand . encodeUtf8
snoc r = snoc r . strand . encodeUtf8
parseText :: Parser a -> Delta -> Text -> Result a
parseText p d inp =
starve $ feed inp $ stepParser (release d *> p)
mempty mempty
But the copying makes me unhappy. I asked in IRC but no-one really knew, why does Trifecta only support UTF-8 ByteStrings as a first-class input stream?
Metadata
Metadata
Assignees
Labels
No labels