NovelIO


Loops

Namespace: NovelFS.NovelIO
Parent Module: IO

IO looping constructs

Functions and values

Function or valueDescription
forever f
Signature: f:IO<'?7449> -> IO<'?7449>
Type parameters: '?7449

Does the action f forever

iterateUntil p x
Signature: p:('?7443 -> bool) -> x:IO<'?7443> -> IO<'?7443>
Type parameters: '?7443

Execute an action repeatedly until its result satisfies a predicate and return that result (discarding all others).

iterateUntilM p f v
Signature: p:('?7441 -> bool) -> f:('?7441 -> IO<'?7441>) -> v:'?7441 -> IO<'?7441>
Type parameters: '?7441

Yields the result of applying f until p holds.

iterateWhile p x
Signature: p:('?7445 -> bool) -> x:IO<'?7445> -> IO<'?7445>
Type parameters: '?7445

Execute an action repeatedly until its result fails to satisfy a predicate and return that result (discarding all others).

iterUntilM pAct f
Signature: pAct:IO<bool> -> f:IO<'a> -> IO<unit>
Type parameters: 'a

Execute an action repeatedly until the given boolean IO action returns true

iterWhileM pAct act
Signature: pAct:IO<bool> -> act:IO<'a> -> IO<unit>
Type parameters: 'a

Execute an action repeatedly as long as the given boolean IO action returns true

skipWhileM p xs
Signature: p:('?7428 -> IO<bool>) -> xs:'?7428 list -> IO<'?7428 list>
Type parameters: '?7428

Drop elements repeatedly while a condition is met

takeWhileM p xs
Signature: p:('?7426 -> IO<bool>) -> xs:'?7426 list -> IO<'?7426 list>
Type parameters: '?7426

Take elements repeatedly while a condition is met

unfoldWhileM p f
Signature: p:('a -> bool) -> f:IO<'a> -> IO<'a list>
Type parameters: 'a

Repeatedly evaluates the second argument while the value satisfies the given predicate, and returns a list of all values that satisfied the predicate. Discards the final one (which failed the predicate).

untilM pAct f
Signature: pAct:IO<bool> -> f:IO<'a> -> IO<'a list>
Type parameters: 'a

Execute an action repeatedly until the given boolean IO action returns true

whileM pAct f
Signature: pAct:IO<bool> -> f:IO<'a> -> IO<'a list>
Type parameters: 'a

Execute an action repeatedly as long as the given boolean IO action returns true

whileSome act binder
Signature: act:IO<'?7438 option> -> binder:('?7438 -> IO<'?7439>) -> IO<'?7439 list>
Type parameters: '?7438, '?7439

As long as the supplied "Maybe" expression returns "Some _", each element will be bound using the value contained in the 'Some'. Results are collected into a sequence.

Fork me on GitHub