Skip to content

(documentation) who is "responsible for maintaining position" - Stream, token, or both? #196

@jwaldmann

Description

@jwaldmann

it seems to me that haddocks for Text.Parsec are contradictory w.r.t. the semantics of Stream s m t:

and that can only be solved by

  • duplicating the position of the stream into the token? as the following example does, indeed: posFromTok (pos,t) = pos;
  • or computing both representations of position independently - but synchronously, which seems fragile.

Forgive me if this is a basic design question, I stumbled on this when I wanted to write a custom Stream instance.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions