HORIZON HASKELLDocslts/ghc-9.10.x248f8f02026-10-05Search names, modules, packages, or :: a typeCtrl K

GHC 9.10.3 · lts/ghc-9.10.x · 248f8f0 · 2026-10-05

Moduletrifecta-2.1.4Haskell2010

Text.Trifecta.Delta

A Delta keeps track of the cursor position of the parser, so it can be referred to later, for example in error messages.

  • 1 type
  • 2 classes
  • 6 values
  • Packagetrifecta-2.1.4
  • Exports9
  • LanguageHaskell2010
  • LicenceBSD-3-Clause
  • SourceDelta.hs
datadata Delta
#

Since there are multiple ways to be at a certain location, Delta captures all these alternatives as a single type.

Constructors

  • Columns !Int64 !Int64
    ( number of characters
    , number of bytes )
    
  • Tab !Int64 !Int64 !Int64
    ( number of characters before the tab
    , number of characters after the tab
    , number of bytes )
    
  • Lines !Int64 !Int64 !Int64 !Int64
    ( number of newlines contained
    , number of characters since the last newline
    , number of bytes
    , number of bytes since the last newline )
    
  • Directed !ByteString !Int64 !Int64 !Int64 !Int64
    ( current file name
    , number of lines since the last line directive
    , number of characters since the last newline
    , number of bytes
    , number of bytes since the last newline )
    
Instances14Eq, Data, Ord, Show, Generic, Semigroup, …
classclass HasDelta t where
#

Methods

Instances13HasDelta, …
classclass HasBytes t where
#

Methods

Instances9HasBytes, …
valuenear :: (HasDelta s, HasDelta t) => s -> t -> Bool
#

Should we show two things with a Delta on the same line?

Example1 expression
near (Columns 0 0) (Columns 5 5)True
Example1 expression
near (Lines 1 0 1 0) (Lines 2 4 4 2)False