Open TanklesXL opened 4 months ago
Could you share a bit of the motivation here? I would have though pattern matching would be sufficient here
in this case i'm trying to assert that a function has 1 parameter that is a String
, i'd rather not have to dig into the implementation details to make my own version of the builtin-types every time i need to compare something with them.
the issue for me as a user of the package is that I have no way of knowing the expected shape of the gleam builtin types without already having seen the json and decoded it to know what they should look like
There's no implementation details here, this data structure is a public API, and checking the Hex documentation it does describe the shape of prelude types.
They could still be useful perhaps, though I'm not sure the use cases. Could you share what you code might look like with and without them?
One thing that seems like a limitation for me is that list and result can't be used in guards as they are functions.
When using this package I find myself wanting to check that functions accept/return certain types.
It makes sense to define them myself for custom types, but it would be great to have gleams primitive types represented as constants in this lib!