Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitdf93686

Browse files
dsymeKevinRansom
authored andcommitted
Add tests for C# use of FuncConvert.ToFSharpFuncfsharp#11 (#4082)
* Add tests for C# use of FuncConvert.ToFSharpFunc* Update test.cs
1 parentaac14d3 commitdf93686

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

‎tests/fsharp/core/fsfromcs/test.cs‎

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,17 @@ static int Main()
8181
{Console.WriteLine("i after duplication (2nd technique) = {0}",s);}),
8282
myList2);
8383

84+
// No Func overloads are available for FuncConvert.ToFSharpFunc
85+
// myList2 =
86+
// ListModule.Map<int,string>
87+
// (FuncConvert.ToFSharpFunc((Func<int,string>) delegate(int i) { return i.ToString() + i.ToString(); }),
88+
// myList);
89+
90+
ListModule.Iterate<string>(FuncConvert.ToFSharpFunc<string>(s=>{Console.WriteLine("s = {0}",s);}),myList2);
91+
92+
//Note: This call becomes ambiguous if Func overloads of FuncConvert.ToFSharpFunc are added
93+
myList2=ListModule.Map<string,string>(FuncConvert.ToFSharpFunc<string,string>(i=>i.ToString()+i.ToString()),myList2);
94+
8495
}
8596

8697
// Construct a value of each type from the library

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp