Better styling for utility
This commit is contained in:
@ -48,8 +48,8 @@ let int_not a =
|
|||||||
(* else if x < base then *)
|
(* else if x < base then *)
|
||||||
(* String.get alphabet x |> String.make 1 *)
|
(* String.get alphabet x |> String.make 1 *)
|
||||||
(* else *)
|
(* else *)
|
||||||
(* (fromIntToString (alphabet) (x/base - 1)) ^ (String.get alphabet (x mod base) *)
|
(* (fromIntToString (alphabet) (x/base - 1)) ^ *)
|
||||||
(* |> String.make 1) *)
|
(* (String.get alphabet (x mod base) |> String.make 1) *)
|
||||||
|
|
||||||
|
|
||||||
(* true if every element of la is in lb *)
|
(* true if every element of la is in lb *)
|
||||||
@ -58,9 +58,7 @@ let inclusion la lb =
|
|||||||
function
|
function
|
||||||
[] -> true
|
[] -> true
|
||||||
| b::lb ->
|
| b::lb ->
|
||||||
if List.mem b la
|
List.mem b la && aux la lb
|
||||||
then aux la lb
|
|
||||||
else false
|
|
||||||
in
|
in
|
||||||
aux lb la
|
aux lb la
|
||||||
|
|
||||||
@ -127,9 +125,9 @@ let unique_union_assoc f l1 l2 =
|
|||||||
|
|
||||||
(* returns a list with at most n items and the rest in the second *)
|
(* returns a list with at most n items and the rest in the second *)
|
||||||
let rec take (n: int) (l: 'a list) : ('a list * 'a list) =
|
let rec take (n: int) (l: 'a list) : ('a list * 'a list) =
|
||||||
match n with
|
if n = 0
|
||||||
| 0 -> ([], l)
|
then ([], l)
|
||||||
| n ->
|
else
|
||||||
match l with
|
match l with
|
||||||
| [] -> ([], [])
|
| [] -> ([], [])
|
||||||
| i::ls ->
|
| i::ls ->
|
||||||
|
|||||||
Reference in New Issue
Block a user