anchor.diff:                          | _ -> raise (ArgumentException("Bug in frequency function"))
       in gen.Bind(choose (1,tot), fun n -> pick n xs)  
   
  +///Lift the given function over values to a function over generators of those values.
   let liftGen f = fun a -> gen {  let! a' = a
                                   return f a' }
   
  +///Lift the given function over values to a function over generators of those values.
   let liftGen2 f = fun a b -> gen {   let! a' = a
                                       let! b' = b
                                       return f a' b' }
                                       
  +///Build a generator that generates a 2-tuple of the values generated by the given generator.
   let two g = liftGen2 (fun a b -> (a,b)) g g
   
  +///Lift the given function over values to a function over generators of those values.
   let liftGen3 f = fun a b c -> gen { let! a' = a
                                       let! b' = b
                                       let! c' = c
                                       return f a' b' c' }
  +
  +///Build a generator that generates a 3-tuple of the values generated by the given generator.
   let three g = liftGen3 (fun a b c -> (a,b,c)) g g g
   
  +///Lift the given function over values to a function over generators of those values.
   let liftGen4 f = fun a b c d -> gen {   let! a' = a
                                           let! b' = b
                                           let! c' = c
                                           let! d' = d
                                           return f a' b' c' d' }
  +
  +///Build a generator that generates a 4-tuple of the values generated by the given generator.
   let four g = liftGen4 (fun a b c d -> (a,b,c,d)) g g g g
   
  -let fraction (a:int) (b:int) (c:int) = 
  +let private fraction (a:int) (b:int) (c:int) = 
       double a + ( double b / abs (double c)) + 1.0 
   
  +///Sequence the given list of generators into a generator of a list.
  +///Note to QuickCheck users: this is monadic sequence, which cannot be expressed generally in F#.
   let rec sequence l = match l with
                               | [] -> gen { return [] }
                               | c::cs -> gen {let! x = c
                                               let! xs = sequence cs
                                               return  x::xs } 
   
  +///Generates a list of given length, containing values generated by the given generator.
  +///vector g n generates a list of n t's, if t is the type that g generates.
   let vector arbitrary n = sequence [ for i in 1..n -> arbitrary ]
   
  -let promote f = Gen (fun n r -> fun a -> let (Gen m) = f a in m n r)
  -
  +let private promote f = Gen (fun n r -> fun a -> let (Gen m) = f a in m n r)
  +
  +///Basic co-arbitrary generator, which is dependent on an int.
   let variant = fun v (Gen m) ->
       let rec rands r0 = seq { let r1,r2 = split r0 in yield! Seq.cons r1 (rands r2) } 
       Gen (fun n r -> m n (Seq.nth (v+1) (rands r)))
   
  +///A collection of default generators.
   type Gen =
  +    ///Generates (), of hte unit type.
       static member Unit = gen { return () }
  +    ///Generates arbitrary bools
       static member Bool = elements [true; false]
  +    ///Generates arbitrary ints, between -n and n where n is the test size.
       static member Int = sized <| fun n -> choose (-n,n)
  +    ///Generates arbitrary floats, NaN included fairly frequently.
       static member Float = liftGen3 fraction Gen.Int Gen.Int Gen.Int
  +    ///Generates arbitrary chars, between ASCII codes Char.MinValue and 127.
       static member Char = (choose (int Char.MinValue, 127)).Map char 
  +    ///Generates arbitrary strings, which are lists of chars generated by Char.
       static member String = (Gen.List(Gen.Char)).Map (fun chars -> new String(List.to_array chars))
  +    ///Generates arbitrary objects, which are generated by Unit, Bool, Int, Float or Char and then cast.
       static member Object = 
           oneof [ (Gen.Unit :> IGen).AsGenObject;
                   (Gen.Bool :> IGen).AsGenObject;
                   (Gen.Int :> IGen).AsGenObject; 
                   (Gen.Float :> IGen).AsGenObject;
                   (Gen.Char :> IGen).AsGenObject ]
  -    static member Tuple(a,b) = liftGen2 (fun x y -> (x,y)) a b
  -    static member Tuple(a,b,c) = liftGen3 (fun x y z -> (x,y,z)) a b c 
  -    static member Tuple(a,b,c,d) = liftGen4 (fun x y z w -> (x,y,z,w)) a b c d
  +    ///Genereate a 2-tuple consisting of values generated out of the given generators.
  +    static member Tuple(a:Gen<'a>,b:Gen<'b>) = liftGen2 (fun x y -> (x,y)) a b
  +    ///Genereate a 2-tuple consisting of values generated out of the given generators.
  +    static member Tuple(a:Gen<'a>,b:Gen<'b>,c:Gen<'c>) = liftGen3 (fun x y z -> (x,y,z)) a b c 
  +    ///Genereate a 2-tuple consisting of values generated out of the given generators.
  +    static member Tuple(a:Gen<'a>,b:Gen<'b>,c:Gen<'c>,d:Gen<'d>) = liftGen4 (fun x y z w -> (x,y,z,w)) a b c d
  +    ///Generate an option value, based on the value generated by the given generator.
       static member Option(a) = 
  -        let arbMaybe size = 
  +        let arbOption size = 
               match size with
                   | 0 -> gen { return None }
                   | n -> (a |> resize (n-1)).Map(Some) 
  -        in sized arbMaybe
  +        in sized arbOption
  +    ///Generate a list of values generated by the given generator. The size of the list is between 0 and the test size.
       static member List<'a>(a : Gen<'a>) : Gen<list<'a>> = sized (fun n -> gen.Bind(choose(0,n), vector a))
  +    ///Generate a function value, based on the given co-arbitrary generator and result generator.
       static member Arrow(coa,genb) = promote (fun a -> coa a genb)  
   
   
  
positive.code:               runner  = consoleRunner } 
           
  let verbose = 
      { quick with every = fun n args -> any_to_string n + ":\n" + (List.fold_left (fun b a -> a + "\n" + b) "" args)  }
  
  let quickCheck p = p |> check quick
  let verboseCheck p = p |> check verbose
  
negative.code: let evaluate (Prop gen) = gen
  
  let forAll gn body = 
      let argument a res = { res with arguments = (box a) :: res.arguments } in
      Prop <|  gen { let! a = gn
                     let! res = (evaluate (body a))
                     return (argument a res) }
  