diff --git a/bower.json b/bower.json index 3e0f3bb..f89a733 100644 --- a/bower.json +++ b/bower.json @@ -29,7 +29,8 @@ "purescript-maybe": "^4.0.0", "purescript-strings": "^4.0.0", "purescript-transformers": "^4.1.0", - "purescript-unicode": "^4.0.0" + "purescript-unicode": "^4.0.0", + "purescript-generics-rep": "^6.1.1" }, "devDependencies": { "purescript-assert": "^4.0.0", diff --git a/spago.dhall b/spago.dhall index b40582a..fabd3c7 100644 --- a/spago.dhall +++ b/spago.dhall @@ -3,6 +3,7 @@ [ "arrays" , "assert" , "console" + , "generics-rep" , "effect" , "either" , "foldable-traversable" diff --git a/src/Text/Parsing/Parser/Pos.purs b/src/Text/Parsing/Parser/Pos.purs index e65c6f2..6a20dff 100644 --- a/src/Text/Parsing/Parser/Pos.purs +++ b/src/Text/Parsing/Parser/Pos.purs @@ -1,6 +1,7 @@ module Text.Parsing.Parser.Pos where import Prelude +import Data.Generic.Rep (class Generic) import Data.Foldable (foldl) import Data.Newtype (wrap) import Data.String (split) @@ -14,6 +15,8 @@ newtype Position = Position , column :: Int } +derive instance genericPosition :: Generic Position _ + instance showPosition :: Show Position where show (Position { line: line, column: column }) = "(Position { line: " <> show line <> ", column: " <> show column <> " })"