# Parser.TakeWhile

Consumes zero or more characters from an allowed union.

## Signatures

```ts
interface TakeWhile<Allowed extends string> extends TypeFunction<string, Result<string, string>> {
    readonly return: InputOf<this> extends infer Input extends string ? TakeWhileInternal<Input, Allowed> : never;
}
```

## Why

It preserves the precise consumed prefix and remaining suffix.

## Ownership and lifetime

TypeScript instantiates `TakeWhile` while parsing a string-literal input; partial results and unconsumed text exist only in the resulting type.

## Property: return

Computes this type lambda's parse result for its current input.

## Property: return: Why

The local type-function protocol evaluates each parser combinator through this member without a parallel runtime object.

## Property: return: Ownership and lifetime

TypeScript evaluates `TakeWhile.return` when the surrounding parser is applied; the associated result is erased and retains no input at runtime.
