text
stringlengths
12
786k
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 . comm...
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 ~ sampl...
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 t...
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 displ...
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 ; }
let ts_equal x y = Ident . equal x . ts_ident y . ts_ident
let rec ty_equal x y = match ( x . ty_node , y . ty_node ) with | Tyvar tvx , Tyvar tvy -> tv_equal tvx tvy | Tyapp ( tsx , tylx ) , Tyapp ( tsy , tyly ) -> ts_equal tsx tsy && List . for_all2 ty_equal tylx tyly | _ -> false
module Ts = struct type t = tysymbol let equal = ts_equal let hash x = x . ts_ident . id_tag let compare x y = Ident . compare x . ts_ident y . ts_ident end
module Mts = Map . Make ( Ts )
module Hts = Hashtbl . Make ( Ts )
let ts id args = { ts_ident = id ; ts_args = args ; ts_alias = None }
let mk_ts id args alias = { ts_ident = id ; ts_args = args ; ts_alias = alias }
let ts_ident ts = ts . ts_ident
let ts_args ts = ts . ts_args
let ts_alias ts = ts . ts_alias
let ts_arity ts = List . length ts . ts_args
let fresh_ty_var ( ? loc = Location . none ) s = { ty_node = Tyvar { tv_name = Ident . create ~ loc s } }
let ty_of_var tv = { ty_node = Tyvar tv }
let ty_app ts tyl = if ts_arity ts = List . length tyl then { ty_node = Tyapp ( ts , tyl ) } else W . error ~ loc : ts . ts_ident . id_loc ( W . Bad_type_arity ( ts . ts_ident . id_str , ts_arity ts , List . length tyl ) )
let rec ty_full_inst m ty = match ty . ty_node with | Tyvar tv -> Mtv . find tv m | Tyapp ( ts , tyl ) -> ty_app ts ( List . map ( ty_full_inst m ) tyl )
let ts_match_args ts tl = try List . fold_right2 Mtv . add ts . ts_args tl Mtv . empty with Invalid_argument _ -> W . error ~ loc : ts . ts_ident . id_loc ( W . Bad_type_arity ( ts . ts_ident . id_str , ts_arity ts , List . length tl ) )
let ty_app ts tyl = match ts . ts_alias with | None -> ty_app ts tyl | Some ty -> ty_full_inst ( ts_match_args ts tyl ) ty
let rec ts_subst_ts old_ts new_ts ( { ts_ident ; ts_args ; ts_alias } as ts ) = if ts_equal old_ts ts then new_ts else let ts_alias = Option . map ( ty_subst_ts old_ts new_ts ) ts_alias in mk_ts ts_ident ts_args ts_alias match ty . ty_node with | Tyvar _ -> ty | Tyapp ( ts , tyl ) -> le...
let rec ty_subst_ty old_ts new_ts new_ty ty = match ty . ty_node with | Tyvar _ -> ty | Tyapp ( ts , tyl ) -> if ts_equal old_ts ts then ty_full_inst ( ts_match_args new_ts tyl ) new_ty else let subst ty = ty_subst_ty old_ts new_ts new_ty ty in let tyl = List . map subst tyl in ty_app ts tyl let s...
let rec ty_match mtv ty1 ty2 = let set = function | None -> Some ty2 | Some ty1 as r when ty_equal ty1 ty2 -> r | _ -> raise Exit in match ( ty1 . ty_node , ty2 . ty_node ) with | Tyvar tv1 , _ -> Mtv . update tv1 set mtv | Tyapp ( ts1 , tyl1 ) , Tyapp ( ts2 , tyl2 ) when ts_equ...
let ty_match mtv ty1 ty2 = let rec ty_inst mtv ty = match ty . ty_node with | Tyvar n -> ( try Mtv . find n mtv with Not_found -> ty ) | Tyapp ( ts , tyl ) -> { ty_node = Tyapp ( ts , List . map ( ty_inst mtv ) tyl ) } in try ty_match mtv ty1 ty2 with Exit -> raise ( TypeMismatc...
let ty_equal_check ty1 ty2 = if not ( ty_equal ty1 ty2 ) then raise ( TypeMismatch ( ty1 , ty2 ) )
let ts_unit = ts ( Ident . create ~ loc : Location . none " unit " ) [ ]
let ts_integer = ts ( Ident . create ~ loc : Location . none " integer " ) [ ]
let ts_int = ts ( Ident . create ~ loc : Location . none " int " ) [ ]
let ts_char = ts ( Ident . create ~ loc : Location . none " char " ) [ ]
let ts_bytes = ts ( Ident . create ~ loc : Location . none " bytes " ) [ ]
let ts_string = ts ( Ident . create ~ loc : Location . none " string " ) [ ]
let ts_float = ts ( Ident . create ~ loc : Location . none " float " ) [ ]
let ts_bool = ts ( Ident . create ~ loc : Location . none " bool " ) [ ]
let ts_exn = ts ( Ident . create ~ loc : Location . none " exn " ) [ ]
let ts_array = ts ( Ident . create ~ loc : Location . none " array " ) [ fresh_tv ~ loc : Location . none " a " ]
let ts_list = ts ( Ident . create ~ loc : Location . none " list " ) [ fresh_tv ~ loc : Location . none " a " ]
let ts_option = ts ( Ident . create ~ loc : Location . none " option " ) [ fresh_tv ~ loc : Location . none " a " ]
let ts_int32 = ts ( Ident . create ~ loc : Location . none " int32 " ) [ ]
let ts_int64 = ts ( Ident . create ~ loc : Location . none " int64 " ) [ ]
let ts_nativeint = ts ( Ident . create ~ loc : Location . none " nativeint " ) [ ]