FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
functional-csharp-code/Examples/Chapter04/Map.cs at master · Kingpl2016/functional-csharp-code · GitHub
Kingpl2016
/
functional-csharp-code
Public
forked from
la-yumba/functional-csharp-code
Notifications
You must be signed in to change notification settings
Fork
0
Star
0
Code
Pull requests
0
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
functional-csharp-code
/
Examples
/
Chapter04
/
Map.cs
Copy path
More file actions
More file actions
Latest commit
History
History
History
45 lines (36 loc) · 925 Bytes
Breadcrumbs
functional-csharp-code
/
Examples
/
Chapter04
/
Map.cs
Copy path
File metadata and controls
45 lines (36 loc) · 925 Bytes
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
using
System
;
using
LaYumba
.
Functional
;
using
static
System
.
Console
;
using
String
=
LaYumba
.
Functional
.
String
;
namespace
Examples
.
Chapter4
{
using
System
.
Collections
.
Generic
;
using
System
.
Linq
;
using
static
F
;
public
class
Examples
{
public
static
void
List_Map
(
)
{
Func
<
int
,
int
>
plus3
=
x
=>
x
+
3
;
var
a
=
new
[
]
{
2
,
4
,
6
}
;
// => [2, 4, 6]
var
b
=
a
.
Map
(
plus3
)
;
// => [5, 7, 9]
}
public
static
void
List_ForEach
(
)
{
Enumerable
.
Range
(
1
,
5
)
.
ForEach
(
Console
.
Write
)
;
}
internal
static
void
_main
(
)
{
Option
<
string
>
name
=
Some
(
"Enrico"
)
;
name
.
Map
(
String
.
ToUpper
)
.
ForEach
(
WriteLine
)
;
IEnumerable
<
string
>
names
=
new
[
]
{
"Constance"
,
"Brunhilde"
}
;
names
.
Map
(
String
.
ToUpper
)
.
ForEach
(
WriteLine
)
;
}
}
}
Back
|
FazBrowse Home
|
New Git URL