Zulip Chat Archive
Stream: new members
Topic: Haskell when and unless
Steven Shaw (Jul 10 2023 at 05:25):
Is there something like Haskell's when
and unless
in Lean?
Marcus Rossel (Jul 10 2023 at 06:31):
There's an example and explanation of unless
in this section of Functional Programming in Lean.
Steven Shaw (Jul 10 2023 at 09:45):
Thanks! I'm reading that book, but I'm not quite up to that chapter yet :sweat_smile:! For when
, the "single-branched if" is exactly what I needed. :pray:
Kyle Miller (Jul 10 2023 at 09:54):
(@Steven Shaw Just so you know a little about what these are: in Lean there's both syntax for general terms and syntax for statements in do
notation. The unless
and single-branched if
are do
notation statements only.)
Last updated: Dec 20 2023 at 11:08 UTC