aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlban Gruin2022-02-05 14:51:58 +0100
committerAlban Gruin2022-02-05 15:17:16 +0100
commitb8b1b6704069497d9ccbbe35db3c5a17b2f9bc4c (patch)
tree897d92d0da89d4dcc5a809e4800de5ddcaacaf08
parent0710bab08caffa9736bf7442d483ca9a6fd04708 (diff)
ics: make Ics.t public
To simplify code down the line, this makes Ics.t public so everyone can apply standard list processing functions onto it. Signed-off-by: Alban Gruin <alban at pa1ch dot fr>
-rw-r--r--src/course.ml3
-rw-r--r--src/ics.ml3
-rw-r--r--src/ics.mli5
3 files changed, 4 insertions, 7 deletions
diff --git a/src/course.ml b/src/course.ml
index 566ee0d..a621a8d 100644
--- a/src/course.ml
+++ b/src/course.ml
@@ -1,5 +1,5 @@
(*
- * Copyright (C) 2020, 2021 Alban Gruin
+ * Copyright (C) 2020 -- 2022 Alban Gruin
*
* ucs is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published
@@ -124,4 +124,3 @@ let decode s =
| s -> Ezjsonm.from_string s in
J.(destruct (list encoding) toks)
|> List.filter_map (fun event -> event)
- |> Ics.make
diff --git a/src/ics.ml b/src/ics.ml
index 0f8c7d6..5afff39 100644
--- a/src/ics.ml
+++ b/src/ics.ml
@@ -1,5 +1,5 @@
(*
- * Copyright (C) 2020, 2021 Alban Gruin
+ * Copyright (C) 2020 -- 2022 Alban Gruin
*
* ucs is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published
@@ -77,7 +77,6 @@ end
type t = Event.t list
-let make events = events
let filter_groups groups =
List.filter (Event.has_groups groups)
diff --git a/src/ics.mli b/src/ics.mli
index c2db3a2..575e88e 100644
--- a/src/ics.mli
+++ b/src/ics.mli
@@ -1,5 +1,5 @@
(*
- * Copyright (C) 2020, 2021 Alban Gruin
+ * Copyright (C) 2020 -- 2022 Alban Gruin
*
* ucs is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published
@@ -24,9 +24,8 @@ module Event : sig
val to_string : string -> t -> int -> string
end
-type t
+type t = Event.t list
-val make : Event.t list -> t
val filter_groups : string list -> t -> t
val get_all_groups : t -> string Seq.t
val to_string : string -> t -> string