You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
letchosenFruit="If you had to pick one, which would it be?"|>chooseFrom fruits
21
-
letchosenFruits="Which all do you actually like?"|>chooseMultipleFrom fruits
16
+
letchosenFruit="If you had to pick one, which would it be?"|>choose fruits
17
+
letchosenFruits="Which all do you actually like?"|>chooseMultiple fruits
22
18
23
19
match chosenFruits.Count with
24
20
|0->"You don't like any fruit??"
@@ -49,16 +45,13 @@ type PromptExample() =
49
45
|> toConsole
50
46
51
47
// example for chooseFromValues
52
-
letgetDescription(value:Value)=
53
-
value.description
54
-
55
-
letvalues=[
56
-
{ num =42; description ="the answer"}
57
-
{ num =13; description ="some say it's unlucky"}
48
+
letchoices=[
49
+
{ Value =42; Label ="the answer"}
50
+
{ Value =13; Label ="some say it's unlucky"}
58
51
]
59
52
60
-
letchosenValue=chooseFromValues getDescription values"Which number do you like best from its description?"
61
-
$"I like {chosenValue.num}, too"
53
+
letchosenValue=chooseWithLabel choices"Which number do you like best from its description?"
54
+
$"I like {chosenValue}, too"
62
55
|> printMarkedUp
63
56
0
64
57
@@ -99,10 +92,10 @@ type PromptDocumentation() =
99
92
emptyRule
100
93
C "If the set of choices is finite, one of the following can be used:"
101
94
BI [
102
-
Many [P "chooseFrom = (choices: string list) (question: string) -> string"; C "a simple single selection prompt"]
103
-
Many [P "chooseFromValues<'T> (converter : 'T -> string) (values: 'T list) (question: string) -> string"; C "a single selection prompt that gives a typed response and needs a converter to get a displayable string from each value"]
104
-
Many [P "chooseMultipleFrom = (choices: string list) (question: string) -> string list"; C "select multiple values from a list of choices"]
105
-
Many [P "chooseMultipleFromWith = (options: MultiSelectionPromptOptions) (choices: string list) (question: string) -> string list"; C " selecting multiple entries with configuration of the number of visible entries per page (default: 10)"]
95
+
Many [P "choose = (choices: string list) (question: string) -> string"; C "a simple single selection prompt"]
96
+
Many [P "chooseWithLabel<'T> (choices: ChoiceWithLabel<'T> list) (question: string) -> string"; C "a single selection prompt that gives a typed response"]
97
+
Many [P "chooseMultiple = (choices: string list) (question: string) -> string list"; C "select multiple values from a list of choices"]
98
+
Many [P "chooseMultipleWith = (options: MultiSelectionPromptOptions) (choices: string list) (question: string) -> string list"; C " selecting multiple entries with configuration of the number of visible entries per page (default: 10)"]
0 commit comments