package monadlib
Module type Monad.LazyPlus
This is the counterpart for the lazy version of BasePlus.
include MonadPlus with type 'a m := 'a m
include BasePlus with type 'a m := 'a m
include BatInterfaces.Monad with type 'a m := 'a m
val zero : unit -> 'a mval null : 'a m -> boolnull x implies that x is zero. If you do not want to or cannot answer whether a given x is zero, then null x should be false. I have provided this so that streams can be implemented more efficiently.
val of_list : 'a list -> 'a mGeneralises matrix transposition. This will loop infinitely if BasePlus.null cannot answer true for zeroes.
val of_llist : 'a LazyList.t -> 'a mval lsum : 'a LazyList.t m -> 'a mval lmsum : 'a m LazyList.t -> 'a mval ltranspose : 'a LazyList.t m -> 'a m LazyList.tGeneralises matrix transposition. You don't necessarily have to worry about correctly implementing BaseLazyPlus.null for this function, since the return value can happily be infinite.