Last active
September 25, 2021 17:52
-
-
Save palladin/3bf4630d3dedb83984a04aa78aadbed7 to your computer and use it in GitHub Desktop.
Stream sig
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
type Stream<'T> // abstract type | |
module Stream = | |
// general combinators | |
val map : (Expr<'A> -> Expr<'B>) -> Stream<'A> -> Stream<'B> | |
val collect : (Expr<'A> -> Stream<'B>) -> Stream<'A> -> Stream<'B> | |
val filter : (Expr<'A> -> Expr<bool>) -> Stream<'A> -> Stream<'A> | |
val take : Expr<int> -> Stream<'A> -> Stream<'A> | |
val zipWith : (Expr<'A> -> Expr<'B> -> Expr<'C>) -> Stream<'A> -> Stream<'B> -> Stream<'C> | |
// ... | |
// producers | |
val ofArray : Expr<'A []> -> Stream<'A> | |
val ofList : Expr<'A list> -> Stream<'A> | |
// consumers | |
val length : Stream<'A> -> Expr<int> | |
val toArray : Stream<'A> -> Expr<'A []> | |
val toList : Stream<'A> -> Expr<'A list> | |
// ... | |
// helpers | |
val compile : (Var<'A> -> Expr<'B>) -> ('A -> 'B) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment