# Print foldrA result

**URL:** <https://forum.canton.network/t/print-foldra-result/1255>\
**Category:** App Development\
**Created:** [September 18, 2020, 10:08am UTC](https://forum.canton.network/t/print-foldra-result/1255 "2020-09-18T10:08:05Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![carleslabon](https://yyz2.discourse-cdn.com/flex034/user_avatar/forum.canton.network/carleslabon/32/6481_2.png) [@carleslabon](https://forum.canton.network/u/carleslabon)\
**Post date:** [September 18, 2020, 10:08am UTC](https://forum.canton.network/t/print-foldra-result/1255/1 "2020-09-18T10:08:05Z")

</div>

**Mod note: As of SDK 1.5.0 Scenarios have been superseded by the more powerful [Daml Script](https://docs.daml.com/daml-script/index.html). 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](https://daml.com/blog/engineering/daml-script-scenarios-2-0/).**

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!

```haskell
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

```

---

<div class="post-metadata">

**Author:** ![cocreature](https://yyz2.discourse-cdn.com/flex034/user_avatar/forum.canton.network/cocreature/32/36_2.png) [@cocreature](https://forum.canton.network/u/cocreature)\
**Post date:** [September 18, 2020, 10:12am UTC](https://forum.canton.network/t/print-foldra-result/1255/2 "2020-09-18T10:12:52Z")

</div>

You can definitely do that! You already found the `debug` statement which is printed to the transaction view in DAML Studio. To print the result of the `foldrA` use something like this:

```haskell
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

```

---

<div class="post-metadata">

**Author:** ![carleslabon](https://yyz2.discourse-cdn.com/flex034/user_avatar/forum.canton.network/carleslabon/32/6481_2.png) [@carleslabon](https://forum.canton.network/u/carleslabon)\
**Post date:** [September 18, 2020, 10:14am UTC](https://forum.canton.network/t/print-foldra-result/1255/3 "2020-09-18T10:14:59Z")

</div>

Oh I see, it worked on my end haha. Thanks! @cocreature.
