Stream: beginners

Topic: dbg Nested Lists


view this post on Zulip Jason Hobbs (Dec 01 2023 at 16:35):

I'm able to dbg sumNums where sumNums is a List (Int Unsigned32).
I get an exit code of 11 when it's a List (List (Int Unsigned32)).

How should I debug nested lists?

Also, it'd be really great to be able to just |> dbg.

view this post on Zulip Anton (Dec 01 2023 at 16:38):

|> dbg is in the plans

view this post on Zulip Brendan Hansknecht (Dec 01 2023 at 16:41):

I get an exit code of 11 when it's a List (List (Int Unsigned32)).

Interesting. I guess file and bug and hopefully we can figure out what is going on.

Until then, using List.map and doing it manually may work

List.map \x ->
    dbg x
    x

view this post on Zulip Jason Hobbs (Dec 01 2023 at 16:44):

Anton said:

|> dbg is in the plans

Fwiw, my expectation for the output from |> dbg was to print the value that was being piped into that line.

view this post on Zulip Oskar Hahn (Dec 01 2023 at 16:51):

To use |> dgb, I used a small helper:

debug : a -> a
debug = \v ->
  dbg v
  v

This works perfectly fine since the last nightly build.

view this post on Zulip Anton (Dec 01 2023 at 16:56):

Cool, I had not thought of that, thanks for sharing @Oskar Hahn :)


Last updated: Jul 05 2025 at 12:14 UTC