lean/rust style if let #34
Owner
> a function that recognizes string elements and extracts their contents can be written:
>
> ```
> def Inline.string? (inline : Inline) : Option String :=
> match inline with
> | Inline.string s => some s
> | _ => none
> ```
>
> An alternative way of writing this function's body uses if together with let:
>
> ```
> def Inline.string? (inline : Inline) : Option String :=
> if let Inline.string s := inline then
> some s
> else none
> ```
rfc
label
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?