anchor.diff:      /// Wraps computations in an error handling computation expression.
       let trial = ErrorHandlingBuilder()
   
  +/// Represents the result of an async computation
   type AsyncResult<'a, 'b> = 
       | AR of Async<Result<'a, 'b>>
   
  +/// Useful functions for combining error handling computations with async computations.
   [<AutoOpen>]
   module AsyncExtensions = 
  +    /// Useful functions for combining error handling computations with async computations.
       [<RequireQualifiedAccess>]
       module Async = 
  +        /// Creates an async computation that return the given value
           let singleton value = value |> async.Return
  +
  +        /// Creates an async computation that runs a computation and
  +        /// when it generates a result run a binding function on the said result
           let bind f x = async.Bind(x, f)
  +
  +        /// Creates an async computation that runs a mapping function on the result of an async computation
           let map f x = x |> bind (f >> singleton)
  +
  +        /// Creates an async computation from an asyncTrial computation
           let ofAsyncResult (AR x) = x
   
  +/// Basic support for async error handling computation
   [<AutoOpen>]
   module AsyncTrial = 
  +    /// Builder type for error handling in async computation expressions.
       type AsyncTrialBuilder() = 
  -        
           member __.Return value : AsyncResult<'a, 'b> = 
               value
               |> ok
  
positive.code:     /// Otherwise the exisiting error messages are propagated.
      let inline apply wrappedFunction result = 
          match wrappedFunction, result with
          | Ok(f, msgs1), Ok(x, msgs2) -> Ok(f x, msgs1 @ msgs2)
          | Fail errs, Ok(_, msgs) -> Fail(errs)
          | Ok(_, msgs), Fail errs -> Fail(errs)
          | Fail errs1, Fail errs2 -> Fail(errs1)
  
      /// If the wrapped function is a success and the given result is a success the function is applied on the value. 
  
negative.code: open System.Runtime.CompilerServices
  open Chessie.ErrorHandling
  
  /// Extensions methods for easier C# usage.
  [<Extension>]
  type ResultExtensions () =
      /// Allows pattern matching on Results from C#.
      [<Extension>]
      static member inline Match(value, ifSuccess:Action<'TSuccess , ('TMessage list)>, ifFailure:Action<'TMessage list>) =
          match value with
          | Okay(x, msgs) -> ifSuccess.Invoke(x,msgs)
          | Fail(msgs) -> ifFailure.Invoke(msgs)
      
      /// Allows pattern matching on Results from C#.
      [<Extension>]
      static member inline Either(value, ifSuccess:Func<'TSuccess , ('TMessage list),'TResult>, ifFailure:Func<'TMessage list,'TResult>) =
          match value with
          | Okay(x, msgs) -> ifSuccess.Invoke(x,msgs)
          | Fail(msgs) -> ifFailure.Invoke(msgs)
  
      /// Lifts a Func into a Result and applies it on the given result.
      [<Extension>]
      static member inline Map(value,func:Func<_,_>) =
          lift func.Invoke value
  
      /// Collects a sequence of Results and accumulates their values.
      /// If the sequence contains an error the error will be propagated.
      [<Extension>]
      static member inline Collect(values) =
          collect values
  
      /// Collects a sequence of Results and accumulates their values.
      /// If the sequence contains an error the error will be propagated.
      [<Extension>]
      static member inline Flatten(value) : Result<seq<'a>,'b>=
          match value with
          | Okay(values:Result<'a,'b> seq, msgs:'b list) -> 
              match collect values with
              | Okay(values,msgs) -> Okay(values |> List.toSeq,msgs)
              | Fail(msgs:'b list) -> Fail msgs
          | Fail(msgs:'b list) -> Fail msgs
  
      /// If the result is a Success it executes the given Func on the value.
      /// Otherwise the exisiting failure is propagated.
      [<Extension>]
      static member inline SelectMany (o, f: Func<_,_>) =
          bind f.Invoke o
  
      /// If the result is a Success it executes the given Func on the value.
      /// If the result of the Func is a Succes it maps it using the given Func.
      /// Otherwise the exisiting failure is propagated.
      [<Extension>]
      static member SelectMany (o, f: Func<_,_>, mapper: Func<_,_,_>) =
          let mapper = lift2 (fun a b -> mapper.Invoke(a,b))
          let v = bind f.Invoke o
          mapper o v
  
      /// Lifts a Func into a Result and applies it on the given result.
      [<Extension>]
      static member Select (o, f: Func<_,_>) = lift f.Invoke o
  
  