package learn-ocaml

  1. Overview
  2. Docs
val set_result : Learnocaml_report.t -> unit
type nonrec !'a result = ('a, exn) Stdlib.result
module Ast_checker : sig ... end
type !'a tester = 'a Ty.ty -> 'a result -> 'a result -> Learnocaml_report.t
type io_tester = string -> string -> Learnocaml_report.t
type io_postcond = string -> Learnocaml_report.t
exception Timeout of int
module Tester : sig ... end
module Mutation : sig ... end
module Sampler : sig ... end
module Sampler_reg : sig ... end
module Test_functions_ref_var : sig ... end
module Test_functions_types : sig ... end
module Test_functions_function : sig ... end
module Test_functions_generic : sig ... end
val (@@@) : ('a -> Learnocaml_report.t) -> ('a -> Learnocaml_report.t) -> 'a -> Learnocaml_report.t
type !'a ast_checker = ?on_expression:(Parsetree.expression -> Learnocaml_report.t) -> ?on_pattern:(Parsetree.pattern -> Learnocaml_report.t) -> ?on_structure_item:(Parsetree.structure_item -> Learnocaml_report.t) -> ?on_external:(Parsetree.value_description -> Learnocaml_report.t) -> ?on_include:(Parsetree.include_declaration -> Learnocaml_report.t) -> ?on_open:(Parsetree.open_declaration -> Learnocaml_report.t) -> ?on_module_occurence:(string -> Learnocaml_report.t) -> ?on_variable_occurence:(string -> Learnocaml_report.t) -> ?on_function_call: ((Parsetree.expression * (string * Parsetree.expression) list) -> Learnocaml_report.t) -> 'a -> Learnocaml_report.t
val ast_check_expr : Parsetree.expression ast_checker
val ast_check_structure : Parsetree.structure ast_checker
val find_binding : Parsetree.structure -> string -> (Parsetree.expression -> Learnocaml_report.t) -> Learnocaml_report.t
val forbid : string -> ('a -> string) -> 'a list -> 'a -> Learnocaml_report.t
val restrict : string -> ('a -> string) -> 'a list -> 'a -> Learnocaml_report.t
val require : string -> ('a -> string) -> 'a -> 'a -> Learnocaml_report.t
val forbid_expr : string -> Parsetree.expression list -> Parsetree.expression -> Learnocaml_report.t
val restrict_expr : string -> Parsetree.expression list -> Parsetree.expression -> Learnocaml_report.t
val require_expr : string -> Parsetree.expression -> Parsetree.expression -> Learnocaml_report.t
val forbid_syntax : string -> 'a -> Learnocaml_report.t
val require_syntax : string -> 'a -> Learnocaml_report.t
val ast_sanity_check : ?modules:string list -> Parsetree.structure -> (unit -> Learnocaml_report.t) -> Learnocaml_report.t
val test : 'a tester
val test_ignore : 'a tester
val test_eq : ('a result -> 'a result -> bool) -> 'a tester
val test_eq_ok : ('a -> 'a -> bool) -> 'a tester
val test_eq_exn : (exn -> exn -> bool) -> 'a tester
val test_canon : ('a result -> 'a result) -> 'a tester
val test_canon_ok : ('a -> 'a) -> 'a tester
val test_canon_error : (exn -> exn) -> 'a tester
val test_translate : ('a -> 'b) -> 'b tester -> 'b Ty.ty -> 'a tester
val io_test_ignore : io_tester
val io_test_equals : ?trim:char list -> ?drop:char list -> io_tester
val io_test_lines : ?trim:char list -> ?drop:char list -> ?skip_empty:bool -> ?test_line:io_tester -> io_tester
val io_test_items : ?split:char list -> ?trim:char list -> ?drop:char list -> ?skip_empty:bool -> ?test_item:io_tester -> io_tester
type !'arg arg_mutation_test_callbacks = {
  1. before_reference : 'arg -> unit;
  2. before_user : 'arg -> unit;
  3. test : 'ret. ?test_result:'ret tester -> 'ret tester;
}
val arg_mutation_test_callbacks : ?test:'a tester -> dup:('a -> 'a) -> blit:('a -> 'a -> unit) -> 'a Ty.ty -> 'a arg_mutation_test_callbacks
val array_arg_mutation_test_callbacks : ?test:'a array tester -> 'a array Ty.ty -> 'a array arg_mutation_test_callbacks
val ref_arg_mutation_test_callbacks : ?test:'a Stdlib.ref tester -> 'a Stdlib.ref Ty.ty -> 'a Stdlib.ref arg_mutation_test_callbacks
type !'a sampler = unit -> 'a
val sample_int : int sampler
val sample_float : float sampler
val sample_string : string sampler
val sample_char : char sampler
val sample_bool : bool sampler
val sample_list : ?min_size:int -> ?max_size:int -> ?dups:bool -> ?sorted:bool -> 'a sampler -> 'a list sampler
val sample_array : ?min_size:int -> ?max_size:int -> ?dups:bool -> ?sorted:bool -> 'a sampler -> 'a array sampler
val sample_pair : 'a sampler -> 'b sampler -> ('a * 'b) sampler
val sample_alternatively : 'a sampler list -> 'a sampler
val sample_cases : 'a list -> 'a sampler
val sample_option : 'a sampler -> 'a option sampler
val printable_fun : string -> ('a -> 'b) -> 'a -> 'b
val compatible_type : expected:string -> string -> Learnocaml_report.t
val existing_type : ?score:int -> string -> bool * Learnocaml_report.t
val abstract_type : ?allow_private:bool -> ?score:int -> string -> bool * Learnocaml_report.t
val test_student_code : 'a Ty.ty -> ('a -> Learnocaml_report.t) -> Learnocaml_report.t
val test_module_property : 'a Ty.ty -> string -> ('a -> Learnocaml_report.t) -> Learnocaml_report.t
val test_ref : 'a Ty.ty -> 'a Stdlib.ref -> 'a -> Learnocaml_report.t
val test_variable : 'a Ty.ty -> string -> 'a -> Learnocaml_report.t
val test_variable_property : 'a Ty.ty -> string -> ('a -> Learnocaml_report.t) -> Learnocaml_report.t
val test_variable_against_solution : 'a Ty.ty -> string -> Learnocaml_report.t
val test_function_1 : ?test:'b tester -> ?test_stdout:io_tester -> ?test_stderr:io_tester -> ?before:('a -> unit) -> ?after: ('a -> ('b * string * string) -> ('b * string * string) -> Learnocaml_report.t) -> ('a -> 'b) Ty.ty -> string -> ('a * 'b * string * string) list -> Learnocaml_report.t
val test_function_1_against : ?gen:int -> ?test:'b tester -> ?test_stdout:io_tester -> ?test_stderr:io_tester -> ?before_reference:('a -> unit) -> ?before_user:('a -> unit) -> ?after: ('a -> ('b * string * string) -> ('b * string * string) -> Learnocaml_report.t) -> ?sampler:(unit -> 'a) -> ('a -> 'b) Ty.ty -> string -> ('a -> 'b) -> 'a list -> Learnocaml_report.t
val test_function_1_against_solution : ?gen:int -> ?test:'b tester -> ?test_stdout:io_tester -> ?test_stderr:io_tester -> ?before_reference:('a -> unit) -> ?before_user:('a -> unit) -> ?after: ('a -> ('b * string * string) -> ('b * string * string) -> Learnocaml_report.t) -> ?sampler:(unit -> 'a) -> ('a -> 'b) Ty.ty -> string -> 'a list -> Learnocaml_report.t
val test_function_1_against_postcond : ?gen:int -> ?test_stdout:io_postcond -> ?test_stderr:io_postcond -> ?before_reference:('a -> unit) -> ?before_user:('a -> unit) -> ?after:('a -> ('b * string * string) -> Learnocaml_report.t) -> ?sampler:(unit -> 'a) -> ('a -> 'b Ty.ty -> 'b result -> Learnocaml_report.t) -> ('a -> 'b) Ty.ty -> string -> 'a list -> Learnocaml_report.t
val test_function_2 : ?test:'c tester -> ?test_stdout:io_tester -> ?test_stderr:io_tester -> ?before:('a -> 'b -> unit) -> ?after: ('a -> 'b -> ('c * string * string) -> ('c * string * string) -> Learnocaml_report.t) -> ('a -> 'b -> 'c) Ty.ty -> string -> ('a * 'b * 'c * string * string) list -> Learnocaml_report.t
val test_function_2_against : ?gen:int -> ?test:'c tester -> ?test_stdout:io_tester -> ?test_stderr:io_tester -> ?before_reference:('a -> 'b -> unit) -> ?before_user:('a -> 'b -> unit) -> ?after: ('a -> 'b -> ('c * string * string) -> ('c * string * string) -> Learnocaml_report.t) -> ?sampler:(unit -> 'a * 'b) -> ('a -> 'b -> 'c) Ty.ty -> string -> ('a -> 'b -> 'c) -> ('a * 'b) list -> Learnocaml_report.t
val test_function_2_against_solution : ?gen:int -> ?test:'c tester -> ?test_stdout:io_tester -> ?test_stderr:io_tester -> ?before_reference:('a -> 'b -> unit) -> ?before_user:('a -> 'b -> unit) -> ?after: ('a -> 'b -> ('c * string * string) -> ('c * string * string) -> Learnocaml_report.t) -> ?sampler:(unit -> 'a * 'b) -> ('a -> 'b -> 'c) Ty.ty -> string -> ('a * 'b) list -> Learnocaml_report.t
val test_function_2_against_postcond : ?gen:int -> ?test_stdout:io_postcond -> ?test_stderr:io_postcond -> ?before_reference:('a -> 'b -> unit) -> ?before_user:('a -> 'b -> unit) -> ?after:('a -> 'b -> ('c * string * string) -> Learnocaml_report.t) -> ?sampler:(unit -> 'a * 'b) -> ('a -> 'b -> 'c Ty.ty -> 'c result -> Learnocaml_report.t) -> ('a -> 'b -> 'c) Ty.ty -> string -> ('a * 'b) list -> Learnocaml_report.t
val test_function_3 : ?test:'d tester -> ?test_stdout:io_tester -> ?test_stderr:io_tester -> ?before:('a -> 'b -> 'c -> unit) -> ?after: ('a -> 'b -> 'c -> ('d * string * string) -> ('d * string * string) -> Learnocaml_report.t) -> ('a -> 'b -> 'c -> 'd) Ty.ty -> string -> ('a * 'b * 'c * 'd * string * string) list -> Learnocaml_report.t
val test_function_3_against : ?gen:int -> ?test:'d tester -> ?test_stdout:io_tester -> ?test_stderr:io_tester -> ?before_reference:('a -> 'b -> 'c -> unit) -> ?before_user:('a -> 'b -> 'c -> unit) -> ?after: ('a -> 'b -> 'c -> ('d * string * string) -> ('d * string * string) -> Learnocaml_report.t) -> ?sampler:(unit -> 'a * 'b * 'c) -> ('a -> 'b -> 'c -> 'd) Ty.ty -> string -> ('a -> 'b -> 'c -> 'd) -> ('a * 'b * 'c) list -> Learnocaml_report.t
val test_function_3_against_solution : ?gen:int -> ?test:'d tester -> ?test_stdout:io_tester -> ?test_stderr:io_tester -> ?before_reference:('a -> 'b -> 'c -> unit) -> ?before_user:('a -> 'b -> 'c -> unit) -> ?after: ('a -> 'b -> 'c -> ('d * string * string) -> ('d * string * string) -> Learnocaml_report.t) -> ?sampler:(unit -> 'a * 'b * 'c) -> ('a -> 'b -> 'c -> 'd) Ty.ty -> string -> ('a * 'b * 'c) list -> Learnocaml_report.t
val test_function_3_against_postcond : ?gen:int -> ?test_stdout:io_postcond -> ?test_stderr:io_postcond -> ?before_reference:('a -> 'b -> 'c -> unit) -> ?before_user:('a -> 'b -> 'c -> unit) -> ?after:('a -> 'b -> 'c -> ('d * string * string) -> Learnocaml_report.t) -> ?sampler:(unit -> 'a * 'b * 'c) -> ('a -> 'b -> 'c -> 'd Ty.ty -> 'd result -> Learnocaml_report.t) -> ('a -> 'b -> 'c -> 'd) Ty.ty -> string -> ('a * 'b * 'c) list -> Learnocaml_report.t
val test_function_4 : ?test:'e tester -> ?test_stdout:io_tester -> ?test_stderr:io_tester -> ?before:('a -> 'b -> 'c -> 'd -> unit) -> ?after: ('a -> 'b -> 'c -> 'd -> ('e * string * string) -> ('e * string * string) -> Learnocaml_report.t) -> ('a -> 'b -> 'c -> 'd -> 'e) Ty.ty -> string -> ('a * 'b * 'c * 'd * 'e * string * string) list -> Learnocaml_report.t
val test_function_4_against : ?gen:int -> ?test:'e tester -> ?test_stdout:io_tester -> ?test_stderr:io_tester -> ?before_reference:('a -> 'b -> 'c -> 'd -> unit) -> ?before_user:('a -> 'b -> 'c -> 'd -> unit) -> ?after: ('a -> 'b -> 'c -> 'd -> ('e * string * string) -> ('e * string * string) -> Learnocaml_report.t) -> ?sampler:(unit -> 'a * 'b * 'c * 'd) -> ('a -> 'b -> 'c -> 'd -> 'e) Ty.ty -> string -> ('a -> 'b -> 'c -> 'd -> 'e) -> ('a * 'b * 'c * 'd) list -> Learnocaml_report.t
val test_function_4_against_solution : ?gen:int -> ?test:'e tester -> ?test_stdout:io_tester -> ?test_stderr:io_tester -> ?before_reference:('a -> 'b -> 'c -> 'd -> unit) -> ?before_user:('a -> 'b -> 'c -> 'd -> unit) -> ?after: ('a -> 'b -> 'c -> 'd -> ('e * string * string) -> ('e * string * string) -> Learnocaml_report.t) -> ?sampler:(unit -> 'a * 'b * 'c * 'd) -> ('a -> 'b -> 'c -> 'd -> 'e) Ty.ty -> string -> ('a * 'b * 'c * 'd) list -> Learnocaml_report.t
val test_function_4_against_postcond : ?gen:int -> ?test_stdout:io_postcond -> ?test_stderr:io_postcond -> ?before_reference:('a -> 'b -> 'c -> 'd -> unit) -> ?before_user:('a -> 'b -> 'c -> 'd -> unit) -> ?after: ('a -> 'b -> 'c -> 'd -> ('e * string * string) -> Learnocaml_report.t) -> ?sampler:(unit -> 'a * 'b * 'c * 'd) -> ('a -> 'b -> 'c -> 'd -> 'e Ty.ty -> 'e result -> Learnocaml_report.t) -> ('a -> 'b -> 'c -> 'd -> 'e) Ty.ty -> string -> ('a * 'b * 'c * 'd) list -> Learnocaml_report.t
val run_timeout : ?time:int -> (unit -> 'a) -> 'a
val exec : (unit -> 'a) -> ('a * string * string) result
val result : (unit -> 'a) -> 'a result
type ('a, 'b, 'c) args = ('a, 'b, 'c) Fun_ty.args
val last : 'a -> ('a -> 'ret, 'a -> unit, 'ret) args
val arg : 'a -> ('ar -> 'row, 'ar -> 'urow, 'ret) args -> ('a -> 'ar -> 'row, 'a -> 'ar -> 'urow, 'ret) args
val (!!) : 'a -> ('a -> 'ret, 'a -> unit, 'ret) args
val (@:) : 'a -> ('ar -> 'row, 'ar -> 'urow, 'ret) args -> ('a -> 'ar -> 'row, 'a -> 'ar -> 'urow, 'ret) args
val (@:!!) : 'a -> 'b -> ('a -> 'b -> 'ret, 'a -> 'b -> unit, 'ret) args
val apply : ('ar -> 'row) -> ('ar -> 'row, 'ar -> 'urow, 'ret) args -> 'ret
type ('a, 'b, 'c) fun_ty = ('a, 'b, 'c) Fun_ty.fun_ty
val last_ty : 'a Ty.ty -> 'ret Ty.ty -> (('a -> 'ret) Ty.ty, 'a -> unit, 'ret) fun_ty
val arg_ty : 'a Ty.ty -> (('ar -> 'row) Ty.ty, 'ar -> 'urow, 'ret) fun_ty -> (('a -> 'ar -> 'row) Ty.ty, 'a -> 'ar -> 'urow, 'ret) fun_ty
val ty_of_fun_ty : (('ar -> 'row) Ty.ty, 'ar -> 'urow, 'ret) fun_ty -> ('ar -> 'row) Ty.ty
val get_ret_ty : ('ar -> 'row) Ty.ty -> ('ar -> 'row, 'ar -> 'urow, 'ret) args -> 'ret Ty.ty
module type S = sig ... end
module Make (_ : S) : sig ... end
val apply_args_1 : ('a -> 'b) -> ('a -> 'c, 'a -> unit, 'c) args -> 'b
val apply_args_2 : ('a -> 'b -> 'c) -> ('a -> 'b -> 'd, 'a -> 'b -> unit, 'd) args -> 'c
val apply_args_3 : ('a -> 'b -> 'c -> 'd) -> ('a -> 'b -> 'c -> 'e, 'a -> 'b -> 'c -> unit, 'e) args -> 'd
val apply_args_4 : ('a -> 'b -> 'c -> 'd -> 'e) -> ('a -> 'b -> 'c -> 'd -> 'f, 'a -> 'b -> 'c -> 'd -> unit, 'f) args -> 'e
val ty_of_prot : (('ar -> 'row) Ty.ty, 'ar -> 'urow, 'ret) fun_ty -> ('ar -> 'row) Ty.ty
  • deprecated Use ty_of_fun_ty instead.
type !'a lookup = unit -> [ `Found of string * Learnocaml_report.t * 'a | `Unbound of string * Learnocaml_report.t ]
val lookup : 'a Ty.ty -> ?display_name:string -> string -> 'a lookup
val lookup_student : 'a Ty.ty -> string -> 'a lookup
val lookup_solution : 'a Ty.ty -> string -> 'a lookup
val found : string -> 'a -> 'a lookup
val name : 'a lookup -> string
val test_value : 'a lookup -> ('a -> Learnocaml_report.t) -> Learnocaml_report.t
val test_function : ?test:'ret tester -> ?test_stdout:io_tester -> ?test_stderr:io_tester -> ?before:(('ar -> 'row, 'ar -> 'urow, 'ret) args -> unit) -> ?after: (('ar -> 'row, 'ar -> 'urow, 'ret) args -> ('ret * string * string) -> ('ret * string * string) -> Learnocaml_report.t) -> (('ar -> 'row) Ty.ty, 'ar -> 'urow, 'ret) fun_ty -> ('ar -> 'row) lookup -> (('ar -> 'row, 'ar -> 'urow, 'ret) args * (unit -> 'ret)) list -> Learnocaml_report.t
val test_function_against : ?gen:int -> ?test:'ret tester -> ?test_stdout:io_tester -> ?test_stderr:io_tester -> ?before_reference:(('ar -> 'row, 'ar -> 'urow, 'ret) args -> unit) -> ?before_user:(('ar -> 'row, 'ar -> 'urow, 'ret) args -> unit) -> ?after: (('ar -> 'row, 'ar -> 'urow, 'ret) args -> ('ret * string * string) -> ('ret * string * string) -> Learnocaml_report.t) -> ?sampler:(unit -> ('ar -> 'row, 'ar -> 'urow, 'ret) args) -> (('ar -> 'row) Ty.ty, 'ar -> 'urow, 'ret) fun_ty -> ('ar -> 'row) lookup -> ('ar -> 'row) lookup -> ('ar -> 'row, 'ar -> 'urow, 'ret) args list -> Learnocaml_report.t
val test_function_against_solution : ?gen:int -> ?test:'ret tester -> ?test_stdout:io_tester -> ?test_stderr:io_tester -> ?before_reference:(('ar -> 'row, 'ar -> 'urow, 'ret) args -> unit) -> ?before_user:(('ar -> 'row, 'ar -> 'urow, 'ret) args -> unit) -> ?after: (('ar -> 'row, 'ar -> 'urow, 'ret) args -> ('ret * string * string) -> ('ret * string * string) -> Learnocaml_report.item list) -> ?sampler:(unit -> ('ar -> 'row, 'ar -> 'urow, 'ret) args) -> (('ar -> 'row) Ty.ty, 'ar -> 'urow, 'ret) fun_ty -> string -> ('ar -> 'row, 'ar -> 'urow, 'ret) args list -> Learnocaml_report.item list
val (==>) : 'params -> 'ret -> 'params * (unit -> 'ret)
module Open_me : sig ... end
OCaml

Innovation. Community. Security.