text stringlengths 0 601k |
|---|
let find_shown_module path = try filter_modules ( ) ; Hashtbl . find shown_modules path with Not_found -> match ! default_frame with None -> raise Not_found | Some mw -> mw |
let is_shown_module path = ! default_frame <> None || ( filter_modules ( ) ; Hashtbl . mem shown_modules path ) |
let view_defined_ref = ref ( fun lid ~ env -> ( ) ) |
let editor_ref = ref ( fun ? file ? pos ? opendialog ( ) -> ( ) ) |
let edit_source ~ file ~ path ~ sign = match sign with [ item ] -> let id , kind = match item with Tsig_value ( id , _ ) -> id , Pvalue | Tsig_type ( id , _ , _ ) -> id , Ptype | Tsig_exception ( id , _ ) -> id , Pconstructor | Tsig_module ( id , _ , _ ) -> id , Pmodule | Tsig_modtype ( id , _ ) -> id , Pmodtype | Tsig... |
let top_widgets = ref [ ] |
let dummy_item = Tsig_modtype ( Ident . create " dummy " , Tmodtype_abstract ) |
let rec view_signature ? title ? path ( ? env = ! start_env ) ( ? detach = false ) sign = let env = match path with None -> env | Some path -> Env . open_signature path sign env in let title = match title , path with Some title , _ -> title | None , Some path -> string_of_path path | None , None -> " Signature " in let... |
type fkind = [ ` Exp of [ ` Expr ` | Pat ` | Const ` | Val of Path . t ` | Var of Path . t ` | New of Path . t ] * Types . type_expr | ` Class of Path . t * Types . class_type | ` Module of Path . t * Types . module_type ] |
let view_type kind ~ env = match kind with ` Exp ( k , ty ) -> begin match k with ` Expr -> view_expr_type ty ~ title " : Expression type " ~ env | ` Pat -> view_expr_type ty ~ title " : Pattern type " ~ env | ` Const -> view_expr_type ty ~ title " : Constant type " ~ env | ` Val path -> begin try let vd = find_value p... |
let view_type_menu kind ~ env ~ parent = let title = match kind with ` Exp ( ` Expr , _ ) -> " Expression " : | ` Exp ( ` Pat , _ ) -> " Pattern " : | ` Exp ( ` Const , _ ) -> " Constant " : | ` Exp ( ` Val path , _ ) -> " Value " ^ string_of_path path ^ " " : | ` Exp ( ` Var path , _ ) -> " Variable " ^ Ident . name (... |
let found_str = ref ( [ ] : ( fkind * Env . t * Location . t ) list ) |
let add_found_str = add_found ~ found : found_str |
let rec search_pos_structure ~ pos str = List . iter str ~ f : begin function Tstr_eval exp -> search_pos_expr exp ~ pos | Tstr_value ( rec_flag , l ) -> List . iter l ~ f : begin fun ( pat , exp ) -> let env = if rec_flag = Asttypes . Recursive then exp . exp_env else Env . empty in search_pos_pat pat ~ pos ~ env ; se... |
let search_pos_structure ~ pos str = observe ~ ref : found_str ( search_pos_structure ~ pos ) str |
let search_pos_ti ~ pos = function Ti_pat p -> search_pos_pat ~ pos ~ env : p . pat_env p | Ti_expr e -> search_pos_expr ~ pos e | Ti_class c -> search_pos_class_expr ~ pos c | Ti_mod m -> search_pos_module_expr ~ pos m | _ -> ( ) |
let rec search_pos_info ~ pos = function [ ] -> [ ] | ti :: l -> if in_loc ~ pos ( get_location ti ) then observe ~ ref : found_str ( search_pos_ti ~ pos ) ti else search_pos_info ~ pos l |
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 " , [ " SearchTransitGatewayMulticastGroups " ] ) ] ( Util . drop_empty ( Uri . query_of_enco... |
let of_http body = try let xml = Ezxmlm . from_string body in let resp = Xml . member " SearchTransitGatewayMulticastGroupsResponse " ( snd xml ) in try Util . or_error ( Util . option_bind resp SearchTransitGatewayMulticastGroupsResult . parse ) ( let open Error in BadResponse { body ; message = " Could not find well ... |
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 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 " , [ " SearchTransitGatewayRoutes " ] ) ] ( Util . drop_empty ( Uri . query_of_encoded ( Que... |
let of_http body = try let xml = Ezxmlm . from_string body in let resp = Xml . member " SearchTransitGatewayRoutesResponse " ( snd xml ) in try Util . or_error ( Util . option_bind resp SearchTransitGatewayRoutesResult . parse ) ( let open Error in BadResponse { body ; message = " Could not find well formed SearchTrans... |
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 |
module Search_container = [ % css . raw { | position : relative ; } } ] | |
module Search_icon = [ % css . raw { | position : absolute ; left : 16px ; top : 8px ; } } ] | |
module Search_bar = [ % css . raw { | width : 100 ; % height : 40px ; font - size : 16px ; text - indent : 40px ; } } ] | |
let component = let % sub search_bar = Form . Elements . Textbox . string ~ extra_attrs : ( Value . return [ Vdom . Attr . classes [ Card_like . class_ ; Search_bar . class_ ] ] ) ~ placeholder " : Search icons " [ % here ] in let % arr search_bar = search_bar in let icons = match Form . value search_bar with | Error e... |
let query_uri = let base_uri = Uri . of_string " http :// api . duckduckgo . com /? format = json " in fun query -> Uri . add_query_param base_uri ( " q " , [ query ] ) |
let get_definition_from_json json = match Yojson . Safe . from_string json with | ` Assoc kv_list -> let find key = begin match List . Assoc . find kv_list key with | None | Some ( ` String " " ) -> None | Some s -> Some ( Yojson . Safe . to_string s ) end in begin match find " Abstract " with | Some _ as x -> x | None... |
let get_definition word = Cohttp_async . Client . get ( query_uri word ) >>= fun ( _ , body ) -> Pipe . to_list body >>| fun strings -> ( word , get_definition_from_json ( String . concat strings ) ) |
let print_result ( word , definition ) = printf " % s \ n % s \ n \ n % s \ n \ n " word ( String . init ( String . length word ) ~ f ( : fun _ -> ' ' ) ) - ( match definition with | None -> " No definition found " | Some def -> String . concat ~ sep " :\ n " ( Wrapper . wrap ( Wrapper . make 70 ) def ) ) |
let search_and_print words = Deferred . all_unit ( List . map words ~ f ( : fun word -> get_definition word >>| print_result ) ) |
let ( ) = Command . async_basic ~ summary " : Retrieve definitions from duckduckgo search engine " Command . Spec . ( empty +> anon ( sequence ( " word " %: string ) ) ) ( fun words ( ) -> search_and_print words ) |> Command . run |
type t = { filename : string ; real_filename : string ; timestamp : float ; mutable locations : locations ; } | Offset of ( GdkPixbuf . pixbuf option * string Location . loc ) list | Mark of ( GdkPixbuf . pixbuf option * GText . buffer * Gtk . text_mark * Gtk . text_mark ) list |
let count_locations { locations ; _ } = match locations with | Offset locs -> List . length locs | Mark locs -> List . length locs |
let ranges_of_locations = function | Offset locs -> List . map ( fun ( _ , { txt = _ ; loc ; } ) -> Lexical_markup . Range . range_of_loc loc ) locs | Mark marks -> List . map begin fun ( _ , buffer , m1 , m2 ) -> let start = ( buffer # get_iter ( ` MARK m1 ) ) # line_index in let stop = ( buffer # get_iter ( ` MARK m2... |
let query_uri ~ server query = let base_uri = Uri . of_string ( String . concat [ " http " ; :// server ; " /? format = json " ] ) in Uri . add_query_param base_uri ( " q " , [ query ] ) |
let get_definition_from_json json = match Yojson . Safe . from_string json with | ` Assoc kv_list -> let find key = begin match List . Assoc . find kv_list key with | None | Some ( ` String " " ) -> None | Some s -> Some ( Yojson . Safe . to_string s ) end in begin match find " Abstract " with | Some _ as x -> x | None... |
let get_definition ~ server word = Cohttp_async . Client . get ( query_uri ~ server word ) >>= fun ( _ , body ) -> Pipe . to_list body >>| fun strings -> ( word , get_definition_from_json ( String . concat strings ) ) |
let print_result ( word , definition ) = printf " % s \ n % s \ n \ n % s \ n \ n " word ( String . init ( String . length word ) ~ f ( : fun _ -> ' ' ) ) - ( match definition with | None -> " No definition found " | Some def -> String . concat ~ sep " :\ n " ( Wrapper . wrap ( Wrapper . make 70 ) def ) ) |
let search_and_print ~ servers words = let servers = Array . of_list servers in Deferred . all ( List . mapi words ~ f ( : fun i word -> let server = servers . ( i mod Array . length servers ) in get_definition ~ server word ) ) >>| fun results -> List . iter results ~ f : print_result |
let ( ) = Command . async_basic ~ summary " : Retrieve definitions from duckduckgo search engine " Command . Spec . ( let string_list = Arg_type . create ( String . split ~ on ' , ' ) : in empty +> anon ( sequence ( " word " %: string ) ) +> flag " - servers " ( optional_with_default [ " api . duckduckgo . com " ] stri... |
let query_uri ~ server query = let base_uri = Uri . of_string ( String . concat [ " http " ; :// server ; " /? format = json " ] ) in Uri . add_query_param base_uri ( " q " , [ query ] ) |
let get_definition_from_json json = match Yojson . Safe . from_string json with | ` Assoc kv_list -> let find key = begin match List . Assoc . find kv_list key with | None | Some ( ` String " " ) -> None | Some s -> Some ( Yojson . Safe . to_string s ) end in begin match find " Abstract " with | Some _ as x -> x | None... |
let get_definition ~ server word = try_with ( fun ( ) -> Cohttp_async . Client . get ( query_uri ~ server word ) >>= fun ( _ , body ) -> Pipe . to_list ( Cohttp_async . Body . to_pipe body ) >>| fun strings -> ( word , get_definition_from_json ( String . concat strings ) ) ) >>| function | Ok ( word , result ) -> ( wor... |
let print_result ( word , definition ) = printf " % s \ n % s \ n \ n % s \ n \ n " word ( String . init ( String . length word ) ~ f ( : fun _ -> ' ' ) ) - ( match definition with | Error s -> " DuckDuckGo query failed : " ^ s | Ok None -> " No definition found " | Ok ( Some def ) -> String . concat ~ sep " :\ n " ( W... |
let search_and_print ~ servers words = let servers = Array . of_list servers in Deferred . all ( List . mapi words ~ f ( : fun i word -> let server = servers . ( i mod Array . length servers ) in get_definition ~ server word ) ) >>| fun results -> List . iter results ~ f : print_result |
let ( ) = Command . async_basic ~ summary " : Retrieve definitions from duckduckgo search engine " Command . Spec . ( let string_list = Arg_type . create ( String . split ~ on ' , ' ) : in empty +> anon ( sequence ( " word " %: string ) ) +> flag " - servers " ( optional_with_default [ " api . duckduckgo . com " ] stri... |
let query_uri ~ server query = let base_uri = Uri . of_string ( String . concat [ " http " ; :// server ; " /? format = json " ] ) in Uri . add_query_param base_uri ( " q " , [ query ] ) |
let get_definition_from_json json = match Yojson . Safe . from_string json with | ` Assoc kv_list -> let find key = begin match List . Assoc . find kv_list key with | None | Some ( ` String " " ) -> None | Some s -> Some ( Yojson . Safe . to_string s ) end in begin match find " Abstract " with | Some _ as x -> x | None... |
let get_definition ~ server word = try_with ( fun ( ) -> Cohttp_async . Client . get ( query_uri ~ server word ) >>= fun ( _ , body ) -> Pipe . to_list body >>| fun strings -> ( word , get_definition_from_json ( String . concat strings ) ) ) >>| function | Ok ( word , result ) -> ( word , Ok result ) | Error exn -> ( w... |
let print_result ( word , definition ) = printf " % s \ n % s \ n \ n % s \ n \ n " word ( String . init ( String . length word ) ~ f ( : fun _ -> ' ' ) ) - ( match definition with | Error _ -> " DuckDuckGo query failed unexpectedly " | Ok None -> " No definition found " | Ok ( Some def ) -> String . concat ~ sep " :\ ... |
let search_and_print ~ server words = Deferred . all ( List . map ~ f ( : get_definition ~ server ) words ) >>| fun results -> List . iter results ~ f : print_result |
let ( ) = Command . async_basic ~ summary " : Retrieve definitions from duckduckgo search engine " Command . Spec . ( empty +> anon ( sequence ( " word " %: string ) ) +> flag " - server " ( optional_with_default " api . duckduckgo . com " string ) ~ doc " : Specify server to connect to " ) ( fun words server ( ) -> se... |
let query_uri ~ server query = let base_uri = Uri . of_string ( String . concat [ " http " ; :// server ; " /? format = json " ] ) in Uri . add_query_param base_uri ( " q " , [ query ] ) |
let get_definition_from_json json = match Yojson . Safe . from_string json with | ` Assoc kv_list -> let find key = begin match List . Assoc . find kv_list key with | None | Some ( ` String " " ) -> None | Some s -> Some ( Yojson . Safe . to_string s ) end in begin match find " Abstract " with | Some _ as x -> x | None... |
let get_definition ~ server word = try_with ( fun ( ) -> Cohttp_async . Client . get ( query_uri ~ server word ) >>= fun ( _ , body ) -> Pipe . to_list body >>| fun strings -> ( word , get_definition_from_json ( String . concat strings ) ) ) >>| function | Ok ( word , result ) -> ( word , Ok result ) | Error exn -> ( w... |
let get_definition_with_timeout ~ server ~ timeout word = Deferred . any [ ( after timeout >>| fun ( ) -> ( word , Error " Timed out " ) ) ; ( get_definition ~ server word >>| fun ( word , result ) -> let result ' = match result with | Ok _ as x -> x | Error _ -> Error " Unexpected failure " in ( word , result ' ) ) ] |
let print_result ( word , definition ) = printf " % s \ n % s \ n \ n % s \ n \ n " word ( String . init ( String . length word ) ~ f ( : fun _ -> ' ' ) ) - ( match definition with | Error s -> " DuckDuckGo query failed : " ^ s | Ok None -> " No definition found " | Ok ( Some def ) -> String . concat ~ sep " :\ n " ( W... |
let search_and_print ~ servers ~ timeout words = let servers = Array . of_list servers in Deferred . all ( List . mapi words ~ f ( : fun i word -> let server = servers . ( i mod Array . length servers ) in get_definition_with_timeout ~ server ~ timeout word ) ) >>| fun results -> List . iter results ~ f : print_result |
let ( ) = Command . async_basic ~ summary " : Retrieve definitions from duckduckgo search engine " Command . Spec . ( let string_list = Arg_type . create ( String . split ~ on ' , ' ) : in empty +> anon ( sequence ( " word " %: string ) ) +> flag " - servers " ( optional_with_default [ " api . duckduckgo . com " ] stri... |
let query_uri ~ server query = let base_uri = Uri . of_string ( String . concat [ " http " ; :// server ; " /? format = json " ] ) in Uri . add_query_param base_uri ( " q " , [ query ] ) |
let get_definition_from_json json = match Yojson . Safe . from_string json with | ` Assoc kv_list -> let find key = begin match List . Assoc . find kv_list key with | None | Some ( ` String " " ) -> None | Some s -> Some ( Yojson . Safe . to_string s ) end in begin match find " Abstract " with | Some _ as x -> x | None... |
let get_definition ~ server ~ interrupt word = try_with ( fun ( ) -> Cohttp_async . Client . get ~ interrupt ( query_uri ~ server word ) >>= fun ( _ , body ) -> Pipe . to_list body >>| fun strings -> ( word , get_definition_from_json ( String . concat strings ) ) ) >>| function | Ok ( word , result ) -> ( word , Ok res... |
let get_definition_with_timeout ~ server ~ timeout word = let interrupt = Ivar . create ( ) in choose [ choice ( after timeout ) ( fun ( ) -> Ivar . fill interrupt ( ) ; ( word , Error " Timed out " ) ) ; choice ( get_definition ~ server ~ interrupt ( : Ivar . read interrupt ) word ) ( fun ( word , result ) -> let resu... |
let print_result ( word , definition ) = printf " % s \ n % s \ n \ n % s \ n \ n " word ( String . init ( String . length word ) ~ f ( : fun _ -> ' ' ) ) - ( match definition with | Error _ -> " DuckDuckGo query failed unexpectedly " | Ok None -> " No definition found " | Ok ( Some def ) -> String . concat ~ sep " :\ ... |
let search_and_print ~ servers ~ timeout words = let servers = Array . of_list servers in Deferred . all ( List . mapi words ~ f ( : fun i word -> let server = servers . ( i mod Array . length servers ) in get_definition_with_timeout ~ server ~ timeout word ) ) >>| fun results -> List . iter results ~ f : print_result |
let ( ) = Command . async_basic ~ summary " : Retrieve definitions from duckduckgo search engine " Command . Spec . ( let string_list = Arg_type . create ( String . split ~ on ' , ' ) : in empty +> anon ( sequence ( " word " %: string ) ) +> flag " - servers " ( optional_with_default [ " api . duckduckgo . com " ] stri... |
let query_uri ~ server query = let base_uri = Uri . of_string ( String . concat [ " http " ; :// server ; " /? format = json " ] ) in Uri . add_query_param base_uri ( " q " , [ query ] ) |
let get_definition_from_json json = match Yojson . Safe . from_string json with | ` Assoc kv_list -> let find key = begin match List . Assoc . find kv_list key with | None | Some ( ` String " " ) -> None | Some s -> Some ( Yojson . Safe . to_string s ) end in begin match find " Abstract " with | Some _ as x -> x | None... |
let get_definition ~ server ~ interrupt word = try_with ( fun ( ) -> Cohttp_async . Client . get ~ interrupt ( query_uri ~ server word ) >>= fun ( _ , body ) -> Pipe . to_list ( Cohttp_async . Body . to_pipe body ) >>| fun strings -> ( word , get_definition_from_json ( String . concat strings ) ) ) >>| function | Ok ( ... |
let get_definition_with_timeout ~ server ~ timeout word = let interrupt = Ivar . create ( ) in choose [ choice ( after timeout ) ( fun ( ) -> Ivar . fill interrupt ( ) ; ( word , Error " Timed out " ) ) ; choice ( get_definition ~ server ~ interrupt ( : Ivar . read interrupt ) word ) ( fun ( word , result ) -> let resu... |
let print_result ( word , definition ) = printf " % s \ n % s \ n \ n % s \ n \ n " word ( String . init ( String . length word ) ~ f ( : fun _ -> ' ' ) ) - ( match definition with | Error s -> " DuckDuckGo query failed : " ^ s | Ok None -> " No definition found " | Ok ( Some def ) -> String . concat ~ sep " :\ n " ( W... |
let search_and_print ~ servers ~ timeout words = let servers = Array . of_list servers in Deferred . all ( List . mapi words ~ f ( : fun i word -> let server = servers . ( i mod Array . length servers ) in get_definition_with_timeout ~ server ~ timeout word ) ) >>| fun results -> List . iter results ~ f : print_result |
let ( ) = Command . async_basic ~ summary " : Retrieve definitions from duckduckgo search engine " Command . Spec . ( let string_list = Arg_type . create ( String . split ~ on ' , ' ) : in empty +> anon ( sequence ( " word " %: string ) ) +> flag " - servers " ( optional_with_default [ " api . duckduckgo . com " ] stri... |
let query_uri ~ server query = let base_uri = Uri . of_string ( String . concat [ " http " ; :// server ; " /? format = json " ] ) in Uri . add_query_param base_uri ( " q " , [ query ] ) |
let get_definition_from_json json = match Yojson . Safe . from_string json with | ` Assoc kv_list -> let find key = begin match List . Assoc . find kv_list key with | None | Some ( ` String " " ) -> None | Some s -> Some ( Yojson . Safe . to_string s ) end in begin match find " Abstract " with | Some _ as x -> x | None... |
let get_definition ~ server ~ interrupt word = try_with ( fun ( ) -> Cohttp_async . Client . get ~ interrupt ( query_uri ~ server word ) >>= fun ( _ , body ) -> Pipe . to_list body >>| fun strings -> ( word , get_definition_from_json ( String . concat strings ) ) ) >>| function | Ok ( word , result ) -> ( word , Ok res... |
let get_definition_with_timeout ~ server ~ timeout word = get_definition ~ server ~ interrupt ( : after timeout ) word >>| fun ( word , result ) -> let result ' = match result with | Ok _ as x -> x | Error _ -> Error " Unexpected failure " in ( word , result ' ) |
let print_result ( word , definition ) = printf " % s \ n % s \ n \ n % s \ n \ n " word ( String . init ( String . length word ) ~ f ( : fun _ -> ' ' ) ) - ( match definition with | Error _ -> " DuckDuckGo query failed unexpectedly " | Ok None -> " No definition found " | Ok ( Some def ) -> String . concat ~ sep " :\ ... |
let search_and_print ~ servers ~ timeout words = let servers = Array . of_list servers in Deferred . all ( List . mapi words ~ f ( : fun i word -> let server = servers . ( i mod Array . length servers ) in get_definition_with_timeout ~ server ~ timeout word ) ) >>| fun results -> List . iter results ~ f : print_result |
let ( ) = Command . async_basic ~ summary " : Retrieve definitions from duckduckgo search engine " Command . Spec . ( let string_list = Arg_type . create ( String . split ~ on ' , ' ) : in empty +> anon ( sequence ( " word " %: string ) ) +> flag " - servers " ( optional_with_default [ " api . duckduckgo . com " ] stri... |
let query_uri ~ server query = let base_uri = Uri . of_string ( String . concat [ " http " ; :// server ; " /? format = json " ] ) in Uri . add_query_param base_uri ( " q " , [ query ] ) |
let get_definition_from_json json = match Yojson . Safe . from_string json with | ` Assoc kv_list -> let find key = begin match List . Assoc . find kv_list key with | None | Some ( ` String " " ) -> None | Some s -> Some ( Yojson . Safe . to_string s ) end in begin match find " Abstract " with | Some _ as x -> x | None... |
let get_definition ~ server word = try_with ( fun ( ) -> Cohttp_async . Client . get ( query_uri ~ server word ) >>= fun ( _ , body ) -> Pipe . to_list body >>| fun strings -> ( word , get_definition_from_json ( String . concat strings ) ) ) >>| function | Ok ( word , result ) -> ( word , Ok result ) | Error exn -> ( w... |
let get_definition_with_timeout ~ server ~ timeout word = choose [ choice ( after timeout ) ( fun ( ) -> ( word , Error " Timed out " ) ) ; choice ( get_definition ~ server word ) ( fun ( word , result ) -> let result ' = match result with | Ok x -> Ok x | Error _ -> Error " Unexpected failure " in ( word , result ' ) ... |
let print_result ( word , definition ) = printf " % s \ n % s \ n \ n % s \ n \ n " word ( String . init ( String . length word ) ~ f ( : fun _ -> ' ' ) ) - ( match definition with | Error msg -> " ERROR : " ^ msg | Ok None -> " No definition found " | Ok ( Some def ) -> String . concat ~ sep " :\ n " ( Wrapper . wrap ... |
let search_and_print ~ server ~ timeout words = Deferred . all ( List . map words ~ f ( : get_definition_with_timeout ~ timeout ~ server ) ) >>| fun results -> List . iter results ~ f : print_result |
let ( ) = Command . async_basic ~ summary " : Retrieve definitions from duckduckgo search engine " Command . Spec . ( empty +> anon ( sequence ( " word " %: string ) ) +> flag " - server " ( optional_with_default " api . duckduckgo . com " string ) ~ doc " : Specify server to connect to " +> flag " - timeout " ( option... |
type exp = Int of int | Bool of bool | Var of string | Abs of string * exp | App of exp * exp | Absolute of exp | Not of exp |
type opcode = INT of int | BOOL of bool | LOOKUP of string | CLOS of string ( * opcode list ) | CALL | RET | ABSOLUTE |
type table = ( string * answer ) list |
let _env = [ ( " x " , I 3 ) ; ( " y " , I 5 ) ; ( " z " , B true ) ] ; ; |
let rec join ( s , n ) = match ( s , n ) with ( s , 0 ) -> [ ] | ( n1 :: s ' , n ) -> ( join ( s ' , ( n - 1 ) ) ) [ @ n1 ] | _ -> raise JoinError ; ; |
let rec stackleft ( s ' , n1 ) = match ( s ' , n1 ) with ( s ' , 0 ) -> s ' | ( n2 :: s ' , n1 ) -> ( stackleft ( s ' , ( n1 - 1 ) ) ) | _ -> raise StackError ; ; |
let nth l i = match ( l , i ) with ( l , i ) -> ( Array . of_list ( l ) ) . ( i ) ; ; |
let rec power a b = match ( a , b ) with |
let imp a b = match ( a , b ) with ( true , false ) -> false | _ -> true ; ; |
let rec lookup x env = match env with |
let rec map2 f l = match l with [ ] [ ] -> |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.