Sha256: c500681612d788604cf1d6d04ebf788b122fd9379079373ccd66dd7aa8f435ea

Contents?: true

Size: 318 Bytes

Versions: 42

Compression:

Stored size: 318 Bytes

Contents

open Base

module Int_map = Map.M(Int)
type school = string list Int_map.t

let empty_school = Map.empty (module Int)

let add s g school = Map.add_multi ~key:g ~data:s school

let grade g school = Map.find school g |> Option.value ~default:[]

let sorted school = Map.map ~f:(List.sort ~compare:String.compare) school

Version data entries

42 entries across 42 versions & 1 rubygems

Version Path
trackler-2.2.1.139 tracks/ocaml/exercises/grade-school/example.ml
trackler-2.2.1.138 tracks/ocaml/exercises/grade-school/example.ml