(** The infamous [Util] module. A graveyard of broken expressions. *) open Base (** [f &> g] composes [g] with [f] to obrain [fun x -> g (f x)]; in other words, it applies [f] {i and then} [g]. @param f the first funtion to apply. @param g the second function to apply. @return the composition of [g] with [f]. *) let ( &> ) f g = Fn.compose g f (** Turn a sequence of bytes into a sequence. @param b the input bytes. @return a sequence of bytes. *) let sequence_of_bytes (b : Bytes.t) : char Sequence.t = let open Sequence.Generator in let traverse b = let len = Bytes.length b in let rec loop i _ = if i >= len then return () else yield (Bytes.get b i) >>= loop (i + 1) in loop 0 () in traverse b |> run