open Base type t = int let of_int = Fn.id let to_int = Fn.id let of_string = Int.of_string let to_string = Int.to_string let render t = let value = to_int t in let scaled = Int.min 5 (Int.max 0 value) in let yellow = "\027[33m" in let reset = "\027[0m" in let block = match scaled with | 0 -> " " | 1 -> "░" | 2 -> "▒" | 3 -> "▓" | 4 -> "█" | 5 -> "█" | _ -> assert false in yellow ^ block ^ reset