Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add FromNatural trait in Juvix.Builtin.V1
The FromNatural trait will be used for the Bytes type. We want the following properties for Byte: 1. Values of the Bytes type to be assignable from a non-negative numeric literal. 2. We don't want to implement + and * for it. Currently, in order for a type to have property 1. it must have an instance of `Natural` so property 2. can't be satisfied. To solve this we split the `from-nat` builtin from the `Natural` trait into a new trait `FromNatural`. A coercion instance is defined between Natural and FromNatural so you don't need to write instances for both traits. For this PR the new `FromNatural` trait is unused. I will make the changes to juvix-stdlib to use the new V2 modules when I incorporate compiler changes for the Bytes type. This change is backwards compatible for existing Juvix code so we don't need to make a new Juvix.Builtin.V2 path in package-base.
- Loading branch information