package zar

  1. Overview
  2. Docs
Legend:
Page
Library
Module
Module type
Parameter
Class
Class type
Source

Module ZarSource

Sourcetype 'a stream =
  1. | SCons of 'a * unit -> 'a stream

Streams / Lazy infinite lists.

Sourceval first : 'a stream -> 'a

First element (head) of a stream.

Sourceval rest : 'a stream -> 'a stream

Rest (tail) of a stream.

Sourceval take : int -> 'a stream -> 'a list

Take the first n elements of a stream.

Sourceval drop : int -> 'a stream -> 'a stream

Drop the first n elements of a stream.

Sourceval map : ('a -> 'b) -> 'a stream -> 'b stream

Map a function over a stream.

Sourceval scons : 'a -> 'a stream -> 'a stream

Build a stream from a head and tail.

Sourceval bits : unit -> bool stream

Default implementation of uniformly distributed random bit stream.

Sourceval seed : unit -> unit

Initialize PRNG used for default implementation of bit stream.

Sourceval coin_transformer : int -> int -> bool stream -> bool stream

Coin stream transformer.

Sourceval die_transformer : int -> bool stream -> int stream

Die stream transformer.

Sourceval findist_transformer : int list -> bool stream -> int stream

Findist stream transformer.

Sourceval coin : int -> int -> bool stream

Coin stream (applied to bits).

Sourceval die : int -> int stream

Die stream (applied to bits).

Sourceval findist : int list -> int stream

Findist stream (applied to bits).