-
Notifications
You must be signed in to change notification settings - Fork 274
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #5586 from sellout/clarify-transcript
Modify the fix-2805 transcript to use return type
- Loading branch information
Showing
2 changed files
with
11 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,23 @@ | ||
When running a main function in `ucm` a numeric argument is replaced by the potential last result of a find command: | ||
|
||
``` unison | ||
main : '{IO, Exception} () | ||
main _ = | ||
printLine ("Hello " ++ Optional.getOrBug "definitely passed an arg" (List.head !getArgs) ++ "!") | ||
main : '{IO, Exception} Text | ||
main _ = "Hello " ++ Optional.getOrBug "definitely passed an arg" (List.head !getArgs) ++ "!" | ||
``` | ||
|
||
First we run it with no numbered results in the history, so if number expansion is applied, it should end up calling `main` with zero args, whereas without number expansion, we get a single argument, “1”, passed to it. | ||
|
||
``` ucm | ||
scratch/main> run main 1 | ||
"Hello 1!" | ||
``` | ||
|
||
Now we set it up so there _are_ numbered results in the history. If number expansion is applied here, we will get an error “`run` can’t accept a numbered argument […]”, and otherwise our expected "1". | ||
|
||
``` ucm | ||
scratch/main> find.all isLeft | ||
scratch/main> run main 1 | ||
"Hello 1!" | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters