查看完整版本 : Practice Functional Programming With C# 3

form5 2017-12-12 11:23 PM

Practice Functional Programming With C# 3

short notes on a simple picture :lol

[[i] 本帖最後由 form5 於 2017-12-12 11:30 PM 編輯 [/i]]

fitcat07 2017-12-13 10:17 AM

:smile_o12:

xianrenb 2017-12-13 07:15 PM

[quote]原帖由 [i]form5[/i] 於 2017-12-12 11:23 PM 發表 [url=http://computer.discuss.com.hk/redirect.php?goto=findpost&pid=472304428&ptid=27118759][img]http://computer.discuss.com.hk/images/common/back.gif[/img][/url]
short notes on a simple picture :lol [/quote]

很好的解釋。

另一方面,剛好 JavaScript 又有相似但不同的東西:
[url=https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/map]https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/map[/url]
[url=https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function/apply]https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function/apply[/url]
[url=https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_objects/Function/bind]https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_objects/Function/bind[/url]

後兩者更是 Function 的 method ,我先前就是搞亂了。

form5 2017-12-13 09:57 PM

[quote]原帖由 [i]xianrenb[/i] 於 2017-12-13 07:15 PM 發表 [url=http://computer.discuss.com.hk/redirect.php?goto=findpost&pid=472341189&ptid=27118759][img]http://computer.discuss.com.hk/images/common/back.gif[/img][/url]
很好的解釋。

另一方面,剛好 JavaScript 又有相似但不同的東西:
[url=https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/map]https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/map[/url]
[url=https://developer.mozilla.org/en-US/do]https://developer.mozilla.org/en-US/do[/url] ... [/quote]// similar but not the same
var ints = F.List(1, 2, 3, 4);
ints.Map(i => i )
    .ForEach(Console.WriteLine); //1, 2, 3, 4

var optInts = F.List(F.Some(1), F.None, F.Some(3), F.Some(4));
optInts.Bind(i => i)      
          .ForEach(Console.WriteLine); // 1, 3, 4

tom.care 2017-12-15 11:35 PM

Some(Plus(None)) 會變乜?
頁: [1]
查看完整版本: Practice Functional Programming With C# 3