anchor.diff:  open QuotationCompiler.Simple
   open Aardvark.Base.Incremental
   
  -
  -module NewestAg =
  -    open Microsoft.FSharp.Quotations
  -    open Microsoft.FSharp.Quotations.Patterns
  -    open Microsoft.FSharp.Quotations.ExprShape
  -    open System.Runtime.CompilerServices
  -
  -    type AttributeKind =
  -        | None          = 0x00
  -        | Inherited     = 0x01
  -        | Synthesized   = 0x02
  -        | Mixed         = 0x03
  -
  +module Ag =
  +    [<AutoOpen>]
  +    module Frontend =
  +        type AttributeKind =
  +            | None          = 0x00
  +            | Inherited     = 0x01
  +            | Synthesized   = 0x02
  +            | Mixed         = 0x03
  +
  +        [<AttributeUsage(AttributeTargets.Class, AllowMultiple = false)>]
  +        type SemanticAttribute() = 
  +            inherit Attribute()
  +
  +        [<AttributeUsage(AttributeTargets.Property ||| AttributeTargets.Method, AllowMultiple = false); AllowNullLiteral>]
  +        type AttributeAttribute(name : string, kind : AttributeKind) =
  +            inherit Attribute()
  +
  +            member x.Name = name
  +            member x.Kind = kind
  +
  +            new(kind : AttributeKind) = AttributeAttribute(null, kind)
  +
  +        type Root<'a> = class end
           
  -    [<AttributeUsage(AttributeTargets.Class, AllowMultiple = false)>]
  -    type SemanticAttribute() = inherit Attribute()
  -
  -    [<AttributeUsage(AttributeTargets.Property ||| AttributeTargets.Method, AllowMultiple = false); AllowNullLiteral>]
  -    type AttributeAttribute(name : string, kind : AttributeKind) =
  -        inherit Attribute()
  -
  -        member x.Name = name
  -        member x.Kind = kind
  -
  -        new(kind : AttributeKind) = AttributeAttribute(null, kind)
  -
  -    type Root<'a> = class end
  -
  -    type SemanticFunction =
  -        {
  -            name        : string
  -            kind        : AttributeKind
  -            original    : MethodInfo
  -            nodeType    : Type
  -            code        : Expr
  -            isRoot      : bool
  -            inherits    : Set<string>
  -            synthesizes : Set<string>
  -        }
  -
  -    type SemanticFunctions =
  -        {
  -            index           : int
  -            name            : string
  -            kind            : AttributeKind
  -            valueType       : Type
  -            functions       : list<SemanticFunction>
  -        }
  -
  -    [<AutoOpen>]
  -    module Operators =
  -        
  -        type Inh = class end
  -        let inh : Inh = Unchecked.defaultof<Inh>
  +        type Inh private() =
  +            static let instance = Inh()
  +            static member Instance = instance
  +
  +        let inh = Inh.Instance
   
           [<MethodImpl(MethodImplOptions.NoInlining)>]
  -        let (?) (o : 'a) (name : string) : 'b =
  -            failwith ""
  +        let (?) (o : 'a) (name : string) : 'b = failwith ""
               
           [<MethodImpl(MethodImplOptions.NoInlining)>]
  -        let (<<=) (m : Inh) (value : 'a) =
  -            ()
  -
  -        let private isUnitFunction (t : Type) =
  -            if t.Name.StartsWith "FSharpFunc" then
  -                let (d,_) = FSharpType.GetFunctionElements t
  -                d = typeof<unit>
  -            else
  -                false
  -
  +        let (<<=) (m : Inh) (value : 'a) = ()
  +
  +    module Implementation = 
           [<AutoOpen>]
  -        module LookupExtensions = 
  -            open Aardvark.Base.IL
  -
  +        module Patterns =
  +            let private isUnitFunction (t : Type) =
  +                if t.Name.StartsWith "FSharpFunc" then
  +                    let (d,_) = FSharpType.GetFunctionElements t
  +                    d = typeof<unit>
  +                else
  +                    false
               let private attributeLookupCache = System.Collections.Concurrent.ConcurrentDictionary<MethodInfo, Option<string * AttributeKind>>()
               let private rx = System.Text.RegularExpressions.Regex @"(get_)?(?<name>[a-zA-Z_0-9]+$)"
  +
               let (|AttributeLookup|_|) (mi : MethodInfo) =
                   attributeLookupCache.GetOrAdd (mi, fun mi ->
                       let att = mi.GetCustomAttribute<AttributeAttribute>()
  
positive.code: open System.Collections.Generic
  open System.Reflection
  open System.Reflection.Emit
  open Microsoft.FSharp.Reflection
  open Microsoft.FSharp.Quotations
  open Microsoft.FSharp.Quotations.Patterns
  
negative.code:                     |> Seq.toArray
  
              let cnt = Globals.attributeCount()
              Implementation.semanticFunctions <- functions |> Seq.map (fun sf -> sf.name,sf) |> Map.ofSeq
              Globals.synDispatchers <- Array.zeroCreate cnt
              Globals.inhDispatchers <- Array.zeroCreate cnt
              Globals.rootDispatchers <- Array.zeroCreate cnt
  