text stringlengths 0 601k |
|---|
let of_string s = let buf = String . make ( 4 * String . length s ) ' \ 000 ' in for i = 0 to String . length s - 1 do buf . [ 4 * i ] <- s . [ i ] done ; new text_raw buf |
let make len u = let s = String . create ( 4 * len ) in for i = 0 to len - 1 do set_buf s ( 4 * i ) u done ; new string_raw s |
let create len = make len ( UChar . chr 0 ) |
let copy s = s # copy |
let sub s start len = s # sub start len |
let fill s start len u = for i = start to start + len - 1 do s # set i u done |
let blit src srcoff dst dstoff len = for i = 0 to len - 1 do let u = src # get ( srcoff + i ) in dst # set ( dstoff + i ) u done |
let concat s1 s2 = s1 # concat ( s2 :> uchar storage ) |
let iter proc s = s # iter proc end object method foo : string end |
type ' a name = Foo : foo_t name | Int : int name ; ; object ( self ) method foo = " foo " method cast = function Foo -> ( self :> < foo : string ) > end ; ; object ( self ) method foo = " foo " method cast : type a . a name -> a = function Foo -> ( self :> foo_t ) | _ -> raise Exit end ; ; |
module type S = sig class c : c end ; ; object end object ( self ) inherit name val mutable memo_args = None method arguments = match memo_args with | Some xs -> xs | None -> let args = List . map ( fun ty -> new argument ( self , ty ) ) args_ty in memo_args <- Some args ; args end object inherit name end ; ; |
let f ( x : # M . foo ) = 0 ; ; method update : ' e -> ' s end ; ; |
module type S = sig class base : ' e -> [ ' e ] t end ; ; |
type ' par t = ' par |
module M : sig val x : < m : ' a . ' a > end = struct let x : < m : ' a . ' a t > = Obj . magic ( ) end |
let ident v = v |
module Classdef = struct class virtual [ ' a , ' b , ' c ] cl0 = object constraint ' c = < m : ' a -> ' b -> int ; . . > end class virtual [ ' a , ' b ] cl1 = object method virtual raise_trouble : int -> ' a method virtual m : ' a -> ' b -> int end class virtual [ ' a , ' b ] cl2 = object method virtual as_cl0 : ( ' a ... |
type refer1 = < poly : ' a ' b ' c . ( ( ' b , ' c ) # Classdef . cl2 as ' a ) > |
type refer2 = < poly : ' a ' b ' c . ( ( ' b , ' c ) # Classdef . cl2 as ' a ) > |
let f ( x : refer1 ) = ( x : refer2 ) |
module Classdef = struct class virtual [ ' a , ' b , ' c ] cl0 = object constraint ' c = < m : ' a -> ' b -> int ; . . > end class virtual [ ' a , ' b ] cl1 = object method virtual raise_trouble : int -> ' a method virtual m : ' a -> ' b -> int end class virtual [ ' a , ' b ] cl2 = object method virtual as_cl0 : ( ' a ... |
module M : sig type refer = { poly : ' a ' b ' c . ( ( ' b , ' c ) # Classdef . cl2 as ' a ) } type refer = { poly : ' a ' b ' c . ( ( ' b , ' c ) # Classdef . cl2 as ' a ) } end |
let f x = ( x : ' a vlist :> ' b vlist ) |
let f ( x : ' a vlist ) = ( x : ' b vlist ) |
module type Poly = sig type ' a t = ' a constraint ' a = [ > ] end |
module Combine ( A : Poly ) ( B : Poly ) = struct type ( ' a , ' b ) t = ' a A . t constraint ' a = ' b B . t end |
module C = Combine ( struct type ' a t = ' a constraint ' a = [ > ] end ) ( struct type ' a t = ' a constraint ' a = [ > ] end ) |
module type Priv = sig type t = private int end |
module Make ( Unit : sig end ) : Priv = struct type t = int end |
module A = Make ( struct end ) |
module type Priv ' = sig type t = private [ > ` A ] end |
module Make ' ( Unit : sig end ) : Priv ' = struct type t = [ ` A ] end |
module A ' = Make ' ( struct end ) |
module TT = struct module IntSet = Set . Make ( struct type t = int let compare = compare end ) end |
let ( ) = let f flag = let module T = TT in let _ = match flag with ` A -> 0 | ` B r -> r in let _ = match flag with ` A -> T . IntSet . mem | ` B r -> r in ( ) in f ` A |
let f flag = let module T = Set . Make ( struct type t = int let compare = compare end ) in let _ = match flag with ` A -> 0 | ` B r -> r in let _ = match flag with ` A -> T . mem | ` B r -> r in ( ) |
module type S = sig type ' + a t val foo : [ ` A ] t -> unit val bar : [ < ` A | ` B ] t -> unit end |
module Make ( T : S ) = struct let f x = T . foo x ; T . bar x ; ( x :> [ ` A | ` C ] T . t ) end |
type ' a termpc = [ ` And of ' a * ' a ` | Or of ' a * ' a ` | Not of ' a ` | Atom of string ] |
type ' a termk = [ ` Dia of ' a ` | Box of ' a ' | a termpc ] |
module type T = sig type term val map : ( term -> term ) -> term -> term val nnf : term -> term val nnf_not : term -> term end |
module Fpc ( X : T with type term = private [ > ' a termpc ] as ' a ) = struct type term = X . term termpc let nnf = function ` | Not ( ` Atom _ ) as x -> x ` | Not x -> X . nnf_not x | x -> X . map X . nnf x let map f : term -> X . term = function ` | Not x -> ` Not ( f x ) ` | And ( x , y ) -> ` And ( f x , f y ) ` |... |
module Fk ( X : T with type term = private [ > ' a termk ] as ' a ) = struct type term = X . term termk module Pc = Fpc ( X ) let map f : term -> _ = function ` | Dia x -> ` Dia ( f x ) ` | Box x -> ` Box ( f x ) |# termpc as x -> Pc . map f x let nnf = Pc . nnf let nnf_not : term -> _ = function ` | Dia x -> ` Box ( X... |
type ' - a typed = private untyped ; ; |
type ' - typing wrapped = private sexp val underlying : ' a t end ; ; val underlying = r end ; ; |
module M ( T : sig type t end ) = struct type t = private { t : T . t } end |
module P = struct module T = struct type t end module R = M ( T ) end |
module Foobar : sig type t = private int type t = int end ; ; |
module F0 : sig type t = private int end = Foobar ; ; |
let f ( x : F0 . t ) = ( x : Foobar . t ) ; ; |
let f ( x : F . t ) = ( x : Foobar . t ) ; ; |
module M = struct type t = < m : int > end ; ; |
module M1 : sig type t = private < m : int ; . . > end = M ; ; |
module M2 : sig type t = private < m : int ; . . > end = M1 ; ; |
module M3 : sig type t = private M1 . t end = M1 ; ; |
module M4 : sig type t = private M3 . t end = M2 ; ; |
module M4 : sig type t = private M3 . t end = M ; ; |
module M4 : sig type t = private M3 . t end = M1 ; ; |
module M5 : sig type t = private M1 . t end = M3 ; ; |
module M6 : sig type t = private < n : int ; . . > end = M1 ; ; |
module Bar : sig type t = private Foobar . t val f : int -> t end = struct type t = int let f ( x : int ) = ( x : t ) end ; ; |
module M : sig type t = private T of int val mk : int -> t type t = T of int let mk x = T ( x ) end ; ; |
module M1 : sig type t = M . t val mk : int -> t type t = M . t let mk = M . mk end ; ; |
module M2 : sig type t = M . t val mk : int -> t include M end ; ; |
module M3 : sig type t = M . t val mk : int -> t |
module M4 : sig type t = M . t = T of int val mk : int -> t end = M ; ; |
module M5 : sig type t = M . t = private T of int val mk : int -> t |
module M6 : sig type t = private T of int val mk : int -> t |
module M ' : sig type t_priv = private T of int type t = t_priv val mk : int -> t type t_priv = T of int type t = t_priv let mk x = T ( x ) end ; ; |
module M3 ' : sig type t = M ' . t val mk : int -> t |
module M : sig type ' a t = private T of ' a end = struct type ' a t = T of ' a end ; ; |
module M1 : sig type ' a t = ' a M . t = private T of ' a end = struct type ' a t = ' a M . t = private T of ' a end ; ; |
module Test = struct type t = private A end |
module Test2 : module type of Test with type t = Test . t = Test ; ; |
let f ( x : Test . t ) = ( x : Test2 . t ) ; ; |
let f Test2 . A = ( ) ; ; |
module Test2 : module type of Test with type t = private Test . t = Test ; ; |
type t = private < x : int ; . . > as ' a ; ; |
type t = private ( < x : int ; . . > as ' a ) as ' a ; ; |
type t = private < x : int > as ' a ; ; |
type t = private ( < x : int > as ' a ) as ' b ; ; |
type ' a t = private < x : int ; . . > as ' a ; ; |
type ' a t = private ' a constraint ' a = < x : int ; . . ; ; > |
module rec A : sig type t = A . t end = struct type t = A . t end ; ; |
module rec A : sig type t = B . t end = struct type t = B . t end and B : sig type t = A . t end = struct type t = A . t end ; ; |
module rec A : sig type t = B . t end = struct type t = B . t end and B : sig type t = int end = struct type t = int end ; ; |
module rec A : sig type t = int * A . t end = struct type t = int * A . t end ; ; |
module rec A : sig type t = B . t -> int end = struct type t = B . t -> int end and B : sig type t = A . t end = struct type t = A . t end ; ; |
module rec A : sig type t = < m : B . t > end = struct type t = < m : B . t > end and B : sig type t = A . t end = struct type t = A . t end ; ; |
module rec A : sig type ' a t = < m : ' a list A . t > end = struct type ' a t = < m : ' a list A . t > end ; ; |
module rec A : sig type ' a t = < m : ' a list B . t ; n : ' a array B . t > end = struct type ' a t = < m : ' a list B . t ; n : ' a array B . t > end and B : sig type ' a t = ' a A . t end = struct type ' a t = ' a A . t end ; ; |
module rec A : sig type ' a t = ' a B . t end = struct type ' a t = ' a B . t end and B : sig type ' a t = < m : ' a list A . t ; n : ' a array A . t > end = struct type ' a t = < m : ' a list A . t ; n : ' a array A . t > end ; ; |
module rec A : sig type ' a t = ' a array B . t * ' a list B . t end = struct type ' a t = ' a array B . t * ' a list B . t end and B : sig type ' a t = < m : ' a B . t > end = struct type ' a t = < m : ' a B . t > end ; ; |
module rec A : sig type ' a t = ' a list B . t end = struct type ' a t = ' a list B . t end and B : sig type ' a t = < m : ' a array B . t > end = struct type ' a t = < m : ' a array B . t > end ; ; |
module rec M : sig class [ ' a ] c : ' a -> object method map : ( ' a -> ' b ) -> ' b M . c end end = struct class [ ' a ] c ( x : ' a ) = object method map : ' b . ( ' a -> ' b ) -> ' b M . c = fun f -> new M . c ( f x ) end end ; ; |
type t = x node ; ; |
module PR_4261 = struct module type S = sig type t end module type T = sig module D : S type t = D . t end module rec U : T with module D = U ' = U and U ' : S with type t = U ' . t = U end ; ; |
module type S ' = sig type t = int end |
module rec M : S ' with type t = M . t = struct type t = M . t end ; ; |
module PR_4450_1 = struct module type MyT = sig type ' a t = Succ of ' a t end module MyMap ( X : MyT ) = X module rec MyList : MyT = MyMap ( MyList ) end ; ; |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.