I've dug bath through zulip and put together the following examples which show the usage of where
clause.
https://gist.github.com/lukewilliamboswell/8aab3d62da2859b7dedbbe69fe0a895f
@Richard Feldman can you confirm this is the inteded syntax and I haven't missed anything.
I'll add snapshots for these to help us implement it later.
i've implemented the parsing of these
I wasn't sure if we wanted module(a)
every time, or only in the special case where you are referring to a return type.
do you mean for can?
Anthony Bullard said:
i've implemented the parsing of these
Oh cool!
you should find at least one snapshot that contains them
I was thinking more about the semantics than just parsing the syntax tbh
Looks like I missed the where a.Decode
use case -- where you can just point to a type declared in that module. We support an Alias with where clauses to make something like Eq
etc.
Hash(a) : a
where
a.hash(hasher) -> hasher,
hasher.Hasher,
I've got enough here then already to build out some more snapshots then. And possibly start implementing in Can also.
Last updated: Jul 06 2025 at 12:14 UTC