You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The project already has a dependency on pretty for pretty-printing. In Text.PrettyPrint.Annotated.HughesPJ, there is
data Span a = Span
{ spanStart :: !Int
, spanLength :: !Int
, spanAnnotation :: a
} deriving (Show,Eq)
Which might be a good candidate as the output tag type for parsing. Some thoughts on this:
One uniform Span data type for both pretty-printing and parsing is slick, especially a reused one.
I'm not sure I see any use for spanAnnotation with parsing - maybe a means of plugging in more helpful information about position. For the latter, one would probably define
data Pos = Pos { row :: !Int, col :: !Int } deriving (Eq, Ord)
type ParseSpan = Span Pos
then parsing functions would produce things of type Expr ParseSpan, Ty ParseSpan, etc.
All changes would be in the Parser module, just returning this type.
The text was updated successfully, but these errors were encountered:
The project already has a dependency on
pretty
for pretty-printing. InText.PrettyPrint.Annotated.HughesPJ
, there isWhich might be a good candidate as the output tag type for parsing. Some thoughts on this:
One uniform
Span
data type for both pretty-printing and parsing is slick, especially a reused one.I'm not sure I see any use for
spanAnnotation
with parsing - maybe a means of plugging in more helpful information about position. For the latter, one would probably definethen parsing functions would produce things of type
Expr ParseSpan
,Ty ParseSpan
, etc.All changes would be in the
Parser
module, just returning this type.The text was updated successfully, but these errors were encountered: