anchor.diff:  let valueExistsForKey = fun baseKey sub_key value ->
       let key = getRegistryKey baseKey sub_key false
       key.GetValueNames()
  -    |> Seq.exists (fun v -> v = value) +    |> Seq.exists (fun v -> v = value)
  +
  
positive.code: let createRegistrySubKey baseKey subKey = (getKey baseKey).CreateSubKey subKey |> ignore
  
  /// Sets a registry value
  let setRegistryValue<'T> baseKey subKey keyName (value : 'T) = 
      use key = getRegistryKey baseKey subKey true
      key.SetValue(keyName, value)
  
  /// Deletes the registry value from its key
  let deleteRegistryValue baseKey subKey keyName = 
      use key = getRegistryKey baseKey subKey true
      key.DeleteValue keyName
  
  
negative.code: 
  /// Maps the RegistryBaseKey to a RegistryKey for a 32bit System
  /// [omit]
  let get32BitKey name =
      match name with
      | HKEYLocalMachine -> RegistryKey.OpenBaseKey(RegistryHive.LocalMachine, RegistryView.Registry32)
      | HKEYClassesRoot -> RegistryKey.OpenBaseKey(RegistryHive.ClassesRoot, RegistryView.Registry32)
      | HKEYUsers -> RegistryKey.OpenBaseKey(RegistryHive.Users, RegistryView.Registry32)
      | HKEYCurrentUser -> RegistryKey.OpenBaseKey(RegistryHive.CurrentUser, RegistryView.Registry32)
      | HKEYCurrentConfig -> RegistryKey.OpenBaseKey(RegistryHive.CurrentConfig, RegistryView.Registry32)
      | HKEYPerformanceData -> RegistryKey.OpenBaseKey(RegistryHive.PerformanceData, RegistryView.Registry32)
  
  /// Gets a 64-bit registy key
  let getRegistryKey64 baseKey subKey (writePermission : bool) =
      (get64BitKey baseKey).OpenSubKey(subKey, writePermission)
  
  /// Gets a registy key and falls back to 32 bit if the 64bit key is not there
  let getRegistryKey baseKey subKey (writePermission : bool) =
      let x64BitKey = (getKey baseKey).OpenSubKey(subKey, writePermission)
      if x64BitKey <> null then x64BitKey else
      (get32BitKey baseKey).OpenSubKey(subKey, writePermission)  // fall back to 32 bit
  
  /// Gets a registy value as string
  let getRegistryValue baseKey subKey value =
      use key = getRegistryKey baseKey subKey false
      if key = null then
          failwithf "Registry subkey %s could not be found for key %A" subKey baseKey
  