symparsec
Safe HaskellNone
LanguageGHC2021

Data.Type.Symbol

Description

Type families on Symbols.

Synopsis

Documentation

type Length (str :: Symbol) = Length' 0 (UnconsSymbol str) Source #

Calculate the length of a Symbol.

type Take (n :: Natural) (str :: Symbol) = TakeLoop ('[] :: [Char]) n (UnconsSymbol str) Source #

Take the prefix of the given Symbol of the given length.

Returns less than requested if the Symbol is too short.

type TakeNoTailRec (n :: Natural) (str :: Symbol) = TakeNoTailRec' n (UnconsSymbol str) Source #

Take the prefix of the given Symbol of the given length.

Returns less than requested if the Symbol is too short.

Does not do tail-call recursion, but avoids doing extra work. Unsure which is better.

type Drop (n :: Natural) (str :: Symbol) = Drop' n (UnconsSymbol str) Source #

Drop the prefix of the given Symbol of the given length.

type Replicate (n :: Natural) (ch :: Char) = ReplicateLoop ch ('[] :: [Char]) n Source #