lean-ja / lean-ja/lean-by-example

try catch 構文の使用例

Open
#1,042 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

コード例
Dominant language
Lean
Stars
188
Forks
15
Avg merge
9h 8m
Merged PRs (30d)
6

Description

/- # try catch 使用例 -/

def main : IO Unit := do
  try
    throw <| IO.userError "error"
  catch e =>
    IO.println s!"catch error: {e}"

  IO.println "続き"

#eval main

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Use the try/catch example in the issue body as the entry point, and locate the appropriate Lean example page in the repository. Add the example where related language examples are documented, then verify that the rendered documentation includes the code and its expected output.

Written by the indexing model from the issue text.

Assessment

Domain
documentation
Issue type
Documentation
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.