anchor.diff:  open FsCheck
   
   let inline (==>) a b = global.Fake.AdditionalSyntax.(==>) a b
  +
  +let (|Target|) (t : Target) =
  +    Target t.Name
  +
  +let (|TargetSet|) (t : seq<Target>) =
  +    let list = t |> Seq.map (fun t -> t.Name) |> Seq.sort |> Seq.toList
  +    TargetSet list
   
   // checks whether the given order is consistent with all dependencies
   let validateBuildOrder (order : list<Target[]>) (rootTarget : string) =
  
positive.code:     validateBuildOrder order "dep"
  
      match order with
          | [f; [|d|]] ->
              
              let set = f |> Seq.map (fun a -> a.Name) |> Set.ofSeq
              let valid = set = Set.ofList ["a"; "b"; "c"]
  
              if not valid then 
                  failwithf "unexpected build order: %A" order
  
              if d.Name <> "dep" then
                  failwithf "unexpected build order: %A" order
  
          | _ ->
              failwithf "inconsitent order: %A" order
  
negative.code:     validateBuildOrder order "d"
  
      match order with
          | [[|Target "a"|];TargetSet ["b"; "c"];[|Target "d"|]] ->
              // as expected
              ()
  
          | _ ->
              failwithf "unexpected order: %A" order
  