anoma / juvix

A language for intent-centric and declarative decentralised applications
https://docs.juvix.org
GNU General Public License v3.0
442 stars 54 forks source link

Use Anoma representation of Maybe in nockma backend #2854

Closed paulcadman closed 4 days ago

paulcadman commented 6 days ago

Anoma has chosen to represent the Maybe type in Nockma in the following way:

See https://github.com/anoma/anoma/issues/569

We should use this representation in the nockma backend for the Juvix Maybe type. We need this to support the changes to the Anoma stdlib cryptographic API, see: https://github.com/anoma/juvix/issues/2850

We could handle this in the same way that we handle lists:

https://github.com/anoma/juvix/blob/7bb663c308c2f89c2f4c0f1811a31d3a28d4c243/src/Juvix/Compiler/Nockma/Translation/FromTree.hs#L227

i.e we use this representation for all inductive types that look 'Maybe-like'.