Sha256: c53c7c3248e8e2e5467c73f81833129405d1f676d08ec6d97938cb58f3f4b345
Contents?: true
Size: 821 Bytes
Versions: 159
Compression:
Stored size: 821 Bytes
Contents
open Core open Model open Yojson.Basic let map_elements (to_str: json -> string) (parameters: (string * json) list): (string * string) list = List.map parameters ~f:(fun (k,j) -> (k,to_str j)) let optional_int ~(none: int) = function | `Int n when n = none -> "Nothing" | `Int n -> "(Just " ^ Int.to_string n ^ ")" | x -> json_to_string x let rec edit_expected ~(f: json -> string) (parameters: (string * json) list) = match parameters with | [] -> [] | ("expected", v) :: rest -> ("expected", f v) :: edit_expected f rest | (k, v) :: rest -> (k, json_to_string v) :: edit_expected f rest let purescript_edit_parameters ~(slug: string) (parameters: (string * json) list) = match (slug, parameters) with | ("hamming", ps) -> edit_expected ~f:(optional_int ~none:(-1)) ps | (_, ps) -> map_elements json_to_string ps
Version data entries
159 entries across 159 versions & 1 rubygems