Project

General

Profile

Statistics
| Branch: | Revision:

cool / src / lib / CoolUtils.mli @ 7c4d2eb4

History | View | Annotate | Download (907 Bytes)

1

    
2
(* Some basic utilities as they are known from haskell prelude and so on... *)
3

    
4
module TArray : sig
5
    val all : ('a -> bool) -> 'a array -> bool
6
    val any : ('a -> bool) -> 'a array -> bool
7
    val elem : 'a -> 'a array -> bool
8
    val included : 'a array -> 'a array -> bool
9
    val to_string : ('a -> string) -> 'a array -> string
10
    val uniq : 'a array -> 'a array (* delete consecutive duplicates *)
11
end
12

    
13
module TList : sig
14
    val zip : ('a list) -> ('b list) -> ('a * 'b) list
15
    val powerset : ('a list) -> ('a list list)
16
    val prod : ('a list) -> ('b list) -> (('a * 'b) list)
17
    val empty : ('a list) -> bool
18
end
19

    
20
val cl_get_agents : unit -> int array
21
val cl_set_agents : int array -> unit
22

    
23
val intlist_of_string : string -> int list
24

    
25
val compose : ('b -> 'c) -> ('a -> 'b) -> ('a -> 'c)
26
val flip : ('a -> 'b -> 'c) -> ('b -> 'a -> 'c)
27
val eval : 'a -> ('a -> 'b) -> 'b
28
val id : 'a -> 'a