anchor.diff:          //This is not something you call yourself
           //In this case, we construct the machine ourselves so don't need this
           member this.Create c s =
  -            Done
  +            printfn "Counter %i" state
  +            Ok
   
           //When a machine is ready to run
           //This corresponds to a socket ready call
  
positive.code:     abstract member Wakeup :    'c -> 's -> Response<'m>
      abstract member Timeout :   'c -> 's -> Response<'m>
  
  type Counter<'c, 's> (s) =
      //Our mutable state
      let mutable state = s
  
negative.code:         member this.Timeout c s =
              Done
  
  //An anonymous machine
  let machine s =
      let mutable state = Some(s)
      { 
          new IMachine<unit, unit> with
              member this.Create c s =
                  printfn "Anonymous"
                  Ok
              member this.Ready c s =
                  Done
              member this.Wakeup c s =
                  match state with
                  | Some(s) -> 
                              printfn "%s" s
                              state <- None
                              Deadline(TimeSpan.FromSeconds(1.0))
                  | None -> Done
              member this.Timeout c s =
                  Done 
      }
  
  [<EntryPoint>]
  let main argv = 
      //Build some machines and iterate over them
      let machines = [ 
          Counter(3) :> IMachine<unit, unit>; 
          Nothing() :> IMachine<unit, unit>;
          machine "1";
          machine "2";
          //An inline machine
          { 
              new IMachine<unit, unit> with
                  member this.Create c s =
                      printfn "Inline"
                      Ok
                  member this.Ready c s =
                      Done
                  member this.Wakeup c s =
                      Done
                  member this.Timeout c s =
                      Done 
          };
      ]
  
      //Example of running some machines
      machines 
      |> List.iter(
          fun m -> 
              let created = m.Create () ()
              match created with
              | Ok -> 
                      let rec run (m: IMachine<_,_>) =
                          match (m.Wakeup () ()) with
                          | Error e -> printfn "Error: %s" e
                          | Done -> printfn "Done"
                          | _ -> printfn "Still Working..."
                                 run m
                      run m
              | _ -> ()
         )
  
  