Stream: roctoberfest

Topic: Random


view this post on Zulip jan kili (Oct 01 2022 at 14:19):

Whoa! Either I don't understand how Zulip works or Roctoberfest is a smash hit!
Screen-Shot-2022-10-01-at-8.17.59-AM.png

view this post on Zulip jan kili (Oct 01 2022 at 14:19):

Either way, it beginssssssssssss :nerd:

view this post on Zulip Anton (Oct 01 2022 at 14:20):

I invited everyone to the stream because it is easy to miss a new stream otherwise.

view this post on Zulip Gabriel Pickl (Oct 02 2022 at 22:05):

Uuuh?

This True tag has the type:

    [True]a

But count needs its 2nd argument to be:

    Bool

for reference, the signature is count : List a, a -> Nat, which I'm using to count the number of depth increases in example one.
The error message makes me assume that True is interpreted as a closed single tag? Do I need to manually import True?

view this post on Zulip Zeljko Nesic (Oct 02 2022 at 22:06):

I think that you need to say explicitly Bool.True

view this post on Zulip Gabriel Pickl (Oct 02 2022 at 22:07):

I am trying to parse a qualified name here:

27│      |> count Bool.True
                           ^

This looks like a qualified tag name to me, but tags cannot be
qualified! Maybe you wanted a qualified name, something like
Json.Decode.string?

view this post on Zulip Brendan Hansknecht (Oct 02 2022 at 22:08):

So this was a recent change where they made bools into opaque types. Should be True to Bool.true

view this post on Zulip Brendan Hansknecht (Oct 02 2022 at 22:08):

Lowercase T in the second example

view this post on Zulip Gabriel Pickl (Oct 02 2022 at 22:11):

that works. I remember seeing somewhere that true was lowercase, but using it without prefix didn't work so I defaulted to the syntax mentioned in the current docs
It also feels a bit strange to have user-defined tags be upper camelcase, but not Bool values. although I gotta say that roc is not the only language that does that, so :shrug:

view this post on Zulip Brendan Hansknecht (Oct 02 2022 at 22:13):

So internally, there is a statement in the Bool module that is essentially:

Export true

true = True

Once save as a variable, it is no longer capatilized because variable must start with a lowercase letter.

view this post on Zulip Brendan Hansknecht (Oct 02 2022 at 22:14):

But yeah, i get the confusion

view this post on Zulip Gabriel Pickl (Oct 02 2022 at 22:22):

fair, that's consistent, just a bit confusing coming from Elm

view this post on Zulip Gabriel Pickl (Oct 02 2022 at 22:22):

might be something the compiler could drop a hint about to prevent some headscratching

view this post on Zulip Richard Feldman (Oct 02 2022 at 22:25):

oops, yeah I need to update the tutorial to explain this :sweat_smile:

view this post on Zulip Richard Feldman (Oct 02 2022 at 22:26):

tl;dr use Bool.true and Bool.false instead of True and False and everything should work out!

view this post on Zulip Shritesh Bhattarai (Oct 03 2022 at 18:25):

Unlike what the doc says, Str.graphemes does not exist :sweat_smile:

view this post on Zulip Mike Kalvas (Oct 03 2022 at 23:06):

Ran into this too. Can workaround it using toUtf8 for simple stuff but it would be great to have that function.

view this post on Zulip Anton (Oct 04 2022 at 10:50):

@Shritesh Bhattarai where is Str.graphemes mentioned?

view this post on Zulip Ghislain (Oct 04 2022 at 10:58):

https://github.com/roc-lang/roc/blob/f6c981294a8389b0583d9b81813fbb44b581f782/crates/compiler/builtins/roc/Str.roc#L157

view this post on Zulip Kilian Vounckx (Oct 05 2022 at 07:01):

Mike Kalvas said:

Ran into this too. Can workaround it using toUtf8 for simple stuff but it would be great to have that function.

You could use toScalars as well. It returns a List U32 where each element represents the unicode code point of a character

view this post on Zulip jan kili (Oct 07 2022 at 06:16):

FYI, @Ayaz Hafiz just added positional arguments to examples/interactive/cli-platform! Passing primary+required information (like the path to your input data file?) should be much simpler now - let us know if it's broken or awesome!

view this post on Zulip jan kili (Oct 07 2022 at 19:40):

The CLI platform directory in the Roc repo will be moving today! (We're simplifying the organization of examples :smile:) If you update your clone of the Roc repo, then you'll need to update your apps' platform path, too.


Last updated: Jul 06 2025 at 12:14 UTC