{-# LANGUAGE OverloadedStrings #-}
module Main where
import Text.Trifecta
import Data.ByteString.Char8()
main :: IO ()
main = parseTest p "hello"
where p = do
string "h"
(_ :~ s) <- spanned $ string "ello"
warnAt [] "Fix this" $ render $ Fixit s "should be OMFGLOLOL"
When run it gives this output:
$ runghc trifecta.hs
(interactive):1:2: warning: Fix this
hello<EOF>
~~~~
should be>
()
You would normally expect the fixit string to be as long as necessary.
Consider the following snippet:
When run it gives this output:
You would normally expect the fixit string to be as long as necessary.