Commit 3843b605 authored by Julien Lopez's avatar Julien Lopez
Browse files

Add missing files

parent b1e7cb6f
let clength (l : ['a*]) : Int =
let aux (l : ['a*])(res : Int) : Int = match l with
| [] -> res
| [_; rest] -> aux rest (res + 1) in
aux l 0
let olength = List.length with {'a}
let chd (['a*] -> 'a)
| [] -> raise "Invalid_argument \"Clist.hd\""
| [el _*] -> el
let ohd = List.hd with {'a}
let ctl (['a*] -> ['a*])
| [] -> raise "Invalid_argument \"Clist.hd\""
| [_; rest] -> rest
let otl = List.tl with {'a}
let cnth (l : ['a*])(n : Int) : 'a =
let aux (l : ['a*])(n : Int) : 'a = match l with
| [] -> raise "Failure \"Clist.nth\""
| [el; rest] -> if n >> 0 then aux rest (n - 1) else el in
if n << 0 then raise "Invalid_argument \"Clist.nth\"" else aux l n
let onth = List.nth with {'a}
let crev (l : ['a*]) : ['a*] =
let aux (l : ['a*])(res : ['a*]) : ['a*] = match l with
| [] -> res
| [el; rest] -> aux rest ([el] @ res) in
aux l []
let orev = List.rev with {'a}
val clength : 'a list -> Big_int.big_int
val olength : 'a list -> int
val chd : 'a list -> 'a
val ohd : 'a list -> 'a
val ctl : 'a list -> 'a list
val otl : 'a list -> 'a list
val cnth : 'a list -> Big_int.big_int -> 'a
val onth : 'a list -> int -> 'a
val crev : 'a list -> 'a list
val orev : 'a list -> 'a list
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment