ezsys Releases (1): 0.1.0.0 0x8abe7473e8854cc69c687ee77b7d72e3 indexed https://jend.leeeet.dev/files.txt?path=ezsys@0.1.0.0 Definitions (176, 1 to 100 shown): Ezsys.file.read (https://jend.leeeet.dev/definition.txt?path=ezsys@0.1.0.0/main.bend&name=file.read) # a whole file's text; a failure to open or read it is a Fail, never an exit def file.read(path: String) -> IO(Result<&1, &1, U32 & String, String>): Ezsys.file.write (https://jend.leeeet.dev/definition.txt?path=ezsys@0.1.0.0/main.bend&name=file.write) # replace a file's whole text, creating it when it is missing def file.write( path: String, text: String ) -> IO(Result<&1, &1, U32 & String, Unit>): Ezsys.file.save (https://jend.leeeet.dev/definition.txt?path=ezsys@0.1.0.0/main.bend&name=file.save) # write `.tmp`, flush it, and rename it over path, so a reader sees # the old text or the new, never part of either def file.save( path: String, text: String ) -> IO(Result<&1, &1, U32 & String, Unit>): Ezsys.env.or (https://jend.leeeet.dev/definition.txt?path=ezsys@0.1.0.0/main.bend&name=env.or) # an environment variable's value (even an empty one), or fallback when it # is unset def env.or(name: String, fallback: String) -> IO(String): Ezsys.time.now (https://jend.leeeet.dev/definition.txt?path=ezsys@0.1.0.0/main.bend&name=time.now) # the wall clock: whole seconds since 1970-01-01T00:00:00Z, and the # milliseconds past them def time.now() -> IO(U32 & U32): Ezsys.time.iso (https://jend.leeeet.dev/definition.txt?path=ezsys@0.1.0.0/main.bend&name=time.iso) # ISO 8601 UTC, `YYYY-MM-DDTHH:MM:SS.mmmZ`, of seconds since the epoch and a # millisecond def time.iso(secs: U32, ms: U32) -> String: Ezsys.time.civil (https://jend.leeeet.dev/definition.txt?path=ezsys@0.1.0.0/main.bend&name=time.civil) # the civil fields of seconds since the epoch, in UTC: year, month, day, # hour, minute, second and ISO weekday (1 Monday to 7 Sunday) def time.civil(secs: U32) -> U32 & U32 & U32 & U32 & U32 & U32 & U32: Ezsys.time.iso_week (https://jend.leeeet.dev/definition.txt?path=ezsys@0.1.0.0/main.bend&name=time.iso_week) # the ISO 8601 week-numbering year and week of seconds since the epoch def time.iso_week(secs: U32) -> U32 & U32: Ezsys.time.iso_week_text (https://jend.leeeet.dev/definition.txt?path=ezsys@0.1.0.0/main.bend&name=time.iso_week_text) # the ISO 8601 week as `date -u +%G-W%V` writes it, e.g. `2026-W43` def time.iso_week_text(secs: U32) -> String: Ezsys.time.now_iso (https://jend.leeeet.dev/definition.txt?path=ezsys@0.1.0.0/main.bend&name=time.now_iso) # the wall clock as ISO 8601 UTC def time.now_iso() -> IO(String): Ezsys.text.fill (https://jend.leeeet.dev/definition.txt?path=ezsys@0.1.0.0/main.bend&name=text.fill) # every `{{key}}` in a template replaced by its value; unknown and unclosed # markers are left as written def text.fill(template: String, pairs: List<(String & String)>) -> String: Ezsys.text.fill_with (https://jend.leeeet.dev/definition.txt?path=ezsys@0.1.0.0/main.bend&name=text.fill_with) # the same with other delimiters, e.g. `` def text.fill_with( open: String, close: String, template: String, pairs: List<(String & String)> ) -> String: Ezsys.text.strip (https://jend.leeeet.dev/definition.txt?path=ezsys@0.1.0.0/main.bend&name=text.strip) # the text with Python's whitespace removed from both ends (str.strip()) def text.strip(txt: String) -> String: Ezsys.text.lstrip (https://jend.leeeet.dev/definition.txt?path=ezsys@0.1.0.0/main.bend&name=text.lstrip) # the text with Python's whitespace removed from its start (str.lstrip()) def text.lstrip(txt: String) -> String: Ezsys.text.rstrip (https://jend.leeeet.dev/definition.txt?path=ezsys@0.1.0.0/main.bend&name=text.rstrip) # the text with Python's whitespace removed from its end (str.rstrip()) def text.rstrip(txt: String) -> String: Ezsys.text.replace (https://jend.leeeet.dev/definition.txt?path=ezsys@0.1.0.0/main.bend&name=text.replace) # every `old` replaced by `new`, left to right, never overlapping # (str.replace); an empty `old` puts `new` around every character def text.replace(txt: String, old: String, new: String) -> String: Ezsys.text.split (https://jend.leeeet.dev/definition.txt?path=ezsys@0.1.0.0/main.bend&name=text.split) # the pieces between every `sep` (str.split(sep)); an empty `sep` answers # the text as its one piece def text.split(txt: String, sep: String) -> List<&2, String>: Ezsys.text.find (https://jend.leeeet.dev/definition.txt?path=ezsys@0.1.0.0/main.bend&name=text.find) # the index in code points where `needle` first starts, or None # (str.find) def text.find(txt: String, needle: String) -> Maybe<&2, U32>: Ezsys.text.lower (https://jend.leeeet.dev/definition.txt?path=ezsys@0.1.0.0/main.bend&name=text.lower) # the text in lowercase (str.lower) for ASCII, Latin-1, Latin Extended-A, # Greek and Cyrillic; other code points are kept def text.lower(txt: String) -> String: Ezsys.text.upper (https://jend.leeeet.dev/definition.txt?path=ezsys@0.1.0.0/main.bend&name=text.upper) # the text in uppercase (str.upper) for ASCII, Latin-1, Latin Extended-A, # Greek and Cyrillic; other code points are kept def text.upper(txt: String) -> String: Ezsys.text.pad_right (https://jend.leeeet.dev/definition.txt?path=ezsys@0.1.0.0/main.bend&name=text.pad_right) # the text with spaces after it up to `width` code points (str.ljust) def text.pad_right(txt: String, width: Nat) -> String: Ezsys.text.truncate (https://jend.leeeet.dev/definition.txt?path=ezsys@0.1.0.0/main.bend&name=text.truncate) # the first `width` code points of the text (txt[:width]) def text.truncate(txt: String, width: Nat) -> String: Ezsys.digits.cmp (https://jend.leeeet.dev/definition.txt?path=ezsys@0.1.0.0/main.bend&name=digits.cmp) # two strings of ASCII digits in numeric order, any length def digits.cmp(lhs: String, rhs: String) -> Cmp: Ezsys.dir.list (https://jend.leeeet.dev/definition.txt?path=ezsys@0.1.0.0/main.bend&name=dir.list) # a directory's names, sorted by code point, with no "." or ".."; a failure # to read it is a Fail, never an exit def dir.list( path: String ) -> IO(Result<&1, &1, U32 & String, List<&2, String>>): Ezsys.err.os (https://jend.leeeet.dev/definition.txt?path=ezsys@0.1.0.0/main.bend&name=err.os) # a failed file operation as Python's OSError writes it: # `[Errno 2] No such file or directory: '/tmp/x'` def err.os(code: U32, why: String, path: String) -> String: Clock.Ymd (https://jend.leeeet.dev/definition.txt?path=ezsys@0.1.0.0/src/clock.bend&name=Ymd) # a calendar date type Ymd is Data: Ymd{year: U32, month: U32, day: U32} Clock.time.digit.at (https://jend.leeeet.dev/definition.txt?path=ezsys@0.1.0.0/src/clock.bend&name=time.digit.at) # the k-th decimal digit character (9 for anything past it) def time.digit.at(place: Nat) -> Char: Clock.time.digit (https://jend.leeeet.dev/definition.txt?path=ezsys@0.1.0.0/src/clock.bend&name=time.digit) # the decimal digit of n's last place def time.digit(num: U32) -> Char: Clock.time.civil.month (https://jend.leeeet.dev/definition.txt?path=ezsys@0.1.0.0/src/clock.bend&name=time.civil.month) # the month of a March-based month index (0 is March) def time.civil.month(+mp: U32) -> U32: Clock.time.civil.year (https://jend.leeeet.dev/definition.txt?path=ezsys@0.1.0.0/src/clock.bend&name=time.civil.year) # the calendar year of a March-based year: January and February are the # next calendar year's def time.civil.year(+year: U32, +month: U32) -> U32: Clock.time.civil (https://jend.leeeet.dev/definition.txt?path=ezsys@0.1.0.0/src/clock.bend&name=time.civil) # the year, month and day of a day number (days since 1970-01-01) def time.civil(days: U32) -> Ymd: Clock.time.two (https://jend.leeeet.dev/definition.txt?path=ezsys@0.1.0.0/src/clock.bend&name=time.two) # two decimal places: tens and units def time.two(+num: U32) -> String: Clock.time.three (https://jend.leeeet.dev/definition.txt?path=ezsys@0.1.0.0/src/clock.bend&name=time.three) # three decimal places: hundreds, tens and units def time.three(+num: U32) -> String: Clock.time.four (https://jend.leeeet.dev/definition.txt?path=ezsys@0.1.0.0/src/clock.bend&name=time.four) # four decimal places: thousands, hundreds, tens and units def time.four(+num: U32) -> String: Clock.time.ymd (https://jend.leeeet.dev/definition.txt?path=ezsys@0.1.0.0/src/clock.bend&name=time.ymd) # YYYY-MM-DD def time.ymd(year: U32, month: U32, day: U32) -> String: Clock.time.ymd.of (https://jend.leeeet.dev/definition.txt?path=ezsys@0.1.0.0/src/clock.bend&name=time.ymd.of) # the date of a calendar date def time.ymd.of(date: Ymd) -> String: Clock.time.date (https://jend.leeeet.dev/definition.txt?path=ezsys@0.1.0.0/src/clock.bend&name=time.date) # YYYY-MM-DD of a day number def time.date(days: U32) -> String: Clock.time.clock (https://jend.leeeet.dev/definition.txt?path=ezsys@0.1.0.0/src/clock.bend&name=time.clock) # HH:MM:SS.mmmZ of a second of the day and a millisecond (its last three # decimal places) def time.clock(+sod: U32, ms: U32) -> String: Clock.time.iso (https://jend.leeeet.dev/definition.txt?path=ezsys@0.1.0.0/src/clock.bend&name=time.iso) # ISO 8601 UTC of seconds since the epoch and a millisecond def time.iso(+secs: U32, ms: U32) -> String: Clock.time.iso.of (https://jend.leeeet.dev/definition.txt?path=ezsys@0.1.0.0/src/clock.bend&name=time.iso.of) # ISO 8601 UTC of a clock reading: seconds and milliseconds def time.iso.of(now: U32 & U32) -> String: Clock.Wd (https://jend.leeeet.dev/definition.txt?path=ezsys@0.1.0.0/src/clock.bend&name=Wd) # the days of the week type Wd is Data: Mon{} Tue{} Wed{} Thu{} Fri{} Sat{} Sun{} Clock.time.wd.next (https://jend.leeeet.dev/definition.txt?path=ezsys@0.1.0.0/src/clock.bend&name=time.wd.next) # the next day of the week: Sunday is followed by Monday def time.wd.next(day: Wd) -> Wd: Clock.time.wd.num (https://jend.leeeet.dev/definition.txt?path=ezsys@0.1.0.0/src/clock.bend&name=time.wd.num) # the ISO 8601 weekday number of a day of the week: 1 Monday to 7 Sunday def time.wd.num(day: Wd) -> U32: Clock.time.wd.go (https://jend.leeeet.dev/definition.txt?path=ezsys@0.1.0.0/src/clock.bend&name=time.wd.go) # the day of the week `left` days after `day`, one day at a time def time.wd.go(left: Nat, day: Wd) -> Wd: Clock.time.weekday.nat (https://jend.leeeet.dev/definition.txt?path=ezsys@0.1.0.0/src/clock.bend&name=time.weekday.nat) # the ISO weekday of day `num` after 1970-01-01, a Thursday, counted one # day at a time: the weekday's definition, which time.weekday computes # faster def time.weekday.nat(num: Nat) -> U32: Clock.time.wd.plus (https://jend.leeeet.dev/definition.txt?path=ezsys@0.1.0.0/src/clock.bend&name=time.wd.plus) # two weekdays added as offsets from Monday (Monday is 0, Sunday 6), so # `time.wd.plus(day, off)` is the weekday `off` days after `day` def time.wd.plus(day: Wd, off: Wd) -> Wd: Clock.time.wd.bits (https://jend.leeeet.dev/definition.txt?path=ezsys@0.1.0.0/src/clock.bend&name=time.wd.bits) # the day of the week a word's value in days after a Monday, one bit at a # time from the lowest: the value is the bit plus twice the rest's def time.wd.bits(len: Nat, word: Word(len)) -> Wd: Clock.time.weekday (https://jend.leeeet.dev/definition.txt?path=ezsys@0.1.0.0/src/clock.bend&name=time.weekday) # the ISO weekday of a day number, in 32 steps, one a bit def time.weekday(days: U32) -> U32: Clock.time.jan1 (https://jend.leeeet.dev/definition.txt?path=ezsys@0.1.0.0/src/clock.bend&name=time.jan1) # the day number of 1 January of a year from 1970 on: Howard Hinnant's # days_from_civil for month 1, day 1 def time.jan1(year: U32) -> U32: Clock.time.thursday (https://jend.leeeet.dev/definition.txt?path=ezsys@0.1.0.0/src/clock.bend&name=time.thursday) # the Thursday of a day's ISO week (Monday to Sunday) def time.thursday(+days: U32) -> U32: Clock.time.week.of (https://jend.leeeet.dev/definition.txt?path=ezsys@0.1.0.0/src/clock.bend&name=time.week.of) # the ISO year and week of a week's Thursday: the Thursday's calendar year, # and how many Thursdays of that year it is def time.week.of(+thu: U32, date: Ymd) -> U32 & U32: Clock.time.week (https://jend.leeeet.dev/definition.txt?path=ezsys@0.1.0.0/src/clock.bend&name=time.week) # the ISO 8601 week-numbering year and week of a day number def time.week(+days: U32) -> U32 & U32: Clock.time.iso_week (https://jend.leeeet.dev/definition.txt?path=ezsys@0.1.0.0/src/clock.bend&name=time.iso_week) # the ISO 8601 week-numbering year and week of seconds since the epoch def time.iso_week(+secs: U32) -> U32 & U32: Clock.time.week.text (https://jend.leeeet.dev/definition.txt?path=ezsys@0.1.0.0/src/clock.bend&name=time.week.text) # YYYY-Www of an ISO year and week, as `date +%G-W%V` writes it def time.week.text(week: U32 & U32) -> String: Clock.time.iso_week_text (https://jend.leeeet.dev/definition.txt?path=ezsys@0.1.0.0/src/clock.bend&name=time.iso_week_text) # YYYY-Www of seconds since the epoch def time.iso_week_text(+secs: U32) -> String: Clock.time.fields.of (https://jend.leeeet.dev/definition.txt?path=ezsys@0.1.0.0/src/clock.bend&name=time.fields.of) # a date, a second of the day and a weekday as the civil fields def time.fields.of( date: Ymd, +sod: U32, wd: U32 ) -> U32 & U32 & U32 & U32 & U32 & U32 & U32: Clock.time.fields (https://jend.leeeet.dev/definition.txt?path=ezsys@0.1.0.0/src/clock.bend&name=time.fields) # year, month, day, hour, minute, second and ISO weekday of seconds since # the epoch, in UTC def time.fields(+secs: U32) -> U32 & U32 & U32 & U32 & U32 & U32 & U32: Dir.dir.dot (https://jend.leeeet.dev/definition.txt?path=ezsys@0.1.0.0/src/dir.bend&name=dir.dot) # whether a name is "." or ".." def dir.dot(+name: String) -> Bool: Dir.dir.insert.pick (https://jend.leeeet.dev/definition.txt?path=ezsys@0.1.0.0/src/dir.bend&name=dir.insert.pick) # name before next when it sorts first, else next and the rest with name put # in them def dir.insert.pick( first: Bool, +name: String, +next: String, +ys: List<&2, String>, rest: Unit -> List<&2, String> ) -> List<&2, String>: Dir.dir.insert (https://jend.leeeet.dev/definition.txt?path=ezsys@0.1.0.0/src/dir.bend&name=dir.insert) # a name put into a sorted list, before the first name it does not sort after def dir.insert(+name: String, xs: List<&2, String>) -> List<&2, String>: Dir.dir.sort (https://jend.leeeet.dev/definition.txt?path=ezsys@0.1.0.0/src/dir.bend&name=dir.sort) # a list sorted ascending by String.order (insertion sort) def dir.sort(xs: List<&2, String>) -> List<&2, String>: Dir.dir.keep.pick (https://jend.leeeet.dev/definition.txt?path=ezsys@0.1.0.0/src/dir.bend&name=dir.keep.pick) # a name kept unless it is "." or ".." def dir.keep.pick( dot: Bool, +name: String, rest: Unit -> List<&2, String> ) -> List<&2, String>: Dir.dir.keep (https://jend.leeeet.dev/definition.txt?path=ezsys@0.1.0.0/src/dir.bend&name=dir.keep) # the names that are not "." or "..", in their order def dir.keep(xs: List<&2, String>) -> List<&2, String>: Dir.dir.names (https://jend.leeeet.dev/definition.txt?path=ezsys@0.1.0.0/src/dir.bend&name=dir.names) # what dir.list answers for the raw names a directory read gave def dir.names(raw: List<&2, String>) -> List<&2, String>: Dir.dir.step (https://jend.leeeet.dev/definition.txt?path=ezsys@0.1.0.0/src/dir.bend&name=dir.step) # what dir.list answers for a directory read's answer: its names, or the # failure unchanged def dir.step( res: Result<&1, &1, U32 & String, List<&2, String>> ) -> Result<&1, &1, U32 & String, List<&2, String>>: Errno.err.Table (https://jend.leeeet.dev/definition.txt?path=ezsys@0.1.0.0/src/errno.bend&name=err.Table) # the codes and their texts, reusable def err.Table() -> Data: Errno.err.table (https://jend.leeeet.dev/definition.txt?path=ezsys@0.1.0.0/src/errno.bend&name=err.table) # the common Linux codes and glibc's text for each, as os.strerror gives it def err.table() -> err.Table(): Errno.err.when (https://jend.leeeet.dev/definition.txt?path=ezsys@0.1.0.0/src/errno.bend&name=err.when) # what is written when hit holds, else what the rest writes def err.when(hit: Bool, yes: Unit -> String, no: Unit -> String) -> String: Errno.err.look (https://jend.leeeet.dev/definition.txt?path=ezsys@0.1.0.0/src/errno.bend&name=err.look) # the text of the first pair with the code, or why when there is none def err.look(table: err.Table(), +code: U32, +why: String) -> String: Errno.err.text (https://jend.leeeet.dev/definition.txt?path=ezsys@0.1.0.0/src/errno.bend&name=err.text) # a code's text: the table's, or why when the table does not list it def err.text(+code: U32, +why: String) -> String: Errno.err.quote.pick (https://jend.leeeet.dev/definition.txt?path=ezsys@0.1.0.0/src/errno.bend&name=err.quote.pick) # the quote a path is written between: " when it holds a ' and no ", else ' def err.quote.pick(dq: Bool) -> Char: Errno.err.quote (https://jend.leeeet.dev/definition.txt?path=ezsys@0.1.0.0/src/errno.bend&name=err.quote) # the quote repr picks for a path def err.quote(+path: String) -> Char: Errno.err.hexed (https://jend.leeeet.dev/definition.txt?path=ezsys@0.1.0.0/src/errno.bend&name=err.hexed) # the code points repr writes as \xhh: below U+0020, U+007F to U+00A0, and # U+00AD def err.hexed(+cp: U32) -> Bool: Errno.err.hex.or (https://jend.leeeet.dev/definition.txt?path=ezsys@0.1.0.0/src/errno.bend&name=err.hex.or) # a digit's character, or '0' past the digits def err.hex.or(got: Maybe<&2, Char>) -> Char: Errno.err.hex.digit (https://jend.leeeet.dev/definition.txt?path=ezsys@0.1.0.0/src/errno.bend&name=err.hex.digit) # the lowercase hex digit of a number's last four bits def err.hex.digit(num: U32) -> Char: Errno.err.hex2 (https://jend.leeeet.dev/definition.txt?path=ezsys@0.1.0.0/src/errno.bend&name=err.hex2) # two lowercase hex digits of a number's last eight bits def err.hex2(+cp: U32) -> String: Errno.err.ctl (https://jend.leeeet.dev/definition.txt?path=ezsys@0.1.0.0/src/errno.bend&name=err.ctl) # a control character: \t, \n, \r, or \xhh def err.ctl(+cp: U32) -> String: Errno.err.plain (https://jend.leeeet.dev/definition.txt?path=ezsys@0.1.0.0/src/errno.bend&name=err.plain) # any other character: a backslash or the quote escaped, else itself def err.plain(+qt: Char, +cp: U32) -> String: Errno.err.esc (https://jend.leeeet.dev/definition.txt?path=ezsys@0.1.0.0/src/errno.bend&name=err.esc) # one character of a path between the quote q def err.esc(+qt: Char, chr: Char) -> String: Errno.err.go (https://jend.leeeet.dev/definition.txt?path=ezsys@0.1.0.0/src/errno.bend&name=err.go) # a path's characters between the quote q def err.go(+qt: Char, path: String) -> String: Errno.err.repr (https://jend.leeeet.dev/definition.txt?path=ezsys@0.1.0.0/src/errno.bend&name=err.repr) # a path as Python's repr(str) writes it def err.repr(+path: String) -> String: Errno.err.os (https://jend.leeeet.dev/definition.txt?path=ezsys@0.1.0.0/src/errno.bend&name=err.os) # a failed file operation as Python's OSError writes it def err.os(+code: U32, +why: String, +path: String) -> String: Step.Read (https://jend.leeeet.dev/definition.txt?path=ezsys@0.1.0.0/src/step.bend&name=Read) # after one read: read again with the text so far, or stop with an answer type Read is Type: ReadMore{text: String} ReadStop{answer: Result<&1, &1, U32 & String, String>} Step.Save (https://jend.leeeet.dev/definition.txt?path=ezsys@0.1.0.0/src/step.bend&name=Save) # after the temporary file is written: rename it, or stop with a failure type Save is Type: SaveMove{} SaveStop{error: U32 & String} Step.read.chunk (https://jend.leeeet.dev/definition.txt?path=ezsys@0.1.0.0/src/step.bend&name=read.chunk) # the bytes one read asks for: the file's size, and at least 64 KiB def read.chunk(size: U32) -> U32: Step.read.more (https://jend.leeeet.dev/definition.txt?path=ezsys@0.1.0.0/src/step.bend&name=read.more) # a chunk that is empty ends the file; any other is appended def read.more(empty: Bool, text: String, got: String) -> Read: Step.read.step (https://jend.leeeet.dev/definition.txt?path=ezsys@0.1.0.0/src/step.bend&name=read.step) # what one read's answer means, with the text read before it def read.step(res: Result<&1, &1, U32 & String, String>, got: String) -> Read: Step.read.spent (https://jend.leeeet.dev/definition.txt?path=ezsys@0.1.0.0/src/step.bend&name=read.spent) # the answer when a file has not ended after every read file.read makes def read.spent() -> Result<&1, &1, U32 & String, String>: Step.save.tmp (https://jend.leeeet.dev/definition.txt?path=ezsys@0.1.0.0/src/step.bend&name=save.tmp) # where file.save writes before it renames def save.tmp(path: String) -> String: Step.save.step (https://jend.leeeet.dev/definition.txt?path=ezsys@0.1.0.0/src/step.bend&name=save.step) # what the temporary file's write answer means def save.step(res: Result<&1, &1, U32 & String, Unit>) -> Save: Step.env.pick (https://jend.leeeet.dev/definition.txt?path=ezsys@0.1.0.0/src/step.bend&name=env.pick) # an environment variable's value, or the fallback when it is unset def env.pick( res: Result<&1, &1, U32 & String, String>, fallback: String ) -> String: Str.text.spaces (https://jend.leeeet.dev/definition.txt?path=ezsys@0.1.0.0/src/str.bend&name=text.spaces) # Python's whitespace (str.isspace, str.strip with no argument): the code # points 9 to 13, 28 to 32, 133, 160, 5760, 8192 to 8202, 8232, 8233, 8239, # 8287 and 12288 def text.spaces() -> List<&2, U32>: Str.text.space (https://jend.leeeet.dev/definition.txt?path=ezsys@0.1.0.0/src/str.bend&name=text.space) # whether a character is Python whitespace def text.space(chr: Char) -> Bool: Str.text.lstrip.if (https://jend.leeeet.dev/definition.txt?path=ezsys@0.1.0.0/src/str.bend&name=text.lstrip.if) # a character at the start: dropped when it is whitespace, and the rest # stripped too; else the text is kept from it def text.lstrip.if( sp: Bool, hd: Char, tl: String, more: Unit -> String ) -> String: Str.text.lstrip (https://jend.leeeet.dev/definition.txt?path=ezsys@0.1.0.0/src/str.bend&name=text.lstrip) # the text with its leading whitespace removed def text.lstrip(txt: String) -> String: Str.text.rstrip.lone (https://jend.leeeet.dev/definition.txt?path=ezsys@0.1.0.0/src/str.bend&name=text.rstrip.lone) # a lone last character: gone when it is whitespace def text.rstrip.lone(sp: Bool, hd: Char) -> String: Str.text.rstrip.put (https://jend.leeeet.dev/definition.txt?path=ezsys@0.1.0.0/src/str.bend&name=text.rstrip.put) # a character before the stripped rest: when nothing is left after it, it # goes too if it is whitespace def text.rstrip.put(+hd: Char, rule: String) -> String: Str.text.rstrip (https://jend.leeeet.dev/definition.txt?path=ezsys@0.1.0.0/src/str.bend&name=text.rstrip) # the text with its trailing whitespace removed def text.rstrip(txt: String) -> String: Str.text.strip (https://jend.leeeet.dev/definition.txt?path=ezsys@0.1.0.0/src/str.bend&name=text.strip) # the text with whitespace removed from both ends def text.strip(txt: String) -> String: Str.text.after (https://jend.leeeet.dev/definition.txt?path=ezsys@0.1.0.0/src/str.bend&name=text.after) # how many characters of a separator follow its first def text.after(sep: String) -> Nat: More: https://jend.leeeet.dev/packages/ezsys.txt?definitions_offset=100