Skip to content

Commit 0134e4d

Browse files
committed
derive generic instance of Position
1 parent 8412e63 commit 0134e4d

File tree

3 files changed

+6
-1
lines changed

3 files changed

+6
-1
lines changed

bower.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,8 @@
2929
"purescript-maybe": "^4.0.0",
3030
"purescript-strings": "^4.0.0",
3131
"purescript-transformers": "^4.1.0",
32-
"purescript-unicode": "^4.0.0"
32+
"purescript-unicode": "^4.0.0",
33+
"purescript-generics-rep": "^6.1.1"
3334
},
3435
"devDependencies": {
3536
"purescript-assert": "^4.0.0",

spago.dhall

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
[ "arrays"
44
, "assert"
55
, "console"
6+
, "generics-rep"
67
, "effect"
78
, "either"
89
, "foldable-traversable"

src/Text/Parsing/Parser/Pos.purs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
module Text.Parsing.Parser.Pos where
22

33
import Prelude
4+
import Data.Generic.Rep (class Generic)
45
import Data.Foldable (foldl)
56
import Data.Newtype (wrap)
67
import Data.String (split)
@@ -14,6 +15,8 @@ newtype Position = Position
1415
, column :: Int
1516
}
1617

18+
derive instance genericPosition :: Generic Position _
19+
1720
instance showPosition :: Show Position where
1821
show (Position { line: line, column: column }) =
1922
"(Position { line: " <> show line <> ", column: " <> show column <> " })"

0 commit comments

Comments
 (0)