coda-0.0.1: The coda compiler

Copyright(c) Edward Kmett 2017
LicenseBSD2
MaintainerEdward Kmett <ekmett@gmail.com>
Stabilityexperimental
Portabilitynon-portable
Safe HaskellNone
LanguageHaskell2010

Coda.Syntax.Rope

Contents

Description

 

Synopsis

Documentation

newtype Rope Source #

Constructors

Rope (FingerTree Line) 

splitAtPosition :: Position -> Rope -> (Rope, Rope) Source #

insertAt :: Position -> Text -> Rope -> Rope Source #

deleteRange :: Range -> Rope -> Rope Source #

replaceRange :: Range -> Text -> Rope -> Rope Source #

deltaToPosition :: Rope -> Delta -> Position Source #

Compute an Language Server Protocol Position from a Delta given the associated text

Takes O(log l) where l is the number of lines

positionToDelta :: Rope -> Position -> Delta Source #

Convert from a Language Server Protocol Position to a Delta given the associated text.

O(log l) where l is the number of lines

Lines

data Line Source #

Constructors

Line 

Fields

Instances

foldLines :: (a -> Text -> a) -> a -> Text -> a Source #

class FromText a where Source #

Minimal complete definition

fromText

Methods

fromText :: Text -> a Source #

Summarizing Lines

data LineMeasure Source #

LineMeasure is not Position

This measures line count and total number of code-units over all lines not the number of code-units on the current line.

Also when used to measure a FingerTree you can use the FingerTree to convert back and forth between Delta and Position in O(log l) time, while still letting us use the compact single-integer Abelian group Delta representation internally for almost all positioning.

Constructors

LineMeasure !Int !Delta !Summary 

Instances

Eq LineMeasure Source # 
Data LineMeasure Source # 

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> LineMeasure -> c LineMeasure #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c LineMeasure #

toConstr :: LineMeasure -> Constr #

dataTypeOf :: LineMeasure -> DataType #

dataCast1 :: Typeable (* -> *) t => (forall d. Data d => c (t d)) -> Maybe (c LineMeasure) #

dataCast2 :: Typeable (* -> * -> *) t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c LineMeasure) #

gmapT :: (forall b. Data b => b -> b) -> LineMeasure -> LineMeasure #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> LineMeasure -> r #

gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> LineMeasure -> r #

gmapQ :: (forall d. Data d => d -> u) -> LineMeasure -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> LineMeasure -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> LineMeasure -> m LineMeasure #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> LineMeasure -> m LineMeasure #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> LineMeasure -> m LineMeasure #

Ord LineMeasure Source # 
Read LineMeasure Source # 
Show LineMeasure Source # 
Generic LineMeasure Source # 

Associated Types

type Rep LineMeasure :: * -> * #

Semigroup LineMeasure Source # 
Monoid LineMeasure Source # 
Hashable LineMeasure Source # 
Default LineMeasure Source # 

Methods

def :: LineMeasure

HasDelta LineMeasure Source # 
HasLineMeasure LineMeasure Source # 
type Rep LineMeasure Source #