megaparsec/nix/patches/dhall.patch
1computer1 34b34c3d93 Decouple the error reporting-related methods from ‘Stream’
Split the ‘Stream’ type class. The methods ‘showTokens’ and ‘tokensLength’
have been put into a separate type class ‘VisualStream’, while ‘reachOffset’
and ‘reachOffsetNoLine’ are now in ‘TraversableStream’. This should make
defining ‘Stream’ instances for custom streams easier.

Defined ‘Stream’ instances for lists and ‘Seq’s.
2020-09-02 19:50:45 +02:00

14 lines
542 B
Diff

diff --git a/src/Dhall/Parser/Expression.hs b/src/Dhall/Parser/Expression.hs
index 3cd51406..0def6b22 100644
--- a/src/Dhall/Parser/Expression.hs
+++ b/src/Dhall/Parser/Expression.hs
@@ -36,7 +36,7 @@ import Dhall.Parser.Combinators
import Dhall.Parser.Token
-- | Get the current source position
-getSourcePos :: Text.Megaparsec.MonadParsec e s m =>
+getSourcePos :: (Text.Megaparsec.MonadParsec e s m, Text.Megaparsec.TraversableStream s) =>
m Text.Megaparsec.SourcePos
getSourcePos =
Text.Megaparsec.getSourcePos