anchor.diff:                  i <- i + 1
               result
   
  +
  +    /// Returns true if one array has another as its subset from index 0.
  +    let startsWith (prefix: _ []) (whole: _ []) =        
  +        if isNull prefix || isNull whole then false
  +        elif prefix.Length = 0 then true
  +        elif prefix.Length > whole.Length then false
  +        elif prefix.Length = whole.Length then areEqual prefix whole
  +        else areEqual whole.[0..prefix.Length-1] prefix
  +
  +
  +    /// Returns true if one array has trailing elements equal to another's.
  +    let endsWith (suffix: _ []) (whole: _ []) =
  +        if isNull suffix || isNull whole then false
  +        elif suffix.Length = 0 then true
  +        elif suffix.Length > whole.Length then false
  +        elif suffix.Length = whole.Length then areEqual suffix whole
  +        else areEqual whole.[whole.Length-suffix.Length..whole.Length-1] suffix
  +
  +
  +    /// Returns a new array with an element replaced with a given value.
  +    let replace index value (arr: _ []) =
  +        if index >= arr.Length then raise (IndexOutOfRangeException "index")
  +        let res = Array.copy arr
  +        res.[index] <- value
  +        res
  +
  +    /// Returns all heads of a given array.
  +    /// For [|1;2;3|] it returns [|[|1; 2; 3|]; [|1; 2|]; [|1|]|]
  +    let heads (array: 'T []) =
  +        let res = Array.zeroCreate<'T[]> array.Length
  +        for i = array.Length - 1 downto 0 do
  +            res.[i] <- array.[0..i]
  +        res
  +
  +    /// Fold over the array passing the index and element at that index to a folding function
  +    let foldi (folder : 'State -> int -> 'T -> 'State) (state : 'State) (array : 'T[]) =
  +        let folder = OptimizedClosures.FSharpFunc<_,_,_,_>.Adapt folder
  +        let mutable state = state
  +        let len = array.Length
  +        for i = 0 to len - 1 do
  +            state <- folder.Invoke (state, i, array.[i])
  +        state
  +
  +    open System.Collections.Generic
  +
  +    /// Returns an array that contains no duplicate entries according to generic hash and
  +    /// equality comparisons on the entries.
  +    /// If an element occurs multiple times in the array then the later occurrences are discarded.
  +    let distinct (array:'T[]) =
  +        checkNonNull "array" array
  +        let temp = Array.zeroCreate array.Length
  +        let mutable i = 0
  +
  +        let hashSet = HashSet<'T>(HashIdentity.Structural<'T>)
  +        for v in array do 
  +            if hashSet.Add(v) then
  +                temp.[i] <- v
  +                i <- i + 1
  +
  +        Array.sub temp 0 i 
  +
  +
  +
   [<RequireQualifiedAccess>]
   [<CompilationRepresentation(CompilationRepresentationFlags.ModuleSuffix)>]
   module Option =
  
positive.code:     Debug.Listeners.Add(new TextWriterTraceListener(System.Console.Out)) |> ignore
      Debug.AutoFlush <- true
  #endif
      /// obj.ReferenceEquals
      let inline (==) a b = obj.ReferenceEquals(a, b)
      /// LanguagePrimitives.PhysicalEquality
      let inline (===) a b = LanguagePrimitives.PhysicalEquality a b
      let inline debug msg = Printf.kprintf Debug.WriteLine msg
      let inline fail msg = Printf.kprintf Debug.Fail msg
      let inline isNull v = match v with | null -> true | _ -> false
      let inline isNotNull v = v |> (not << isNull)
  
      let maybe = MaybeBuilder()
      let asyncMaybe = AsyncMaybeBuilder()
  
negative.code: 
  open System
  open System.Diagnostics
  
  
  [<AutoOpen>]
  module Prelude =
      /// obj.ReferenceEquals
      let inline (==) a b = obj.ReferenceEquals(a, b)
      /// LanguagePrimitives.PhysicalEquality
      let inline (===) a b = LanguagePrimitives.PhysicalEquality a b
      let inline debug msg = Printf.kprintf Debug.WriteLine msg
      let inline fail msg = Printf.kprintf Debug.Fail msg
      let inline isNull v = match v with | null -> true | _ -> false
      let inline isNotNull v = v |> (not << isNull)
  
  [<RequireQualifiedAccess>]
  [<CompilationRepresentation(CompilationRepresentationFlags.ModuleSuffix)>]
  