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
Either way, it beginssssssssssss :nerd:
I invited everyone to the stream because it is easy to miss a new stream otherwise.
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
?
I think that you need to say explicitly Bool.True
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?
So this was a recent change where they made bools into opaque types. Should be True
to Bool.true
Lowercase T in the second example
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:
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.
But yeah, i get the confusion
fair, that's consistent, just a bit confusing coming from Elm
might be something the compiler could drop a hint about to prevent some headscratching
oops, yeah I need to update the tutorial to explain this :sweat_smile:
tl;dr use Bool.true
and Bool.false
instead of True
and False
and everything should work out!
Unlike what the doc says, Str.graphemes
does not exist :sweat_smile:
Ran into this too. Can workaround it using toUtf8
for simple stuff but it would be great to have that function.
@Shritesh Bhattarai where is Str.graphemes
mentioned?
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
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!
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