val const: #key:eqtype -> #value:Type -> value -> Tot (t key value)
let const #key #value v = {
  mappings = F.on key (fun _ -> v);
  domain =   complement empty
}
val const: #key:eqtype -> #value:Type -> value -> Tot (t key value)
let const #key #value v =
{ mappings = F.on key (fun _ -> v); domain = complement empty }
FStar.Map.fst.checked
prims.fst.checked FStar.Set.fsti.checked FStar.Pervasives.fsti.checked FStar.FunctionalExtensionality.fsti.checked
FStar.Map.fst
Prims.eqtype FStar.Map.Mkt FStar.FunctionalExtensionality.on FStar.Set.complement FStar.Set.empty FStar.Map.t
(*
   Copyright 2008-2018 Microsoft Research

   Licensed under the Apache License, Version 2.0 (the "License");
   you may not use this file except in compliance with the License.
   You may obtain a copy of the License at

       http://www.apache.org/licenses/LICENSE-2.0

   Unless required by applicable law or agreed to in writing, software
   distributed under the License is distributed on an "AS IS" BASIS,
   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   See the License for the specific language governing permissions and
   limitations under the License.
*)
(**
 * Implementation of partial maps with extensional equality
 *)
module FStar.Map
open FStar.Set
open FStar.FunctionalExtensionality
module S = FStar.Set
module F = FStar.FunctionalExtensionality


(* The main "trick" in the representation of the type `t`
 * is to use a domain-restricted function type `key ^-> value`
 * from the FStar.FunctionalExtensionality library.
 * These restricted function types enjoy extensional equality,
 * which is necessary if Map.t is to also enjoy extensional equality.
 *)
noeq
type t (key:eqtype) (value:Type) = {
  mappings: key ^-> value;
  domain:   set key
}

let sel #key #value m k = m.mappings k

(* Since mappings are restricted functions,
   assignments to that field must use `F.on`
   to restrict the domain of the functional maps *)
let upd #key #value m k v = {
  mappings = F.on key (fun x -> if x = k then v else m.mappings x);
  domain =   S.union m.domain (singleton k)
}

(* idem *)
val const: #key:eqtype -> #value:Type -> value -> Tot (t key value)
v: value -> FStar.Map.t key value