import qualified Text.Pretty.Note as N
import Text.Pretty.Semantic

import Hedgehog

result :: String -> T.Text -> T.Text
result file contents =
  case parseStmts (SourcePos name 1 1) (L.fromStrict contents) of
    Right res-> displayPlain $ Right <$> vsep (map pretty res)
    Left e -> displayPlain $ prettyErr e

  where
    name = T.pack file
    prettyErr = N.format (N.fileSpans [(name , contents)] N.defaultHighlight)