Resumable monad examples
1:
|
|
Simple resumable calculations
1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25: 26: 27: 28: 29: |
|
While loop
1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: |
|
Another while loop
1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: |
|
Resumable service request handler
1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25: 26: 27: 28: 29: 30: 31: 32: 33: 34: 35: 36: 37: 38: 39: 40: 41: 42: 43: 44: 45: 46: 47: 48: 49: 50: 51: 52: 53: 54: 55: |
|
module Example
module Zero
namespace ResumableMonad
module Multipstep
from ResumableMonad
Multistep resumable monad where a resumable expression is encoded as a
mapping from the trace history type 'h to the expression's return type 't.
from ResumableMonad
Multistep resumable monad where a resumable expression is encoded as a
mapping from the trace history type 'h to the expression's return type 't.
val x1 : Resumable<int>
Full name: Example.x1
Full name: Example.x1
val resumable : ResumableBuilder
Full name: ResumableMonad.Multipstep.resumable
Full name: ResumableMonad.Multipstep.resumable
val x2 : Resumable<int option,int>
Full name: Example.x2
Full name: Example.x2
val y : int
val example : Resumable<(int option * int option),int>
Full name: Example.example
Full name: Example.example
val x : int
val example2 : Resumable<(int option * (int option * int option) * int option),int>
Full name: Example.example2
Full name: Example.example2
member Resumable.resume : h:'h -> 't
union case Option.None: Option<'T>
union case Option.Some: Value: 'T -> Option<'T>
val getZeroTyped<'X> : 'X
Full name: Zero.getZeroTyped
Full name: Zero.getZeroTyped
val x : int ref
Full name: Example.WhileTest.x
Full name: Example.WhileTest.x
Multiple items
val ref : value:'T -> 'T ref
Full name: Microsoft.FSharp.Core.Operators.ref
--------------------
type 'T ref = Ref<'T>
Full name: Microsoft.FSharp.Core.ref<_>
val ref : value:'T -> 'T ref
Full name: Microsoft.FSharp.Core.Operators.ref
--------------------
type 'T ref = Ref<'T>
Full name: Microsoft.FSharp.Core.ref<_>
val m : Resumable<int * bool>
Full name: Example.WhileTest.m
Full name: Example.WhileTest.m
val printfn : format:Printf.TextWriterFormat<'T> -> 'T
Full name: Microsoft.FSharp.Core.ExtraTopLevelOperators.printfn
Full name: Microsoft.FSharp.Core.ExtraTopLevelOperators.printfn
val incr : cell:int ref -> unit
Full name: Microsoft.FSharp.Core.Operators.incr
Full name: Microsoft.FSharp.Core.Operators.incr
val s1 : int * bool
Full name: Example.WhileTest.s1
Full name: Example.WhileTest.s1
property Resumable.resume: unit -> int * bool
val m2 : Resumable<(int * bool) option,int>
Full name: Example.WhileTest2.m2
Full name: Example.WhileTest2.m2
val z : int
val f : bool
module WhileTest
from Example
from Example
val s1 : int
Full name: Example.WhileTest2.s1
Full name: Example.WhileTest2.s1
val s2 : int
Full name: Example.WhileTest2.s2
Full name: Example.WhileTest2.s2
val y : int ref
Full name: Example.IfTest.y
Full name: Example.IfTest.y
val iftest : Resumable<int * bool>
Full name: Example.IfTest.iftest
Full name: Example.IfTest.iftest
val s1 : int * bool
Full name: Example.IfTest.s1
Full name: Example.IfTest.s1
module MyResumableService
from Example
from Example
val getMachineName : unit -> string
Full name: Example.MyResumableService.Environment.getMachineName
Full name: Example.MyResumableService.Environment.getMachineName
val machineName : string
namespace System
type Console =
static member BackgroundColor : ConsoleColor with get, set
static member Beep : unit -> unit + 1 overload
static member BufferHeight : int with get, set
static member BufferWidth : int with get, set
static member CapsLock : bool
static member Clear : unit -> unit
static member CursorLeft : int with get, set
static member CursorSize : int with get, set
static member CursorTop : int with get, set
static member CursorVisible : bool with get, set
...
Full name: System.Console
static member BackgroundColor : ConsoleColor with get, set
static member Beep : unit -> unit + 1 overload
static member BufferHeight : int with get, set
static member BufferWidth : int with get, set
static member CapsLock : bool
static member Clear : unit -> unit
static member CursorLeft : int with get, set
static member CursorSize : int with get, set
static member CursorTop : int with get, set
static member CursorVisible : bool with get, set
...
Full name: System.Console
System.Console.ReadLine() : string
val provisionVM : machineName:string -> int
Full name: Example.MyResumableService.Environment.provisionVM
Full name: Example.MyResumableService.Environment.provisionVM
val requestId : int
Multiple items
type Random =
new : unit -> Random + 1 overload
member Next : unit -> int + 2 overloads
member NextBytes : buffer:byte[] -> unit
member NextDouble : unit -> float
Full name: System.Random
--------------------
System.Random() : unit
System.Random(Seed: int) : unit
type Random =
new : unit -> Random + 1 overload
member Next : unit -> int + 2 overloads
member NextBytes : buffer:byte[] -> unit
member NextDouble : unit -> float
Full name: System.Random
--------------------
System.Random() : unit
System.Random(Seed: int) : unit
val vmRequestSucceeded : (int -> bool)
Full name: Example.MyResumableService.Environment.vmRequestSucceeded
Full name: Example.MyResumableService.Environment.vmRequestSucceeded
val waitTime : int ref
val aux : (int -> bool)
val myServiceApi : Resumable<(string option * (int option * bool option)),(string * int * bool)>
Full name: Example.MyResumableService.myServiceApi
Full name: Example.MyResumableService.myServiceApi
module Environment
from Example.MyResumableService
from Example.MyResumableService
val vmready : bool
val not : value:bool -> bool
Full name: Microsoft.FSharp.Core.Operators.not
Full name: Microsoft.FSharp.Core.Operators.not
namespace System.Threading
Multiple items
type Thread =
inherit CriticalFinalizerObject
new : start:ThreadStart -> Thread + 3 overloads
member Abort : unit -> unit + 1 overload
member ApartmentState : ApartmentState with get, set
member CurrentCulture : CultureInfo with get, set
member CurrentUICulture : CultureInfo with get, set
member DisableComObjectEagerCleanup : unit -> unit
member ExecutionContext : ExecutionContext
member GetApartmentState : unit -> ApartmentState
member GetCompressedStack : unit -> CompressedStack
member GetHashCode : unit -> int
...
Full name: System.Threading.Thread
--------------------
System.Threading.Thread(start: System.Threading.ThreadStart) : unit
System.Threading.Thread(start: System.Threading.ParameterizedThreadStart) : unit
System.Threading.Thread(start: System.Threading.ThreadStart, maxStackSize: int) : unit
System.Threading.Thread(start: System.Threading.ParameterizedThreadStart, maxStackSize: int) : unit
type Thread =
inherit CriticalFinalizerObject
new : start:ThreadStart -> Thread + 3 overloads
member Abort : unit -> unit + 1 overload
member ApartmentState : ApartmentState with get, set
member CurrentCulture : CultureInfo with get, set
member CurrentUICulture : CultureInfo with get, set
member DisableComObjectEagerCleanup : unit -> unit
member ExecutionContext : ExecutionContext
member GetApartmentState : unit -> ApartmentState
member GetCompressedStack : unit -> CompressedStack
member GetHashCode : unit -> int
...
Full name: System.Threading.Thread
--------------------
System.Threading.Thread(start: System.Threading.ThreadStart) : unit
System.Threading.Thread(start: System.Threading.ParameterizedThreadStart) : unit
System.Threading.Thread(start: System.Threading.ThreadStart, maxStackSize: int) : unit
System.Threading.Thread(start: System.Threading.ParameterizedThreadStart, maxStackSize: int) : unit
System.Threading.Thread.Sleep(timeout: System.TimeSpan) : unit
System.Threading.Thread.Sleep(millisecondsTimeout: int) : unit
System.Threading.Thread.Sleep(millisecondsTimeout: int) : unit
property Resumable.initial: string option * (int option * bool option)
Returns the empty history (no caching point are initialized)
Returns the empty history (no caching point are initialized)