TypeCheck - Fast and flexible runtime type-checking for your Elixir projects

Essentially the problem is that dialyzer doesn’t support subtractive types (or even certain literal types). I’d love to have a type that is like:

special_json :: %{
  required("foo") => integer,
  optional("bar") => number,
  optional(String.t / ("foo" | "bar")) => json
}