1
1
mirror of https://github.com/anoma/juvix.git synced 2024-12-27 17:43:55 +03:00
juvix/test/Tree/Transformation.hs
Paul Cadman 2e006421a5
Support nockma scry (#2678)
This PR adds support for Anoma/Nockma scry OP. It is used for obtaining
values from the Anoma storage (key value store). See the [linked
issue](https://github.com/anoma/juvix/issues/2672) for details on scry.

This PR adds support for scry to the Nockma language and compilation
from the frontend via a builtin: `anoma-get`:

```
builtin anoma-get
axiom anomaGet : {Value Key : Type} -> Key -> Value
```

In the backend, the `Value` and `Key` types could be anything, they will
depend on choices of Anoma applications. The type of the returned
`Value` is unchecked. It's currently the responsibility of the user to
match the annotated type with the type of data in storage.

We will not put this builtin in the standard library. It will be exposed
in the anoma-juvix library. It's likely that the frontend `anomaGet`
function will evolve as we use it to write Anoma applications and learn
how they work.

* Closes https://github.com/anoma/juvix/issues/2672

---------

Co-authored-by: Jan Mas Rovira <janmasrovira@gmail.com>
2024-03-21 16:44:14 +01:00

18 lines
475 B
Haskell

module Tree.Transformation where
import Base
import Tree.Transformation.Apply qualified as Apply
import Tree.Transformation.CheckNoAnoma qualified as CheckNoAnoma
import Tree.Transformation.Identity qualified as Identity
import Tree.Transformation.Reachability qualified as Reachability
allTests :: TestTree
allTests =
testGroup
"JuvixTree transformations"
[ Identity.allTests,
Apply.allTests,
Reachability.allTests,
CheckNoAnoma.allTests
]