Print foldrA result
- carleslabonOP 3
Mod note: As of SDK 1.5.0 Scenarios have been superseded by the more powerful Daml Script. We now recommend using that for all purposes. For more information, and to learn how to use Script please check out @Andreas’ post on our blog.
Hello good evening. I was just wondering if we could print the value for “foldrA” for assertion purposes, since it doesn’t work within let & ← variable. Here is the code below, thanks!
import DA.NonEmpty import DA.Action (when) foldrA_test = scenario do let a = NonEmpty with hd = 2 tl = [2, 4, 6] foldrA (\x y -> do when (x == y) (debug x) return (y)) 6 a - cocreature 3
You can definitely do that! You already found the
debugstatement which is printed to the transaction view in DAML Studio. To print the result of thefoldrAuse something like this:foldrA_test = scenario do let a = NonEmpty with hd = 2 tl = [2, 4, 6] result <- foldrA (\x y -> do when (x == y) (debug x) return (y)) 6 a debug result - carleslabon 4
Oh I see, it worked on my end haha. Thanks! @cocreature.