Skip to content

Commit fb0272e

Browse files
committed
filestring and docstring
1 parent e3f0acb commit fb0272e

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

src/Lean/Elab/ErrorUtils.lean

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
/-
2+
Copyright (c) 2025 Microsoft Corporation. All rights reserved.
3+
Released under Apache 2.0 license as described in the file LICENSE.
4+
Authors: Rob Simmons
5+
-/
16
module
27

38
prelude
@@ -33,7 +38,16 @@ private def _root_.List.toOxford : List String -> String
3338
| [a, b, c] => a ++ ", " ++ b ++ ", and " ++ c
3439
| a :: as => a ++ ", " ++ toOxford as
3540

36-
/- Give alternative forms of a string if the `count` is 1 or not. -/
41+
/--
42+
Give alternative forms of a string if the `count` is 1 or not.
43+
44+
- `(1).plural == ""`
45+
- `(2).plural == "s"`
46+
- `(1).plural "wug" == "wug"`
47+
- `(2).plural "wug" == "wugs"`
48+
- `(1).plural "it" "they" == "it"`
49+
- `(2).plural "it" "they" == "they"`
50+
-/
3751
private def _root_.Nat.plural (count : Nat) (singular : String := "") (plural : String := singular ++ "s") :=
3852
if count = 1 then
3953
singular

0 commit comments

Comments
 (0)