Created
July 30, 2013 14:00
-
-
Save netogallo/6113147 to your computer and use it in GitHub Desktop.
Type things
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
| and FusionType<'a> = {index : int;value : 'a []} | |
| and [<Sealed>] StreamFusion<'a> [<JavaScript>] (s : Stream<'a []>) = | |
| [<JavaScript>] | |
| let mutable lastGood = | |
| match s.Latest with | |
| | Success xs -> Array.map (fun x -> Success x) xs | |
| | Failure msg -> Array.init 1 (fun _ -> Failure msg) | |
| [<JavaScript>] | |
| let fixBounds size = | |
| if size < lastGood.Length then () | |
| else | |
| let old = Array.map id lastGood | |
| lastGood <- Array.init size (fun i -> if i < old.Length | |
| then old.[i] | |
| else Failure []) | |
| let helperStream : Stream<FusionType<'a>> = | |
| match s.Latest with | |
| | Success v -> BaseStream<FusionType<'a>> ({index=0;value = v} |> Success) | |
| //| Failure msgs -> BaseStream(Failure msgs) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment