text
stringlengths 0
601k
|
---|
let rec print_term fmt { t_node ; t_ty ; t_attrs ; _ } = let print_ty fmt ty = match ty with None -> pp fmt " : prop " | Some ty -> pp fmt " :% a " print_ty ty in let print_t_node fmt t_node = match t_node with | Tconst c -> pp fmt " % a % a " Opprintast . constant c print_ty t_ty | Ttrue -> pp fmt " true % a " print_ty t_ty | Tfalse -> pp fmt " false % a " print_ty t_ty | Tvar vs -> pp fmt " % a " print_vs vs ; assert ( vs . vs_ty = Option . get t_ty ) | Tapp ( ls , [ x1 ; x2 ] ) when Identifier . is_infix ls . ls_name . id_str -> let op_nm = match String . split_on_char ' ' ls . ls_name . id_str with | [ x ] | [ _ ; x ] -> x | _ -> assert false in pp fmt " ( % a % s % a ) % a " print_term x1 op_nm print_term x2 print_ty t_ty | Tapp ( ls , tl ) -> pp fmt " ( % a % a ) % a " Ident . pp ls . ls_name ( list ~ first : sp ~ sep : sp print_term ) tl print_ty t_ty | Tfield ( t , ls ) -> pp fmt " ( % a ) . % a " print_term t Ident . pp ls . ls_name | Tnot t -> pp fmt " not % a " print_term t | Tif ( t1 , t2 , t3 ) -> pp fmt " if % a then % a else % a " print_term t1 print_term t2 print_term t3 | Tlet ( vs , t1 , t2 ) -> pp fmt " let % a = % a in % a " print_vs vs print_term t1 print_term t2 | Tbinop ( op , t1 , t2 ) -> pp fmt " % a % a % a " print_term t1 print_binop op print_term t2 | Tquant ( q , vsl , t ) -> pp fmt " % a % a . % a " print_quantifier q ( list ~ sep : sp print_vs ) vsl print_term t | Tcase ( t , ptl ) -> let print_branch fmt ( p , t ) = pp fmt " | [ @% a ] @ -> [ @% a ] " @ print_pattern p print_term t in pp fmt " match % a with @\ n % a @\ nend :% a " print_term t ( list ~ sep : newline print_branch ) ptl print_ty t_ty | Told t -> pp fmt " old ( % a ) " print_term t in let print_attrs fmt = List . iter ( pp fmt " [ %@ % s ] " ) in pp fmt " % a % a " print_attrs t_attrs print_t_node t_node |
let board_width = 10 and board_height = 22 |
let term_color_map = function | Cyan -> cyan | Yellow -> yellow | Purple -> lred | Green -> green | Red -> red | Blue -> lblue | Orange -> lyellow |
let cell_color = function | Empty -> black | Color x -> term_color_map x |
let cell_char = function | Empty -> S " " | Color _ -> S " " # |
type event_or_tick = LEvent of LTerm_event . t | LTick |
let wait_for_event ui = LTerm_ui . wait ui >>= fun x -> return ( LEvent x ) |
let wait_for_tick ( ) = Lwt_unix . sleep ( gravity_period gravity ) >>= fun ( ) -> return ( LTick ) |
let rec loop ui state event_thread tick_thread = Lwt . choose [ event_thread ; tick_thread ] >>= fun e -> let cstate = ! state in let rstate = initial_state cstate . width cstate . height in LTerm_ui . draw ui ; match e with | LEvent ( LTerm_event . Key { code = Up } ) -> state := if cstate . over then rstate else update_state RotateCw cstate ; loop ui state ( wait_for_event ui ) tick_thread | LEvent ( LTerm_event . Key { code = Down } ) -> state := if cstate . over then rstate else update_state RotateCCw cstate ; loop ui state ( wait_for_event ui ) tick_thread | LEvent ( LTerm_event . Key { code = Char _ } ) -> state := if cstate . over then rstate else update_state HardDrop cstate ; loop ui state ( wait_for_event ui ) tick_thread | LEvent ( LTerm_event . Key { code = Left } ) -> state := if cstate . over then rstate else update_state MoveLeft cstate ; loop ui state ( wait_for_event ui ) tick_thread | LEvent ( LTerm_event . Key { code = Right } ) -> state := if cstate . over then rstate else update_state MoveRight cstate ; loop ui state ( wait_for_event ui ) tick_thread | LEvent ( LTerm_event . Key { code = Escape } ) -> return ( ) | LTick -> if not cstate . over then state := update_state Tick cstate ; loop ui state event_thread ( wait_for_tick ( ) ) | _ -> loop ui state ( wait_for_event ui ) tick_thread |
let draw_cell ctx v x y = LTerm_draw . draw_styled ctx y ( x + 1 ) ( eval [ B_bg ( cell_color v ) ; ( cell_char v ) ; E_fg ] ) |
let draw_tetromino ctx state = ignore ( BatList . map ( ( fun ( x , y ) -> draw_cell ctx ( Color state . tetromino . color ) x y ) % ( xyplus state . position ) % ( rotate ( rotation_matrix state . rotation ) state . tetromino . center ) ) state . tetromino . geometry ) |
let draw ui matrix state = let size = LTerm_ui . size ui in let ctx = LTerm_draw . context matrix size in LTerm_draw . clear ctx ; let draw_legend = let lctx = LTerm_draw . sub ctx { row1 = 0 ; col1 = state . width + 6 ; row2 = state . height ; col2 = 60 } in LTerm_draw . draw_styled lctx 1 0 ( eval [ B_fg cyan ; S ( Printf . sprintf " Score : % u " state . score ) ; E_fg ] ) ; LTerm_draw . draw_styled lctx 2 0 ( eval [ B_fg lblue ; S ( Printf . sprintf " Level : % u " state . level ) ; E_fg ] ) ; LTerm_draw . draw_styled lctx 5 0 ( eval [ B_fg green ; S " Controls " : ; E_fg ] ) ; LTerm_draw . draw_styled lctx 6 2 ( eval [ B_fg yellow ; S " , <- " -> ; E_fg ] ) ; LTerm_draw . draw_styled lctx 6 12 ( eval [ B_fg white ; S " : move " ; E_fg ] ) ; LTerm_draw . draw_styled lctx 7 2 ( eval [ B_fg yellow ; S " Up , Down " ; E_fg ] ) ; LTerm_draw . draw_styled lctx 7 12 ( eval [ B_fg white ; S " : rotate " ; E_fg ] ) ; LTerm_draw . draw_styled lctx 8 2 ( eval [ B_fg yellow ; S " Space " ; E_fg ] ) ; LTerm_draw . draw_styled lctx 8 12 ( eval [ B_fg white ; S " : drop " ; E_fg ] ) ; LTerm_draw . draw_styled lctx 9 2 ( eval [ B_fg yellow ; S " Esc " ; E_fg ] ) ; LTerm_draw . draw_styled lctx 9 12 ( eval [ B_fg white ; S " : quit " ; E_fg ] ) ; LTerm_draw . draw_styled lctx ( state . height - 1 ) 0 ( eval [ B_fg blue ; S " https :// github . com / vzaliva / otetris " ; E_fg ] ) in let draw_glass = let w = state . width and h = state . height in LTerm_draw . draw_frame ctx { row1 = - 1 ; col1 = 0 ; row2 = h + 1 ; col2 = w + 3 } LTerm_draw . Heavy ; let ctx = LTerm_draw . sub ctx { row1 = 0 ; col1 = 1 ; row2 = h ; col2 = w + 2 } in ignore ( iter2D state . cells w ( draw_cell ctx ) ) ; if ( state . over ) then let my = state . height / 2 in let mctx = LTerm_draw . sub ctx { row1 = my - 1 ; col1 = 0 ; row2 = my + 2 ; col2 = w + 1 } in let bst = { bold = Some true ; underline = None ; blink = Some true ; reverse = Some true ; foreground = Some red ; background = Some black ; } in LTerm_draw . fill mctx ? style ( : Some bst ) ( UChar . of_char ' ' ) ; * LTerm_draw . draw_frame mctx { row1 = 0 ; col1 = 0 ; row2 = 3 ; col2 = w + 1 } LTerm_draw . Heavy ; LTerm_draw . draw_styled mctx 1 1 ( eval [ B_fg red ; S " Game over " ; E_fg ] ) else draw_tetromino ctx state in draw_glass ; draw_legend Random . self_init ( ) ; let ( state ( : Tetris . state ref ) ) = ref ( initial_state board_width board_height ) in let % lwt term = Lazy . force LTerm . stdout in let % lwt ui = LTerm_ui . create term ( fun matrix size -> draw matrix size ! state ) in ( loop ui state ( wait_for_event ui ) ( wait_for_tick ( ) ) ) [ % lwt . finally LTerm_ui . quit ui ] |
let rec write_glyph ttf key glyf = |
let write_font ch ttf glyphs = ( ) |
let to_canvas ttf range_str = |
type header = { } |
type entry = { } |
type glyf_header = { } |
type glyf_simple = { } |
type glyf_component = { } |
type hmtx = { } |
type cmap_subtable_header = { } |
type cmap_format_0 = { } |
type cmap_format_4 = { } |
type cmap_format_6 = { } |
type cmap_format_12_group = { } |
type cmap_format_12 = { } |
type cmap_subtable = { } |
type cmap = { } |
type kern_subtable_header = { } |
type kern_pair = { } |
type kern_format_0 = { } |
type kern_format_2 = { } |
type kern_subtable = { } |
type kern = { } |
type name_record = { } |
type name = { } |
type head = { } |
type hhea = { } |
type loca = int32 array |
type maxp = { } |
type os2 = { } |
type ttf = { } |
type ttf_config = { } |
module type TEST_PIPELINE = functor ( Bfx : Biokepi . EDSL . Semantics ) -> sig val run : unit -> unit Bfx . observation end |
module Run_test ( Test_pipeline : TEST_PIPELINE ) = struct let write_file file ~ content = let out_file = open_out file in try output_string out_file content ; close_out out_file with _ -> close_out out_file let cmdf fmt = ksprintf ( fun s -> printf " CMD : % s \ n " %! s ; match Sys . command s with | 0 -> ( ) | other -> ksprintf failwith " non - zero - exit : % s -> % d " s other ) fmt let ( ) // = Filename . concat let test_dir = " _build / ttfi - test - results " / let main prefix = let start_time = Unix . gettimeofday ( ) in cmdf " mkdir - p % s " test_dir ; let results = ref [ ] in let add_result fmt = ksprintf ( fun s -> results := s :: ! results ) fmt in let add_result_file name path = let size = let s = Unix . stat path in match s . Unix . st_size with | 0 -> " EMPTY " | small when small < 1024 -> sprintf " % d B " small | avg when avg < ( 1024 * 1024 ) -> sprintf " . % 2f KB " ( float avg . / 1024 . ) | big -> sprintf " . % 2f MB " ( float big . / ( 1024 . . * 1024 . ) ) in add_result " % s : ` % s ` ( % s ) " name path size ; in let output_path suffix = test_dir // prefix ^ suffix in begin let module Display_pipeline = Test_pipeline ( Biokepi . EDSL . Compile . To_display ) in let pseudocode = output_path " - pseudocode . txt " in write_file pseudocode ~ content ( : Display_pipeline . run ( ) |> SmartPrint . to_string 80 2 ) ; add_result_file " Pseudo - code " pseudocode ; end ; begin let module Jsonize_pipeline = Test_pipeline ( Biokepi . EDSL . Compile . To_json ) in let json = output_path " . json " in write_file json ~ content ( : Jsonize_pipeline . run ( ) |> Yojson . Basic . pretty_to_string ~ std : true ) ; add_result_file " JSON " json ; end ; let output_dot sm dot png = try let out = open_out dot in SmartPrint . to_out_channel 80 2 out sm ; close_out out ; add_result_file " DOT " dot ; let dotlog = png ^ " . log " in cmdf " dot - v - x - Tpng % s - o % s > % s 2 >& 1 " dot png dotlog ; add_result_file " PNG " png ; with e -> add_result " FAILED TO OUTPUT : % s ( % s ) " dot ( Printexc . to_string e ) ; in begin let module Dotize_pipeline = Test_pipeline ( Biokepi . EDSL . Compile . To_dot ) in let sm_dot = Dotize_pipeline . run ( ) Biokepi . EDSL . Compile . To_dot . default_parameters in let dot = output_path " - 1 . dot " in let png = output_path " - 1 . png " in output_dot sm_dot dot png end ; begin let module Dotize_twice_beta_reduced_pipeline = Test_pipeline ( Biokepi . EDSL . Transform . Apply_functions ( Biokepi . EDSL . Transform . Apply_functions ( Biokepi . EDSL . Compile . To_dot ) ) ) in let dot = output_path " - double - beta . dot " in let sm_dot = Dotize_twice_beta_reduced_pipeline . run ( ) ~ parameters : Biokepi . EDSL . Compile . To_dot . default_parameters in let png = output_path " - double - beta . png " in output_dot sm_dot dot png end ; begin let module Workflow_compiler = Biokepi . EDSL . Compile . To_workflow . Make ( struct include Biokepi . EDSL . Compile . To_workflow . Defaults let processors = 42 let work_dir = " / work / dir " / let results_dir = Some " / result / dir " let machine = Biokepi . Setup . Build_machine . create " ssh :// example . com / tmp / KT " / end ) in let module Ketrew_pipeline = Test_pipeline ( Workflow_compiler ) in let workflow = Ketrew_pipeline . run ( ) |> Biokepi . EDSL . Compile . To_workflow . get_workflow ~ name " : Biokepi TTFI test top - level node " in ignore workflow end ; let end_time = Unix . gettimeofday ( ) in add_result " Total - time : . % 2f s " ( end_time . - start_time ) ; List . rev ! results end |
module Pipeline_insane ( Bfx : Biokepi . EDSL . Semantics ) = struct let fastq_list ~ dataset files = List . map files ~ f : begin function | ` Pair ( r1 , r2 ) -> if Filename . check_suffix r1 " . gz " || Filename . check_suffix r1 " . fqz " then Bfx . ( fastq_gz ~ sample_name : dataset ~ r1 ( : input_url r1 ) ~ r2 ( : input_url r2 ) ( ) |> gunzip ) else Bfx . ( fastq ~ sample_name : dataset ~ r1 ( : input_url r1 ) ~ r2 ( : input_url r2 ) ( ) ) end |> Bfx . list let every_vc_on_fastqs ~ reference_build ~ normal ~ tumor = let aligner which_one = Bfx . lambda ( fun fq -> which_one ~ reference_build fq ) in let align_list how ( list_of_fastqs : [ ` Fastq ] list Bfx . repr ) = Bfx . list_map list_of_fastqs ~ f : how |> Bfx . merge_bams in let aligners = Bfx . list [ aligner @@ Bfx . bwa_aln ? configuration : None ; aligner @@ Bfx . bwa_mem ? configuration : None ; aligner @@ Bfx . hisat ~ configuration : Biokepi . Tools . Hisat . Configuration . default_v1 ; aligner @@ Bfx . hisat ~ configuration : Biokepi . Tools . Hisat . Configuration . default_v2 ; aligner @@ Bfx . star ~ configuration : Biokepi . Tools . Star . Configuration . Align . default ; aligner @@ Bfx . mosaik ; aligner @@ ( fun ~ reference_build fastq -> Bfx . bwa_aln ~ reference_build fastq |> Bfx . bam_to_fastq ` PE |> Bfx . bwa_mem ? configuration : None ~ reference_build ) ; ] in let somatic_of_pair how = Bfx . lambda ( fun pair -> let normal = Bfx . pair_first pair in let tumor = Bfx . pair_second pair in how ~ normal ~ tumor ( ) ) in let somatic_vcs = List . map ~ f : somatic_of_pair [ Bfx . mutect ~ configuration : Biokepi . Tools . Mutect . Configuration . default ; Bfx . mutect2 ~ configuration : Biokepi . Tools . Gatk . Configuration . Mutect2 . default ; Bfx . somaticsniper ~ configuration : Biokepi . Tools . Somaticsniper . Configuration . default ; Bfx . strelka ~ configuration : Biokepi . Tools . Strelka . Configuration . default ; Bfx . varscan_somatic ? adjust_mapq : None ; Bfx . muse ~ configuration : Biokepi . Tools . Muse . Configuration . wes ; Bfx . virmid ~ configuration : Biokepi . Tools . Virmid . Configuration . default ; ] in let aligned_pairs : ( ( [ ` Fastq ] list * [ ` Fastq ] list ) -> ( [ ` Bam ] * [ ` Bam ] ) list ) Bfx . repr = Bfx . lambda ( fun pair -> Bfx . list_map aligners ~ f ( : Bfx . lambda ( fun ( al : ( [ ` Fastq ] -> [ ` Bam ] ) Bfx . repr ) -> Bfx . pair ( align_list al ( Bfx . pair_first pair : [ ` Fastq ] list Bfx . repr ) ) ( align_list al ( Bfx . pair_second pair ) ) ) ) ) in let vcfs = Bfx . lambda ( fun pair -> List . map somatic_vcs ~ f ( : fun vc -> Bfx . list_map ( Bfx . apply aligned_pairs pair ) ~ f ( : Bfx . lambda ( fun bam_pair -> let ( ) ||> x f = Bfx . apply f x in let indelreal = Bfx . lambda ( fun pair -> Bfx . gatk_indel_realigner_joint ~ configuration : Biokepi . Tools . Gatk . Configuration . default_indel_realigner pair ) in let map_pair f = Bfx . lambda ( fun pair -> let b1 = Bfx . pair_first pair in let b2 = Bfx . pair_second pair in Bfx . pair ( f b1 ) ( f b2 ) ) in let bqsr_pair = Bfx . gatk_bqsr ~ configuration : Biokepi . Tools . Gatk . Configuration . default_bqsr |> map_pair in let markdups_pair = Bfx . picard_mark_duplicates ~ configuration : Biokepi . Tools . Picard . Mark_duplicates_settings . default |> map_pair in bam_pair ||> markdups_pair ||> indelreal ||> bqsr_pair ||> vc ||> Bfx . lambda Bfx . to_unit ) ) ) |> Bfx . list ) in let workflow_of_pair = Bfx . lambda ( fun pair -> Bfx . list [ ( Bfx . apply aligned_pairs pair |> Bfx . list_map ~ f ( : Bfx . lambda ( fun p -> Bfx . pair_first p |> Bfx . stringtie ~ configuration : Biokepi . Tools . Stringtie . Configuration . default ) ) ) |> Bfx . to_unit ; Bfx . apply vcfs pair |> Bfx . to_unit ; begin Bfx . apply ( Bfx . lambda ( fun p -> Bfx . pair_first p |> Bfx . concat |> Bfx . seq2hla ) ) pair |> Bfx . to_unit end ; begin Bfx . apply ( Bfx . lambda ( fun p -> Bfx . pair_first p |> Bfx . concat |> Bfx . fastqc ) ) pair |> Bfx . to_unit end ; begin Bfx . apply ( Bfx . lambda ( fun p -> Bfx . pair_second p |> Bfx . concat |> Bfx . optitype ` RNA ) ) pair |> Bfx . to_unit end ; begin Bfx . apply aligned_pairs pair |> Bfx . list_map ~ f ( : Bfx . lambda ( fun p -> Bfx . pair_first p |> Bfx . gatk_haplotype_caller ) ) |> Bfx . to_unit end ; ] |> Bfx . to_unit ) in Bfx . apply workflow_of_pair ( Bfx . pair normal tumor ) let normal = ( " normal - 1 " , [ ` Pair ( " / input / normal - 1 - 001 - r1 . fastq " , " / input / normal - 1 - 001 - r2 . fastq " ) ; ` Pair ( " / input / normal - 1 - 002 - r1 . fastq " , " / input / normal - 1 - 002 - r2 . fastq " ) ; ` Pair ( " / input / normal - 1 - 003 - r1 . fqz " , " / input / normal - 1 - 003 - r2 . fqz " ) ; ] ) let tumor = ( " tumor - 1 " , [ ` Pair ( " / input / tumor - 1 - 001 - r1 . fastq . gz " , " / input / tumor - 1 - 001 - r2 . fastq . gz " ) ; ` Pair ( " / input / tumor - 1 - 002 - r1 . fastq . gz " , " / input / tumor - 1 - 002 - r2 . fastq . gz " ) ; ] ) let run ( ) = Bfx . observe ( fun ( ) -> every_vc_on_fastqs ~ reference_build " : b37 " ~ normal ( : fastq_list ~ dataset ( : fst normal ) ( snd normal ) ) ~ tumor ( : fastq_list ~ dataset ( : fst tumor ) ( snd tumor ) ) ) end |
module Somatic_simplish ( Bfx : Biokepi . EDSL . Semantics ) = struct module Insane_library = Pipeline_insane ( Bfx ) let vc = let normal = Insane_library . ( fastq_list ~ dataset ( : fst normal ) ( snd normal ) ) in let tumor = Insane_library . ( fastq_list ~ dataset ( : fst tumor ) ( snd tumor ) ) in let ot_hla = normal |> Bfx . concat |> Bfx . optitype ` DNA |> Bfx . to_unit in let align fastq = Bfx . list_map fastq ~ f ( : Bfx . lambda ( fun fq -> Bfx . bwa_mem fq ~ reference_build " : b37 " |> Bfx . picard_mark_duplicates ~ configuration : Biokepi . Tools . Picard . Mark_duplicates_settings . default ) ) in let normal_bam = align normal |> Bfx . merge_bams in let tumor_bam = align tumor |> Bfx . merge_bams in let bam_pair = Bfx . pair normal_bam tumor_bam in let indel_realigned_pair = Bfx . gatk_indel_realigner_joint bam_pair ~ configuration : Biokepi . Tools . Gatk . Configuration . default_indel_realigner in let final_normal_bam = Bfx . pair_first indel_realigned_pair |> Bfx . gatk_bqsr ~ configuration : Biokepi . Tools . Gatk . Configuration . default_bqsr in let final_tumor_bam = Bfx . pair_second indel_realigned_pair |> Bfx . gatk_bqsr ~ configuration : Biokepi . Tools . Gatk . Configuration . default_bqsr in let vcfs = let normal , tumor = final_normal_bam , final_tumor_bam in Bfx . list [ Bfx . mutect ~ normal ~ tumor ( ) |> Bfx . save ~ name " : Mutect VCF " ; Bfx . somaticsniper ~ normal ~ tumor ( ) |> Bfx . save ~ name " : SS VCF " ; Bfx . strelka ~ normal ~ tumor ( ) |> Bfx . save ~ name " : Strelka VCF " ; ] in Bfx . list [ Bfx . to_unit vcfs ; ot_hla ; ] |> Bfx . to_unit let run ( ) = Bfx . observe ( fun ( ) -> vc ) end |
let ( ) = let module Go_insane = Run_test ( Pipeline_insane ) in let insane_result = Go_insane . main " pipeline - insane " in let module Go_simple_somatic = Run_test ( Somatic_simplish ) in let simple_somatic_result = Go_simple_somatic . main " pipeline - simple - somatic " in let display_result mod_name results = printf " - ` % s ` :\ n % s \ n " %! mod_name ( List . map results ~ f ( : sprintf " * % s \ n " ) |> String . concat " " ) ; in printf " \ n ### Test results :\ n \ n " ; display_result " Pipeline_insane " insane_result ; display_result " Somatic_simplish " simple_somatic_result ; ( ) |
type ctx = { } |
let parse_header ctx = { } |
let parse_directory ctx header = } done ; directory |
let parse_head_table ctx = { } |
let parse_hhea_table ctx = { } |
let parse_maxp_table ctx = { } |
let parse_loca_table head maxp ctx = else |
let parse_hmtx_table maxp hhea ctx = ! last_advance_width else in { } ) |
let parse_cmap_table ctx = { } } } } | 12 -> { } } in { } in { } |
let parse_glyf_table maxp loca cmap hmtx ctx = v 1 end in end end ; } ) arg1 , arg2 arg1 , arg2 NoScale in } ; in in ) |
let parse_kern_table ctx = { } } } in { } } { } |
let parse_name_table ctx = { } in r { } , ! ttf_name |
let parse_os2_table ctx = { } |
let parse file : ttf = } in try in try None in { } |
let num_bits x = 0 else in |
let round x = int_of_float ( floor ( x . + 0 . 5 ) 5 ) 5 |
let to_twips v = round ( v . * 20 ) . |
type ctx = { } |
let align_bits x nbits = x land ( ( 1 lsl nbits ) - 1 ) 1 |
let move_to ctx x y = } |
let line_to ctx x y = } |
let curve_to ctx cx cy ax ay = } |
let write_paths ctx paths = try ( ) { } |
let rec write_glyph ctx key glyf = { } |
let write_font_layout ctx lut = { { } |
let bi v = if v then 1 else 0 |
let write_font2 ch b f2 = ) f2 . font_glyphs ; |
let to_swf ttf config = { } ; ; |
type glyf_transformation_matrix = { } |
type glyf_path = { } |
type simple_point = { } |
let mk_path t x y cx cy = { } |
let identity ( ) = { } |
let multiply m x y = |
let matrix_from_composite gc = in { } |
let relative_matrix m = { m with tx = 0 . 0 ; ty = 0 . 0 } 0 |
let make_coords relative mo g = match mo with ) |
let build_paths relative mo g = true false in in } ; in end ; end ; end done ; |
let rec build_glyph_paths ttf relative ( ? transformation = None ) None glyf = [ ] |
let map_char_code cc c4 = else end done ; ! index end |
let parse_range_str str = done ; end lut |
let build_lut ttf range_str = end in done ; done in ( ) ( ) lut |
type tvsymbol = { tv_name : Ident . t } [ @@ deriving show ] |
let tv_equal x y = Ident . equal x . tv_name y . tv_name |
module Tvar = struct type t = tvsymbol let equal = tv_equal let compare x y = Ident . compare x . tv_name y . tv_name let hash tv = Ident . hash tv . tv_name end |
module Htv = Hashtbl . Make ( Tvar ) |
module Mtv = Map . Make ( Tvar ) |
let create_tv id = { tv_name = id } |
let fresh_tv ( ? loc = Location . none ) s = { tv_name = Ident . create ~ loc s } |
let tv_of_string = let hs = Hashtbl . create 0 in fun ( ? loc = Location . none ) s -> try Hashtbl . find hs s with Not_found -> let tv = create_tv ( Ident . create ~ loc s ) in Hashtbl . add hs s tv ; tv |
type ty = { ty_node : ty_node } [ @@ deriving show ] ts_ident : Ident . t ; ts_args : tvsymbol list ; ts_alias : ty option ; } |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.