Text.bend checks
raw source on the hub · import hhefesto-text@1.0.0.0/Text.bend as Text
1 import
import Base
Types
type tx.Two source · line 42 · raw
Data
a pair of strings (Data: a Maybe may hold one)
tx.Two@a:String -> @b:String -> tx.Two
Definitions
def tx.space source · line 14 · raw
@+c:U32 -> Bool
Data.Char.isSpace: the Latin-1 spaces and Unicode's Space_Separator
def tx.drop.at source · line 18 · raw
@sp:Bool -> @+c:U32 -> @t:String -> @more:(@_:Unit -> String) -> String
def tx.drop.space source · line 25 · raw
@s:String -> String
def tx.strip.start source · line 32 · raw
@s:String -> String
def tx.strip.end source · line 35 · raw
@s:String -> String
def tx.strip source · line 38 · raw
@s:String -> String
def tx.words.push source · line 46 · raw
@w:String -> @ws:List<&2, String> -> List<&2, String>
Words: the runs of what is not white space
def tx.words.at source · line 53 · raw
@sp:Bool -> @+c:U32 -> @w:String -> @more:(@_:String -> List<&2, String>) -> List<&2, String>
def tx.words.go source · line 60 · raw
@s:String -> @w:String -> List<&2, String>
def tx.words source · line 67 · raw
@s:String -> List<&2, String>
def tx.unwords source · line 70 · raw
@ws:List<&2, String> -> String
def tx.lines.fix source · line 74 · raw
@ls:List<&2, String> -> List<&2, String>
Lines: cut at "\n", a last empty one dropped (T.lines)
def tx.lines source · line 83 · raw
@s:String -> List<&2, String>
def tx.unlines source · line 86 · raw
@ls:List<&2, String> -> String
def tx.take.end source · line 94 · raw
@+n:Nat -> @+s:String -> String
From the end
def tx.drop.end source · line 97 · raw
@+n:Nat -> @+s:String -> String
def tx.nl.at source · line 100 · raw
@nl:Bool -> @+c:U32 -> @more:(@_:Unit -> String) -> String
def tx.upto.nl source · line 107 · raw
@s:String -> String
def tx.last.line source · line 115 · raw
@s:String -> String
what follows the last "\n" (all of s when none)
def tx.strip.prefix source · line 119 · raw
@+p:String -> @+s:String -> Maybe<&2, String>
Prefixes and suffixes
def tx.strip.suffix source · line 122 · raw
@+p:String -> @+s:String -> Maybe<&2, String>
def tx.break.cons source · line 125 · raw
@+h:Char -> @p:tx.Two -> tx.Two
def tx.break.at source · line 130 · raw
@hit:Bool -> @+h:Char -> @+t:String -> @more:(@_:Unit -> tx.Two) -> tx.Two
def tx.break.on source · line 138 · raw
@+needle:String -> @s:String -> tx.Two
s at its first needle: before it, and from it on ("" when none)
def tx.split.at source · line 145 · raw
@hit:Bool -> @+h:Char -> @+t:String -> @+n:Nat -> @acc:String -> @more:(@_:String -> List<&2, String>) -> @skip:(@_:Unit -> List<&2, String>) -> List<&2, String>
def tx.split.go source · line 154 · raw
@+fuel:Nat -> @+needle:String -> @s:String -> @acc:String -> List<&2, String>
s cut at every needle (not empty), as T.splitOn: n+1 pieces for n
needles (fuel: s's length, which every step shortens)
def tx.split.on source · line 164 · raw
@+needle:String -> @+s:String -> List<&2, String>
def tx.replace source · line 167 · raw
@+needle:String -> @+rep:String -> @s:String -> String
def tx.digits source · line 170 · raw
@s:String -> Bool
def tx.strip.lines source · line 178 · raw
@ls:List<&2, String> -> List<&2, String>
T.lines, then each line stripped of its start's white space