text
stringlengths
0
601k
let wrap_with_ssh runner shell = let cmd = Shell . to_string shell in let ssh_args = ( match runner . ssh_alias with | None -> [ runner . address ] | Some alias -> [ alias ] ) @ ( match runner . ssh_user with None -> [ ] | Some user -> [ " - l " ; user ] ) @ ( match runner . ssh_port with | None -> [ ] | Some port -> [...
let wrap_with_ssh_pid runner shell = let open Shell in wrap_with_ssh runner ( seq Echo_pid ( cmd shell . local_env " exec " ( shell . name :: shell . arguments ) ) )
module Sys = struct type error = { address : string option ; command : string ; exit_code : Unix . process_status ; stderr : string ; } exception Remote_error of error let show_error { address ; command ; exit_code ; stderr } = let address_msg = match address with | None -> " on localhost " | Some address -> " on " ^ a...
let runner_json = let path = match Sys . getenv_opt " TEZT_RUNNER_CONFIG " with | None -> " runner_config . json " | Some location -> location in JSON . parse_file path
let runner = let open JSON in let ssh_alias = runner_json |-> " ssh_alias " |> as_string_opt in let ssh_user = runner_json |-> " ssh_user " |> as_string_opt in let ssh_port = runner_json |-> " ssh_port " |> as_int_opt in let ssh_id = runner_json |-> " ssh_id " |> as_string_opt in let address = runner_json |-> " ip_addr...
let node_path = let open JSON in runner_json |-> " node_path " |> as_string
module Process = struct type kind = [ ` Process_group | ` Docker of string | ` Process_group_script of string ] type t = { id : string ; binary : string option ; command : string list ; kind : kind } let make_in_session ? binary id kind command = { id ; binary ; command = " setsid " :: command ; kind } let genspio id s...
module State = struct type process_state = { process : Process . t ; lwt : Lwt_process . process_none } type t = { processes : ( string , process_state ) Caml . Hashtbl . t } let pp fmt { processes } = let open Caml . Format in fprintf fmt " Processes :@ [ [ " @ ; Caml . Hashtbl . iter ( fun s { lwt ; _ } -> fprintf fm...
let output_path t process which = let sanitize = String . map ~ f ( : function ' ' ' \ | ' ' / | ' " ' -> ' _ ' | other -> other ) in Paths . root t // ( " output " // sanitize process . Process . id // match which with | ` Stdout -> " stdout . log " | ` Stderr -> " stderr . log " | ` Meta -> " meta . log " | ` Script ...
let ef_processes state processes = EF . ( desc_list ( af " Processes " ) ( List . map processes ~ f ( : fun { process ; lwt } -> desc_list ( af " P :% s " process . id ) [ desc ( af " out " ) ( atom ( output_path state process ` Stdout ) ) ; desc ( af " err " ) ( atom ( output_path state process ` Stderr ) ) ; desc ( a...
let unix_status_to_string ( p : Unix . process_status ) = match p with | Unix . WEXITED i -> sprintf " exited :% d " i | Unix . WSIGNALED i -> sprintf " signaled :% d " i | Unix . WSTOPPED i -> sprintf " stopped :% d " i
let ef_lwt_state = let open Lwt_process in function | Running -> EF . af " Running " | Exited p -> EF . atom ( unix_status_to_string p )
let ef ( ? all = false ) state = EF . ( let all_procs = Caml . Hashtbl . fold ( fun _ { process ; lwt } prev -> match ( all , lwt # state ) with | true , _ | false , Lwt_process . Running -> ( process . id , list ~ delimiters ( " { " , : " } " ) [ haf " % s " : process . id ; desc ( af " pid " ) : ( af " % d " lwt # pi...
let start t process = let date = Tezos_stdlib_unix . Systime_os . now ( ) |> Tezos_base . Time . System . to_notation in let open_file f = System_error . catch ~ attach [ ( " : open_file " , ` String_value f ) ] Lwt . Infix . ( fun ( ) -> Tezos_stdlib_unix . Lwt_utils_unix . create_dir ~ perm : 0o700 ( Caml . Filename ...
let start_full t process = let proc_full = Lwt_process . open_process_full ( Option . value ~ default " " : process . binary , Array . of_list process . command ) in let proc = ( proc_full :> Lwt_process . process_none ) in State . add_process t process proc >>= fun ( ) -> return { process ; lwt = proc } >>= fun proc_s...
let wait _t { lwt ; _ } = System_error . catch ( fun ( ) -> lwt # close ) ( ) >>= fun _status -> return _status
let kill _t { lwt ; process } = match process . kind with | ` Process_group | ` Process_group_script _ -> System_error . catch ( fun ( ) -> Dbg . e EF . ( wf " Killing % S " process . id ) ; let signal = Caml . Sys . sigkill in let pid = ( ~- lwt # pid ) in ( try Unix . kill pid signal with | Unix . Unix_error ( Unix ....
let wait_all t = State . all_processes t >>= fun all -> List . fold all ~ init ( : return ( ) ) ~ f ( : fun prevm one -> prevm >>= fun ( ) -> wait t one >>= fun _ -> return ( ) )
let kill_all t = State . all_processes t >>= fun all -> List . fold all ~ init ( : return ( ) ) ~ f ( : fun prevm one -> prevm >>= fun ( ) -> kill t one )
let find_process_by_id ( ? only_running = false ) t ~ f = State . all_processes t >>= fun all -> return ( List . filter all ~ f ( : fun { process = { id ; _ } ; lwt } -> if only_running && not Poly . ( lwt # state = Lwt_process . Running ) then false else f id ) )
let cmds = ref 0
let fresh_id _state prefix ~ seed = Caml . incr cmds ; sprintf " % s -% 05d -% s -% 08d " prefix ! cmds Caml . Digest . ( string seed |> to_hex ) Random . ( int 10_000_000 )
let run_cmdf ( ? id_prefix = " cmd " ) state fmt = let get_file path = System_error . catch Lwt . ( fun ( ) -> Lwt_io . open_file ~ mode : Lwt_io . input path >>= fun inchan -> let stream = Lwt_io . read_lines inchan in Lwt_stream . to_list stream >>= fun l -> Lwt_io . close inchan >>= fun ( ) -> return l ) ( ) in kspr...
let run_successful_cmdf state fmt = ksprintf ( fun cmd -> run_cmdf state " % s " cmd >>= fun res -> Process_result . Error . fail_if_non_zero res ( sprintf " Shell command : % S " cmd ) >>= fun ( ) -> return res ) fmt
let run_genspio state name genspio = let proc = Process . genspio ( fresh_id state name ~ seed : name ) genspio in start state proc >>= fun proc -> wait state proc
module Async = struct let run_cmdf ( ? id_base = " async - cmd " ) state ~ f fmt = ksprintf ( fun s -> let id = fresh_id state id_base ~ seed : s in let proc = Process . make_in_session id ` Process_group [ " sh " ; " - c " ; s ] in start_full state proc >>= fun ( proc_state , proc ) -> Dbg . e EF . ( wf " Started asyn...
let to_http service region req = let uri = Uri . add_query_params ( Uri . of_string ( Aws . Util . of_option_exn ( Endpoints . url_of service region ) ) ) ( List . append [ ( " Version " , [ " 2016 - 11 - 15 " ] ) ; ( " Action " , [ " RunScheduledInstances " ] ) ] ( Util . drop_empty ( Uri . query_of_encoded ( Query . ...
let of_http body = try let xml = Ezxmlm . from_string body in let resp = Xml . member " RunScheduledInstancesResponse " ( snd xml ) in try Util . or_error ( Util . option_bind resp RunScheduledInstancesResult . parse ) ( let open Error in BadResponse { body ; message = " Could not find well formed RunScheduledInstances...
let parse_error code err = let errors = [ ] @ Errors_internal . common in match Errors_internal . of_string err with | Some var -> if ( List . mem var errors ) && ( ( match Errors_internal . to_http_code var with | Some var -> var = code | None -> true ) ) then Some var else None | None -> None
let run_static ppf lam = let splices = if Sys . backend_type = Sys . Bytecode then begin ignore ( Symtable . init_static ( ) ) ; let ( init_code , fun_code ) = Bytegen . compile_phrase lam in let ( code , code_size , reloc , _ ) = Emitcode . to_memory init_code fun_code in Bytelink . load_deps ppf 1 ! Clflags . static_...
let load_static_deps ppf reloc = if Sys . backend_type = Sys . Bytecode then Bytelink . load_deps ppf 1 ! Clflags . static_deps reloc else if Sys . backend_type = Sys . Native then ( ) else assert false
type ' a t = ' a
let bind x f = f x
let return x = x
let get_time ( ) = Unix . gettimeofday ( )
let get_modification_time path = let open Unix in try let s = stat path in Yocaml . Try . ok $ int_of_float s . st_mtime with | Unix_error ( err , f , p ) -> Yocaml . Error . ( to_try ( Unix ( Unix . error_message err , f , p ) ) ) ; ;
let bytes_of_in_channel channel = let length = in_channel_length channel in let buffer = Bytes . create length in let ( ) = really_input channel buffer 0 length in buffer ; ;
let read_file filename = try let channel = open_in filename in let bytes = bytes_of_in_channel channel in let ( ) = close_in channel in Ok ( bytes |> Bytes . to_string ) with | _ -> Yocaml . Error . ( to_try ( Unreadable_file filename ) ) ; ;
let rec create_dir ( ? file_perm = 0o777 ) path = if not ( Sys . file_exists path ) then ( let parent = Filename . dirname path in let ( ) = create_dir ~ file_perm parent in try Unix . mkdir path file_perm with | _ -> ( ) ) ; ;
let write_file filename content = try let chan = open_out filename in let ( ) = output_string chan content in let ( ) = close_out chan in Yocaml . Try . ok ( ) with | _ -> Yocaml . Error . ( to_try ( Unreadable_file filename ) ) ; ;
let level_to_logs = let open Yocaml in function | Log . Trace -> Logs . App | Log . Debug -> Logs . Debug | Log . Info -> Logs . Info | Log . Warning -> Logs . Warning | Log . Alert -> Logs . Error ; ;
let log level message = let lvl = level_to_logs level in Logs . msg lvl ( fun pp -> pp " % s " message ) ; ;
let read_dir path = try Sys . readdir path |> Array . to_list with | _ -> [ ] ; ;
let hash value = let open Cryptokit in value |> hash_string ( Hash . sha256 ( ) ) |> transform_string ( Hexa . encode ( ) ) ; ;
let content_changes path new_content = let open Yocaml . Try . Monad in let + old_content = read_file path in let new_content_checksum = hash new_content and old_content_checksum = hash old_content in not ( String . equal new_content_checksum old_content_checksum ) ; ;
type error = | Unavailable_primitive_definitions | Invalid_primitive_definitions | Undefined_class of string * ( string option ) option | Undefined_primitive of string
type description = { primdesc_class : string ; primdesc_method : string ; primdesc_parameters : Lambda . repr list ; primdesc_return : Lambda . repr ; primdesc_javadesc : Descriptor . for_method ; }
let is_primitive_provider cdef = try ( cdef . ClassDefinition . attributes :> Attribute . t list ) list |> Attribute . extract_annotations |> List . exists ( fun ( annot_class_name , _ ) _ -> Name . equal_for_class class_PrimitiveProvider annot_class_name ) annot_class_name with _ -> false
let extract_primitive_annotation meth = try Some ( ( meth . Method . attributes :> Attribute . t list ) list |> Attribute . extract_annotations |> List . find ( fun ( annot_class_name , _ ) _ -> Name . equal_for_class class_Primitive annot_class_name ) annot_class_name |> snd ) snd with _ -> None
let table : ( string , description ) description Hashtbl . t = Hashtbl . create 1307
let rec repr_of_type_and_annot : Descriptor . java_type -> string -> Lambda . repr = fun java_type annot -> let open Lambda in match java_type , annot with | ` Boolean , _ -> assert false | ` Byte , _ -> assert false | ` Char , _ -> assert false | ` Double , _ -> LR_float | ` Float , _ -> assert false | ` Int , _ -> LR...
let visit loader class_name = let cdef = try class_name |> UTF8 . of_string |> ClassLoader . find_class loader with | ClassLoader . Exception ( ClassLoader . Unable_to_load ( _ , err ) err ) err -> raise ( Error ( Undefined_class ( class_name , Some err ) err ) err ) err | ClassLoader . Exception err -> let msg = Class...
let rec java_type_of_repr : Lambda . repr -> Descriptor . java_type = fun repr -> let mk_class cn = ` Class ( Name . make_for_class_from_external ( UTF8 . of_string cn ) cn ) cn in let open Lambda in match repr with | LR_value -> ` Class class_Value | LR_int -> ` Long | LR_char -> ` Long | LR_string -> ` Class class_Va...
type marshalled_desc = marshalled_class_desc array mcd_class_name : string ; mcd_methods : marshalled_method_desc array ; } mmd_method_name : string ; mmd_parameters : Lambda . repr array ; mmd_return : Lambda . repr ; }
let initialized = ref false
let init ( ) = if not ! initialized then begin initialized := true ; if not ( ! Jclflags . nobuiltin ) nobuiltin then begin let file = try Misc . find_in_path ( Config . standard_library :: ! Config . load_path ) load_path Jconfig . primitive_definitions with Not_found -> raise ( Error Unavailable_primitive_definitions...
let get_description name = init ( ) ; try try Hashtbl . find table ( name ^ ) " " $ with Not_found -> Hashtbl . find table name with Not_found -> raise ( Error ( Undefined_primitive name ) name ) name
let report_error ppf = function | Unavailable_primitive_definitions -> Format . fprintf ppf " File % a cannot be found in load path " Location . print_filename Jconfig . primitive_definitions | Invalid_primitive_definitions -> Format . fprintf ppf " File % a cannot be loaded " Location . print_filename Jconfig . primit...
module Fork_config = struct type t = { previous_state_hash : string ; previous_length : int ; previous_global_slot : int } [ @@ deriving yojson , dhall_type , bin_io_unversioned ] bin_io_unversioned end
let yojson_strip_fields ~ keep_fields = function | ` Assoc l -> ` Assoc ( List . filter l ~ f ( : fun ( fld , _ ) _ -> Array . mem ~ equal : String . equal keep_fields fld ) ) | json -> json
let yojson_rename_fields ~ alternates = function | ` Assoc l -> ` Assoc ( List . map l ~ f ( : fun ( fld , json ) json -> let fld = Option . value ~ default : fld ( Array . find_map alternates ~ f ( : fun ( alt , orig ) orig -> if String . equal fld alt then Some orig else None ) ) in ( fld , json ) json ) ) | json -> ...
let opt_fallthrough ~ default x2 = Option . value_map ~ default x2 ~ f ( : fun x -> Some x ) x
let result_opt ~ f x = match x with | Some x -> Result . map ~ f : Option . some ( f x ) x | None -> Result . return None
let dump_on_error yojson x = Result . map_error x ~ f ( : fun str -> str ^ " \ n \ nCould not parse JSON :\ n " ^ Yojson . Safe . pretty_to_string yojson )
let of_yojson_generic ~ fields of_yojson json = dump_on_error json @@ of_yojson @@ yojson_strip_fields ~ keep_fields : fields json
module Json_layout = struct module Accounts = struct module Single = struct module Timed = struct type t = { initial_minimum_balance : Currency . Balance . t ; cliff_time : Mina_numbers . Global_slot . t ; cliff_amount : Currency . Amount . t ; vesting_period : Mina_numbers . Global_slot . t ; vesting_increment : Curre...
module Accounts = struct module Single = struct module Timed = struct type t = Json_layout . Accounts . Single . Timed . t = { initial_minimum_balance : Currency . Balance . Stable . Latest . t ; cliff_time : Mina_numbers . Global_slot . Stable . Latest . t ; cliff_amount : Currency . Amount . Stable . Latest . t ; ves...
module Ledger = struct type base = | Named of string | Accounts of Accounts . t | Hash of string [ @@ deriving bin_io_unversioned ] bin_io_unversioned type t = { base : base ; num_accounts : int option ; balances : ( int * Currency . Balance . Stable . Latest . t ) t list ; hash : string option ; name : string option ;...
module Proof_keys = struct module Level = struct type t = Full | Check | None [ @@ deriving bin_io_unversioned , equal ] equal let to_string = function | Full -> " full " | Check -> " check " | None -> " none " let of_string str = match String . lowercase str with | " full " -> Ok Full | " check " -> Ok Check | " none ...
module Genesis = struct type t = Json_layout . Genesis . t = { k : int option ; delta : int option ; slots_per_epoch : int option ; slots_per_sub_window : int option ; genesis_state_timestamp : string option } [ @@ deriving bin_io_unversioned ] bin_io_unversioned let to_json_layout : t -> Json_layout . Genesis . t = Fn...
module Daemon = struct type t = Json_layout . Daemon . t = { txpool_max_size : int option ; peer_list_url : string option ; transaction_expiry_hr : int option } [ @@ deriving bin_io_unversioned ] bin_io_unversioned let to_json_layout : t -> Json_layout . Daemon . t = Fn . id let of_json_layout : Json_layout . Daemon . ...
module Epoch_data = struct module Data = struct type t = { ledger : Ledger . t ; seed : string } [ @@ deriving bin_io_unversioned , yojson ] yojson end type t = { staking : Data . t ; next : Data . t option } [ @@ deriving bin_io_unversioned , yojson ] yojson let to_json_layout : t -> Json_layout . Epoch_data . t = fun...
type t = { daemon : Daemon . t option ; genesis : Genesis . t option ; proof : Proof_keys . t option ; ledger : Ledger . t option ; epoch_data : Epoch_data . t option }
let to_json_layout { daemon ; genesis ; proof ; ledger ; epoch_data } = { Json_layout . daemon = Option . map ~ f : Daemon . to_json_layout daemon ; genesis = Option . map ~ f : Genesis . to_json_layout genesis ; proof = Option . map ~ f : Proof_keys . to_json_layout proof ; ledger = Option . map ~ f : Ledger . to_json...
let of_json_layout { Json_layout . daemon ; genesis ; proof ; ledger ; epoch_data } = let open Result . Let_syntax in let % map daemon = result_opt ~ f : Daemon . of_json_layout daemon and genesis = result_opt ~ f : Genesis . of_json_layout genesis and proof = result_opt ~ f : Proof_keys . of_json_layout proof and ledg...
let to_yojson x = Json_layout . to_yojson ( to_json_layout x ) x
let of_yojson json = Result . bind ~ f : of_json_layout ( Json_layout . of_yojson json ) json
let default = { daemon = None ; genesis = None ; proof = None ; ledger = None ; epoch_data = None }
let combine t1 t2 = let merge ~ combine t1 t2 = match ( t1 , t2 ) t2 with | Some t1 , Some t2 -> Some ( combine t1 t2 ) t2 | Some t , None | None , Some t -> Some t | None , None -> None in { daemon = merge ~ combine : Daemon . combine t1 . daemon t2 . daemon ; genesis = merge ~ combine : Genesis . combine t1 . genesis...
module Test_configs = struct let bootstrap = lazy ( { json | { " daemon " : { " txpool_max_size " : 3000 } , " genesis " : { " k " : 6 , " delta " : 0 , " genesis_state_timestamp " : " 2019 - 01 - 30 12 : 00 : 00 - 08 : 00 " } , " proof " : { " level " : " none " , " sub_windows_per_window " : 8 , " ledger_depth " : 6 ...
let runtime_counter_name counter = match counter with EV_C_ALLOC_JUMP -> " alloc_jump " | EV_C_FORCE_MINOR_ALLOC_SMALL -> " force_minor_alloc_small " | EV_C_FORCE_MINOR_MAKE_VECT -> " force_minor_make_vect " | EV_C_FORCE_MINOR_SET_MINOR_HEAP_SIZE -> " force_minor_set_minor_heap_size " | EV_C_FORCE_MINOR_WEAK -> " force...
let runtime_phase_name phase = match phase with | EV_EXPLICIT_GC_SET -> " explicit_gc_set " | EV_EXPLICIT_GC_STAT -> " explicit_gc_stat " | EV_EXPLICIT_GC_MINOR -> " explicit_gc_minor " | EV_EXPLICIT_GC_MAJOR -> " explicit_gc_major " | EV_EXPLICIT_GC_FULL_MAJOR -> " explicit_gc_full_major " | EV_EXPLICIT_GC_COMPACT -> ...
let lifecycle_name lifecycle = match lifecycle with EV_RING_START -> " ring_start " | EV_RING_STOP -> " ring_stop " | EV_RING_PAUSE -> " ring_pause " | EV_RING_RESUME -> " ring_resume " | EV_FORK_PARENT -> " fork_parent " | EV_FORK_CHILD -> " fork_child " | EV_DOMAIN_SPAWN -> " domain_spawn " | EV_DOMAIN_TERMINATE -> "...
module Timestamp = struct type t = int64 let to_int64 t = t end
module Callbacks = struct type [ @ warning " - unused - field " ] t = { runtime_begin : ( int -> Timestamp . t -> runtime_phase -> unit ) option ; runtime_end : ( int -> Timestamp . t -> runtime_phase -> unit ) option ; runtime_counter : ( int -> Timestamp . t -> runtime_counter -> int -> unit ) option ; alloc : ( int ...
let main ~ config_file ~ genesis_dir ~ proof_level ( ) = let % bind config = match config_file with | Some config_file -> ( let % map config_json = Deferred . Or_error . ok_exn @@ Genesis_ledger_helper . load_config_json config_file in match Runtime_config . of_yojson config_json with | Ok config -> config | Error err ...
let ( ) = Command . run ( Command . async ~ summary : " Generate the genesis ledger and genesis proof for a given \ configuration file , or for the compile - time configuration if none \ is provided " Command ( . let open Let_syntax in let open Command . Param in let % map config_file = flag " -- config - file " ~ doc ...
let check_client_force = Protocol . register_test ~ __FILE__ ~ title " : Runtime Script Failure : client force " ~ tags [ " : runtime_script_failure " ] @@ fun protocol -> let * node = Node . init [ Synchronisation_threshold 0 ; Connections 0 ] in let * client = Client . init ~ endpoint ( : Node node ) ( ) in let * ( )...
let register ~ protocols = check_client_force ~ protocols
let app_int f n = string_of_int n @> lazy ( f n )
let app_ints f l = B . Tree . concat ( List . map ( app_int f ) l )
let ( ) %% f g x = f ( g x )
let opaque_ignore x = ignore ( Sys . opaque_identity x )
module L = struct let bench_iter ( ? time = 2 ) n = let f i = opaque_ignore i in let l = CCList . ( 1 -- n ) in let ral = CCRAL . of_list l in let vec = CCFun_vec . of_list l in let sek = Sek . Persistent . of_array 0 ( Array . of_list l ) in let iter_list ( ) = List . iter f l and raliter ( ) = CCRAL . iter ~ f ral an...
module Arr = struct let rand = Random . State . make [ | 1 ; 2 ; 3 ; 4 ] | let mk_arr n = Array . init n ( fun _ -> Random . State . int rand 5_000 ) module IntArr = struct type elt = int type t = int array let get = Array . get let set = Array . set let length = Array . length end let sort_ccarray a = CCArray . sort_g...
module Vec = struct let f x = x + 1 let map_push_ f v = let v ' = CCVector . create ( ) in CCVector . iter ( fun x -> CCVector . push v ' ( f x ) ) v ; v ' let map_push_size_ f v = let v ' = CCVector . create_with ~ capacity ( : CCVector . length v ) 0 in CCVector . iter ( fun x -> CCVector . push v ' ( f x ) ) v ; v '...
module Cache = struct module C = CCCache let make_fib c = let f = C . with_cache_rec c ( fun fib n -> match n with | 0 -> 0 | 1 -> 1 | 2 -> 1 | n -> fib ( n - 1 ) + fib ( n - 2 ) ) in fun x -> C . clear c ; f x let bench_fib n = let l = [ " replacing_fib ( 128 ) " , make_fib ( C . replacing ~ eq : CCInt . equal 128 ) ,...
module Tbl = struct module type MUT = sig type key type ' a t val name : string val find : ' a t -> key -> ' a val create : int -> ' a t val add : ' a t -> key -> ' a -> unit val replace : ' a t -> key -> ' a -> unit end module type INT_MUT = MUT with type key = int module type STRING_MUT = MUT with type key = string m...
module Iter_ = struct let bench_fold n = let iter ( ) = Iter . fold ( ) + 0 Iter . ( 0 -- n ) in let gen ( ) = Gen . fold ( ) + 0 Gen . ( 0 -- n ) in let oseq ( ) = OSeq . fold ( ) + 0 OSeq . ( 0 -- n ) in B . throughputN 3 ~ repeat [ " iter . fold " , iter , ( ) ; " gen . fold " , gen , ( ) ; " oseq . fold " , oseq , ...
module Deque = struct module type DEQUE = sig type ' a t val create : unit -> ' a t val of_iter : ' a Iter . t -> ' a t val iter : ( ' a -> unit ) -> ' a t -> unit val push_front : ' a t -> ' a -> unit val push_back : ' a t -> ' a -> unit val is_empty : ' a t -> bool val take_front : ' a t -> ' a val take_back : ' a t ...