[@@ FStar.Tactics.Typeclasses.tcinstance]
val printable_ref (#a #p: _) (d: printable a) : printable (x: a{p x})
instance printable_ref #a #p (d : printable a) : printable (x:a{p x}) =
{
  to_string = d.to_string
}
[@@ FStar.Tactics.Typeclasses.tcinstance]
val printable_ref (#a #p: _) (d: printable a) : printable (x: a{p x})
[@@ FStar.Tactics.Typeclasses.tcinstance]
let printable_ref #a #p (d: printable a) : printable (x: a{p x}) =
{ to_string = d.to_string }
FStar.Class.Printable.fst.checked
prims.fst.checked FStar.UInt8.fsti.checked FStar.UInt64.fsti.checked FStar.UInt32.fsti.checked FStar.UInt16.fsti.checked FStar.Tactics.Typeclasses.fsti.checked FStar.String.fsti.checked FStar.Seq.Properties.fsti.checked FStar.Seq.fst.checked FStar.Pervasives.fsti.checked FStar.List.Tot.fst.checked FStar.Int8.fsti.checked FStar.Int64.fsti.checked FStar.Int32.fsti.checked FStar.Int16.fsti.checked FStar.Char.fsti.checked
FStar.Class.Printable.fst
FStar.Class.Printable.printable FStar.Class.Printable.Mkprintable FStar.Class.Printable.__proj__Mkprintable__item__to_string
(*
   Copyright 2020 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.

   Authors: Brian G. Milnes
*)

module FStar.Class.Printable

open FStar.String
open FStar.Seq.Properties

class printable (a:Type) =
{
  to_string : a -> string
}

(* First the prim types. *)

instance printable_unit : printable unit =
{
  to_string = (fun _ -> "()")
}

instance printable_bool : printable bool =
{
  to_string = Prims.string_of_bool
}

instance printable_nat : printable nat =
{
  to_string = Prims.string_of_int
}

instance printable_int : printable int =
{
  to_string = Prims.string_of_int
}

(* An instance for refinements, they can be printed as long
as the base type is printable. This allows to print [nat],
for instance. *)
instance printable_ref #a #p (d : printable a) : printable (x:a{p x}) =
[@@ FStar.Tactics.Typeclasses.tcinstance]
val printable_ref (#a #p: _) (d: printable a) : printable (x: a{p x})
d: FStar.Class.Printable.printable a -> FStar.Class.Printable.printable (x: a{p x})