val string_of_arg (#a: arg) (x: arg_type a) : string
let string_of_arg (#a:arg) (x:arg_type a) : string =
    match a with
    | Bool   -> string_of_bool x
    | Int    -> string_of_int x
    | Char   -> string_of_char x
    | String -> x
    | U8     -> FStar.UInt8.to_string x
    | U16    -> FStar.UInt16.to_string x
    | U32    -> FStar.UInt32.to_string x
    | U64    -> FStar.UInt64.to_string x
    | I8     -> FStar.Int8.to_string x
    | I16    -> FStar.Int16.to_string x
    | I32    -> FStar.Int32.to_string x
    | I64    -> FStar.Int64.to_string x
    | Extension (MkExtension f) -> f x
val string_of_arg (#a: arg) (x: arg_type a) : string
let string_of_arg (#a: arg) (x: arg_type a) : string =
match a with
| Bool -> string_of_bool x
| Int -> string_of_int x
| Char -> string_of_char x
| String -> x
| U8 -> FStar.UInt8.to_string x
| U16 -> FStar.UInt16.to_string x
| U32 -> FStar.UInt32.to_string x
| U64 -> FStar.UInt64.to_string x
| I8 -> FStar.Int8.to_string x
| I16 -> FStar.Int16.to_string x
| I32 -> FStar.Int32.to_string x
| I64 -> FStar.Int64.to_string x
| Extension (MkExtension f) -> f x
FStar.Printf.fst.checked
prims.fst.checked FStar.UInt8.fsti.checked FStar.UInt64.fsti.checked FStar.UInt32.fsti.checked FStar.UInt16.fsti.checked FStar.String.fsti.checked FStar.Pervasives.fsti.checked FStar.Integers.fst.checked FStar.Int8.fsti.checked FStar.Int64.fsti.checked FStar.Int32.fsti.checked FStar.Int16.fsti.checked FStar.Char.fsti.checked
FStar.Printf.fst
FStar.Printf.arg FStar.Printf.arg_type Prims.string_of_bool Prims.string_of_int FStar.String.string_of_char FStar.UInt8.to_string FStar.UInt16.to_string FStar.UInt32.to_string FStar.UInt64.to_string FStar.Int8.to_string FStar.Int16.to_string FStar.Int32.to_string FStar.Int64.to_string Prims.string
(*
   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.
*)
module FStar.Printf

(*
 * A variable arity C-style printf
 * See tests/micro-benchmarks/Test.Printf.fst for example usage
 *)

open FStar.Char
open FStar.String
module I = FStar.Integers

noeq
type extension =
  | MkExtension : #a:Type0 -> $f:(a -> Tot string) -> extension

/// `arg`: The format specifiers supported
///      %b : bool
///      %d : int
///      %c : char
///      %s : string
///      %uy : U8.t
///      %us : U16.t
///      %ul : U32.t
///      %uL : U64.t
///      %y  : Int8.t
///      %i  : Int16.t
///      %l  : Int32.t
///      %L  : Int64.t
noeq
type arg =
  | Bool
  | Int
  | Char
  | String
  | U8
  | U16
  | U32
  | U64
  | I8
  | I16
  | I32
  | I64
  | Extension of extension

/// `arg_type`: Interpreting a `arg` tag as a type
let arg_type (a:arg) : Tot Type0 =
  match a with
  | Bool   -> bool
  | Int    -> int
  | Char   -> char
  | String -> string
  | U8     -> FStar.UInt8.t
  | U16    -> FStar.UInt16.t
  | U32    -> FStar.UInt32.t
  | U64    -> FStar.UInt64.t
  | I8     -> FStar.Int8.t
  | I16    -> FStar.Int16.t
  | I32    -> FStar.Int32.t
  | I64    -> FStar.Int64.t
  | Extension (MkExtension #t _)  -> t
val string_of_arg (#a: arg) (x: arg_type a) : string
x: FStar.Printf.arg_type a -> Prims.string