Closed yongrenjie closed 1 year ago
(started on fc-export
branch)
whatwhat export [START] [END] -o [FILE]
-> print to given filewhatwhat export [START] [END] -o
-> print to default file name (in working directory)whatwhat export [START] [END]
-> print to stdoutlib/forecast.ml
which does this. Here's the function to do so:
(** essentially Data.List.groupBy from Haskell *)
let group_by (p : 'a -> 'a -> bool) (xs : 'a list) : 'a list list =
let acc x grps =
match grps with
| [] -> [ [ x ] ]
| grp :: rest ->
if p x (List.hd grp) then (x :: grp) :: rest else [ x ] :: grp :: rest
in
List.fold_right acc xs []
forecastRaw.ml
, which is currently a huge mess
cf. alan-turing-institute/Hut23#1360