text stringlengths 12 786k |
|---|
type params = ( string * Eliommod_parameters . param ) list |
type params ' = ( string * string ) list |
type ' + a param_name = string |
type ( ' a , ' b ) binsum = Inj1 of ' a | Inj2 of ' b |
type ' an listnames = { it : ' el ' a . ( ' an -> ' el -> ' a -> ' a ) -> ' el list -> ' a -> ' a } |
type coordinates = { abscissa : int ; ordinate : int } |
type ' a setoneradio = [ ` Set of ' a | ` One of ' a | ` Radio of ' a ] |
type ' a oneradio = [ ` One of ' a | ` Radio of ' a ] |
type ' a setone = [ ` Set of ' a | ` One of ' a ] |
type ' a to_and_of = ' a Eliom_common . to_and_of = { of_string : string -> ' a ; to_string : ' a -> string } |
type _ atom = | TFloat : float atom | TInt : int atom | TInt32 : int32 atom | TInt64 : int64 atom | TNativeint : nativeint atom | TBool : bool atom | TString : string atom |
let string_of_atom ( type a ) ( p : a atom ) : a -> string = match p with | TFloat -> string_of_float | TInt -> string_of_int | TInt32 -> Int32 . to_string | TInt64 -> Int64 . to_string | TNativeint -> Nativeint . to_string | TBool -> string_of_bool | TString -> fun s -> s |
let atom_of_string ( type a ) ( p : a atom ) : string -> a = match p with | TFloat -> float_of_string | TInt -> int_of_string | TInt32 -> Int32 . of_string | TInt64 -> Int64 . of_string | TNativeint -> Nativeint . of_string | TBool -> bool_of_string | TString -> fun s -> s |
let to_from_of_atom x = { to_string = string_of_atom x ; of_string = atom_of_string x } |
type ' a filter = ( ' a -> unit ) option |
type ' a ocaml = string |
type suff = [ ` WithoutSuffix | ` WithSuffix | ` Endsuffix ] |
type ( _ , _ ) params_type_ = | TProd : ( ( ' a , ' an ) params_type_ * ( ' b , ' bn ) params_type_ ) -> ( ' a * ' b , ' an * ' bn ) params_type_ | TOption : ( ( ' a , ' an ) params_type_ * bool ) -> ( ' a option , ' an ) params_type_ | T... |
type ( ' a , ' + suff , ' an ) non_localized_params = ( ' a , ' an ) non_localized_params_ constraint ' suff = [ < suff ] |
type ( ' a , ' + suff , ' an ) params_type = ( ' a , ' an ) params_type_ constraint ' suff = [ < suff ] |
let int ( n : string ) = TAtom ( n , TInt ) |
let int32 ( n : string ) = TAtom ( n , TInt32 ) |
let int64 ( n : string ) = TAtom ( n , TInt64 ) |
let float ( n : string ) = TAtom ( n , TFloat ) |
let bool ( n : string ) = TAtom ( n , TBool ) |
let string ( n : string ) = TAtom ( n , TString ) |
let file ( n : string ) = TFile n |
let coordinates n = TCoord n |
let type_checker check t = TTypeFilter ( t , Some check ) |
let sum t1 t2 = TSum ( t1 , t2 ) |
let prod t1 t2 = TProd ( t1 , t2 ) |
let ( ** ) = prod |
let opt t = TOption ( t , false ) |
let neopt t = TOption ( t , true ) |
let radio f ( n : string ) = TOption ( f n , false ) |
let list ( n : string ) t = TList ( n , t ) |
let set f ( n : string ) = TSet ( f n ) |
let suffix_const ( v : string ) = TConst v |
let all_suffix ( n : string ) = TESuffix n |
let all_suffix_string ( n : string ) = TESuffixs n |
let suffix ( ? redirect_if_not_suffix = true ) s = TSuffix ( redirect_if_not_suffix , s ) |
let suffix_prod ( ? redirect_if_not_suffix = true ) ( s : ( ' s , [ < ` WithoutSuffix | ` Endsuffix ] , ' sn ) params_type ) ( t : ( ' a , [ ` WithoutSuffix ] , ' an ) params_type ) : ( ' s * ' a , [ ` WithSuffix ] , ' sn * ' an ) params_t... |
let ocaml ( n : string ) typ = TJson ( n , Some typ ) |
let make_list_suffix i = " [ " ^ string_of_int i ^ " ] " |
let rec make_suffix : type a c . ( a , ' b , c ) params_type -> a -> string list = fun typ params -> match typ with | TNLParams { param } -> make_suffix param params | TProd ( t1 , t2 ) -> make_suffix t1 ( fst params ) @ make_suffix t2 ( snd params ) | TAtom ( _ , a ) ->... |
let rec aux : type a c . ( a , ' b , c ) params_type -> string list option -> ' y -> a -> string -> string -> ' z -> ' x * ' y * ( string * Eliommod_parameters . field ) list = fun typ psuff nlp params pref suff l -> let open Eliommod_parameters in match typ with | TNLParams { ... |
let construct_params_list_raw nlp typ params = aux typ None nlp params " " " " [ ] |
let rec get_to_and_of : type a c . ( a , ' b , c ) params_type -> a to_and_of = function | TOption ( o , _ ) -> let { to_string ; of_string } = get_to_and_of o in { of_string = ( fun s -> try Some ( of_string s ) with _ -> None ) ; to_string = ( function Some alpha -> ... |
let rec walk_parameter_tree : type a c . string -> ( a , ' b , c ) params_type -> a to_and_of option = fun name x -> let get name ' = if name = name ' then Some ( get_to_and_of x ) else None in match x with | TUserType ( name ' , _ ) -> get name ' | TCoord name ' -> get name ... |
let construct_params_string l = Url . make_encoded_parameters ( Eliommod_parameters . get_param_list l ) |
let construct_params_list nonlocparams typ p = let suff , nonlocparams , pl = construct_params_list_raw nonlocparams typ p in let nlp = String . Table . fold ( fun _ l s -> l @ s ) nonlocparams [ ] in let pl = pl @ nlp in suff , pl |
let construct_params nonlocparams typ p = let suff , pl = construct_params_list nonlocparams typ p in suff , construct_params_string pl |
let make_params_names params = let rec aux : type a c . bool -> string -> string -> ( a , ' b , c ) params_type -> bool * c = fun issuffix prefix suffix x -> match x with | TNLParams { param = t } -> aux issuffix prefix suffix t | TProd ( t1 , t2 ) -> let issuffix , a = aux issuff... |
let rec add_pref_params : type a c . string -> ( a , ' b , c ) params_type -> ( a , ' b , c ) params_type = fun pref x -> match x with | TNLParams t -> TNLParams { t with param = add_pref_params pref t . param } | TProd ( t1 , t2 ) -> TProd ( add_pref_params pref t1 , add... |
let nl_prod ( t : ( ' a , ' su , ' an ) params_type ) ( s : ( ' s , [ ` WithoutSuffix ] , ' sn ) non_localized_params ) : ( ' a * ' s , ' su , ' an * ' sn ) params_type = TProd ( t , TNLParams s ) |
let rec remove_from_nlp : type a c . ' s -> ( a , ' b , c ) params_type -> ' s = fun nlp x -> match x with | TNLParams { name = n } -> String . Table . remove n nlp | TProd ( t1 , t2 ) -> let nlp = remove_from_nlp nlp t1 in remove_from_nlp nlp t2 | _ -> nlp |
type nl_params_set = ( string * Eliommod_parameters . param ) list String . Table . t |
let add_nl_parameter ( s : nl_params_set ) t v = ( fun ( _ , a , _ ) -> a ) ( construct_params_list_raw s ( TNLParams t ) v ) |
let list_of_nl_params_set nlp = snd ( construct_params_list nlp unit ( ) ) |
let string_of_nl_params_set nlp = Url . make_encoded_parameters ( Eliommod_parameters . get_param_list ( list_of_nl_params_set nlp ) ) |
let get_nl_params_names t = snd ( make_params_names ( TNLParams t ) ) |
let make_nlp_name persistent prefix name = let pr = if persistent then " p_ " else " n_ " in pr ^ prefix ^ " " - ^ name |
let make_non_localized_parameters ~ prefix ~ name ( ? persistent = false ) ( p : ( ' a , [ ` WithoutSuffix ] , ' b ) params_type ) : ( ' a , [ ` WithoutSuffix ] , ' b ) non_localized_params = let name = make_nlp_name persistent prefix name in if String . contains na... |
let rec contains_suffix : type a c . ( a , ' b , c ) params_type -> bool option = function | TProd ( a , b ) -> ( match contains_suffix a with None -> contains_suffix b | c -> c ) | TSuffix ( b , _ ) -> Some b | _ -> None |
let rec wrap_param_type : type a c . ( a , ' b , c ) params_type -> ( a , ' b , c ) params_type = function | TNLParams t -> TNLParams { t with param = wrap_param_type t . param } | TProd ( t1 , t2 ) -> TProd ( wrap_param_type t1 , wrap_param_type t2 ) | TOption ( t , ... |
type _ is_unit = U_not : _ is_unit | U_yes : unit is_unit |
let is_unit : type a c . ( a , _ , c ) params_type -> a is_unit = function | TUnit -> U_yes | _ -> U_not |
let anonymise_params_type ( t : ( ' a , ' b , ' c ) params_type ) : anon_params_type = Hashtbl . hash_param 1000 1000 t |
type files = ( string * file_info ) list |
type ' + a res_reconstr_param = | Res_ of ' a * params ' * files | Errors_ of ( ( string * string * exn ) list * params ' * files ) |
let end_of_list lp pref = let f ( a , _ ) = try String . ( sub a 0 ( length pref ) ) = pref with Invalid_argument _ -> false in not ( List . exists f lp ) |
let reconstruct_params_ typ params files nosuffixversion urlsuffix : ' a = let rec parse_suffix : type a c . ( a , ' b , c ) params_type -> string list -> a * string list = fun typ suff -> match typ , suff with | TESuffix _ , l -> l , [ ] | TESuffixs _ , l -> Url . string_of_ur... |
let reconstruct_params ~ sp ( type a c ) ( typ : ( a , ' b , c ) params_type ) params files nosuffixversion urlsuffix : a Lwt . t = match typ , params , files with | TRaw_post_data , None , None -> Eliom_request_info . raw_post_data sp | typ , None , None -> ( try Lwt . ret... |
let section = Lwt_log . Section . make " eliom : process " |
let history_api = Dom_html . hasPushState ( ) |
let get_set_js_serverside_value r name = ( ( fun s -> r := Some s ) , ( fun ( ) -> not ( ! r = None ) ) , ( fun ( ) -> match ! r with | Some s -> s | None -> Js . Optdef . case ( Js . def ( Js . Unsafe . get Js . Unsafe . global ( Js . string name ) ) ) ... |
let ( set_sitedata , is_set_sitedata , ( get_sitedata : unit -> Eliom_types . sitedata ) , reset_sitedata ) = get_set_js_serverside_value Eliom_common . sitedata " __eliom_appl_sitedata " |
let ignored_get_params = ref [ ] |
let ignored_post_params = ref [ ] |
let set_ignored_params get post = let compile = List . map ( fun s -> Re . seq [ Re . start ; Re . Pcre . re s ; Re . stop ] |> Re . compile ) in ignored_get_params := compile get ; ignored_post_params := compile post |
let ( set_info , is_set_info , ( get_info : unit -> Eliom_common . client_process_info ) , reset_info ) = get_set_js_serverside_value ( ref None ) " __eliom_appl_process_info " |
let ( set_request_cookies , is_set_request_cookies , ( get_request_cookies : unit -> Ocsigen_cookie_map . t ) , reset_request_cookies ) = get_set_js_serverside_value ( ref None ) " __eliom_request_cookies " |
let ( set_request_template , is_set_request_template , ( get_request_template : unit -> string option ) , reset_request_template ) = get_set_js_serverside_value ( ref None ) " __eliom_request_template " |
let appl_name = lazy ( let _ , v , _ = Ocsigen_cookie_map . Map_inner . find Eliom_common . appl_name_cookie_name ( Ocsigen_cookie_map . Map_path . find ( get_sitedata ( ) ) . Eliom_types . site_dir ( Eliommod_cookies . get_table ( Some ( get_info ( ) ) . cpi_hostname )... |
let set_base_url , get_base_url = let r : string option ref = ref None in ( ( fun s -> r := Some s ) , fun ( ) -> match ! r with | Some s -> s | None -> failwith " base_url not set . Did you forget to call Eliom_client . init_client_app " ? ) |
let appl_name_r = ref None |
let get_application_name ( ) = match ! appl_name_r with | None -> ( try !! appl_name with Not_found -> Lwt_log . raise_error ~ section " Application name not defined " ) | Some n -> n |
let ( >|= ) = Lwt . ( >|= ) |
let section = Lwt_log_js . Section . make " eliom : comet " |
module Down = struct type ' a t = ' a React . E . t let handle_react_exn , set_handle_react_exn_function = let r = ref ( fun ? exn ( ) -> let s = " Exception during comet with react . Customize this with Eliom_react . set_handle_react_exn_function . " in Lwt_log_js . log ~ section ~... |
module Up = struct type ' a t = ' a -> unit Lwt . t let internal_unwrap ( service , _unwrapper ) x = Eliom_client . call_service ~ service ( ) x >|= fun _ -> ( ) let ( ) = Eliom_unwrap . register_unwrapper Eliom_common . react_up_unwrap_id internal_unwrap end |
module S = struct module Down = struct type ' a t = ' a React . S . t let internal_unwrap ( channel , value , _unwrapper ) = let e = E . of_stream channel in S . hold ~ eq ( : fun _ _ -> false ) value e let ( ) = Eliom_unwrap . register_unwrapper Eliom_common . signal_down_un... |
module Down = struct type ' a stateful = { throttling : float option ; scope : Eliom_common . client_process_scope option ; react : ' a E . t ; name : string option ; size : int option } type ' a stateless = ' a Eliom_comet . Channel . t type ' a t ' = Stateful of ' a stateful... |
module Up = struct type ' a t = { event : ' a E . t ; service : ( unit , ' a , Eliom_service . post , Eliom_service . non_att , Eliom_service . co , Eliom_service . non_ext , Eliom_service . reg , [ ` WithoutSuffix ] , unit , [ ` One of ' a Eliom_parameter . o... |
module S = struct module Down = struct type ' a stateful = { throttling : float option ; scope : Eliom_common . client_process_scope option ; signal : ' a S . t ; name : string option } type ' a stateless = { channel : ' a Eliom_comet . Channel . t ; stream : ' a Lwt_stream . ... |
let ( >>= ) = Lwt . bind |
module Ocsipersist = struct include Eliom_common . Ocsipersist . Store include Eliom_common . Ocsipersist . Polymorphic end |
let pers_ref_store = Ocsipersist . open_store " eliom__persistent_refs " |
type ' a eref_kind = | Req of ' a Polytables . key | Sit of ' a Polytables . key | Ref of ' a lazy_t ref | Vol of ' a volatile_table Lazy . t | Ocsiper of ' a option Ocsipersist . t Lwt . t | Ocsiper_sit of ' a Ocsipersist . table Lwt . t | Per of ' a persistent_table Lwt . t |
type ( ' a , ' storage ) eref ' = ( unit -> ' a ) * bool * ' a eref_kind |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.