<commit_before>(*
 * Drumaderian
 *
 * Copyright (C) 2016  <NAME> <<EMAIL>>
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 *
*)

(** This module provide the common API of the library *)

(** {2 Usefuls functions} *)

(** Identity function *)
val id : 'a -> 'a

(** Reverted application for two parameters in a function *)
val flip : ('a -> 'b -> 'c) -> 'b -> 'a -> 'c


(** {2 Infix operators} *)

(** Shortcut for Lwt.bind *)
val ( >>=) : 'a Lwt.t -> ('a -> 'b Lwt.t) -> 'b Lwt.t

(** Function composition *)
val ( % ) : ('a -> 'b) -> ('c -> 'a) -> 'c -> 'b

(** Function composition when the second function is executed first*)
val ( %> ) : ('a -> 'b) -> ('b -> 'c) -> 'a -> 'c

(** Application operator. This operator is redundant, since ordinary
    application (f x) means the same as (f $ x). However, $ has low,
    right-associative binding precedence, so it sometimes allows parentheses
*)
val ( $ ) : ('a -> 'b) -> 'a -> 'b 

(** {2 JavaScript objects} *)
val document : Dom_html.document Js.t
val window   : Dom_html.window   Js.t
val console  : Firebug.console   Js.t
  
(** {2 JavaScript useful functions} *)
    
(** Perform a JavaScript alert *)
val alert : string -> unit

(** Write data int the console *)
val log : 'a -> unit

val unopt : 'a Js.Opt.t -> 'a
val try_unopt : 'a Js.Opt.t -> 'a option

(** Check if the application is in debug mode *)
val with_debugger : unit -> bool

(** {2 Internals or extensions modules} *)


(** Extension for String *)
module String :
sig<commit_msg>Document Unopt (and try_unopt) functions<commit_after>(*
 * Drumaderian
 *
 * Copyright (C) 2016  <NAME> <<EMAIL>>
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 *
*)

(** This module provide the common API of the library *)

(** {2 Usefuls functions} *)

(** Identity function *)
val id : 'a -> 'a

(** Reverted application for two parameters in a function *)
val flip : ('a -> 'b -> 'c) -> 'b -> 'a -> 'c


(** {2 Infix operators} *)

(** Shortcut for Lwt.bind *)
val ( >>=) : 'a Lwt.t -> ('a -> 'b Lwt.t) -> 'b Lwt.t

(** Function composition *)
val ( % ) : ('a -> 'b) -> ('c -> 'a) -> 'c -> 'b

(** Function composition when the second function is executed first*)
val ( %> ) : ('a -> 'b) -> ('b -> 'c) -> 'a -> 'c

(** Application operator. This operator is redundant, since ordinary
    application (f x) means the same as (f $ x). However, $ has low,
    right-associative binding precedence, so it sometimes allows parentheses
*)
val ( $ ) : ('a -> 'b) -> 'a -> 'b 

(** {2 JavaScript objects} *)
val document : Dom_html.document Js.t
val window   : Dom_html.window   Js.t
val console  : Firebug.console   Js.t
  
(** {2 JavaScript useful functions} *)
    
(** Perform a JavaScript alert *)
val alert : string -> unit

(** Write data int the console *)
val log : 'a -> unit

(** Try to extract a potential null value, raise Error.Unoptable if the value is null *)
val unopt : 'a Js.Opt.t -> 'a

(** Same as [unopt] but returns an option instead of raising an exception *)
val try_unopt : 'a Js.Opt.t -> 'a option

(** Check if the application is in debug mode *)
val with_debugger : unit -> bool

(** {2 Internals or extensions modules} *)


(** Extension for String *)
module String :
sig
{'fraction_non_alphanumeric': 0.14136837335749886, 'fraction_numerical': 0.004531037607612143, 'mean_word_length': 3.22488038277512, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 71, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7518718', 'n_tokens_mistral': 1380, 'n_tokens_neox': 1311, 'n_words': 593}