Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
SlideShare a Scribd company logo
関数潮流(Function Tendency)
関数潮流(Function Tendency)
関数潮流(Function Tendency)
関数潮流(Function Tendency)
関数潮流(Function Tendency)
関数潮流(Function Tendency)
関数潮流(Function Tendency)
関数潮流(Function Tendency)
関数潮流(Function Tendency)
関数潮流(Function Tendency)
関数潮流(Function Tendency)
関数潮流(Function Tendency)
関数潮流(Function Tendency)
関数潮流(Function Tendency)
関数潮流(Function Tendency)
関数潮流(Function Tendency)
関数潮流(Function Tendency)
関数潮流(Function Tendency)
関数潮流(Function Tendency)
関数潮流(Function Tendency)
関数潮流(Function Tendency)
関数潮流(Function Tendency)
関数潮流(Function Tendency)
関数潮流(Function Tendency)
関数潮流(Function Tendency)
関数潮流(Function Tendency)
関数潮流(Function Tendency)
関数潮流(Function Tendency)
関数潮流(Function Tendency)
関数潮流(Function Tendency)
関数潮流(Function Tendency)
関数潮流(Function Tendency)
関数潮流(Function Tendency)
関数潮流(Function Tendency)
関数潮流(Function Tendency)
関数潮流(Function Tendency)
関数潮流(Function Tendency)
関数潮流(Function Tendency)
関数潮流(Function Tendency)
関数潮流(Function Tendency)
関数潮流(Function Tendency)
関数潮流(Function Tendency)
関数潮流(Function Tendency)
関数潮流(Function Tendency)
関数潮流(Function Tendency)
関数潮流(Function Tendency)
関数潮流(Function Tendency)
関数潮流(Function Tendency)
関数潮流(Function Tendency)
関数潮流(Function Tendency)
関数潮流(Function Tendency)
関数潮流(Function Tendency)
関数潮流(Function Tendency)
関数潮流(Function Tendency)
関数潮流(Function Tendency)
関数潮流(Function Tendency)
関数潮流(Function Tendency)
関数潮流(Function Tendency)
関数潮流(Function Tendency)
関数潮流(Function Tendency)
関数潮流(Function Tendency)
関数潮流(Function Tendency)
関数潮流(Function Tendency)
関数潮流(Function Tendency)
関数潮流(Function Tendency)
関数潮流(Function Tendency)
関数潮流(Function Tendency)
関数潮流(Function Tendency)
関数潮流(Function Tendency)
関数潮流(Function Tendency)
関数潮流(Function Tendency)
関数潮流(Function Tendency)
関数潮流(Function Tendency)
関数潮流(Function Tendency)
関数潮流(Function Tendency)
js> function add2(x) { return x + 2; }
js> add2(5);
7

js> var f = function(x) { return x + 2; }
js> f(8);
10

js> (function(x) { return x + 2; })(9)
11
js> function add2(x) { return x + 2; }
js> add2(5);
7

js> var f = function(x) { return x + 2; }
js> f(8);
10

js> (function(x) { return x + 2; })(9)
11
js> function add2(x) { return x + 2; }
js> add2(5);
7

js> var f = function(x) { return x + 2; }
js> f(8);
10

js> (function(x) { return x + 2; })(9)
11
js> function add2(x) { return x + 2; }
js> add2(5);
7

js> var f = function(x) { return x + 2; }
js> f(8);
10

js> (function(x) { return x + 2; })(9)
11
js> function add2(x) { return x + 2; }
js> add2(5);
7

js> var f = function(x) { return x + 2; }
js> f(8);
10

js> (function(x) { return x + 2; })(9)
11
Func<int, int> f = (x) => x + 2;



var f = function(x) { return x + 2; }


f = lambda x: x + 2;


f = x -> x + 2


(fset 'f (lambda (x) (+ x 2)))
関数潮流(Function Tendency)
関数潮流(Function Tendency)
関数潮流(Function Tendency)
関数潮流(Function Tendency)
関数潮流(Function Tendency)
Func<string, string>
  foo(Func<DateTime, string> f) {
    return
      x => x.ToUpper() + " "
        + f(DateTime.Today);
}

Func<DateTime, string> d =
    x => x.Year + "/" + x.Month;

Func<string, string> c = foo(d);
string result = c("oblove");

  “OBLOVE 2011/7”
Func<string, string>
  foo(Func<DateTime, string> f) {
    return
      x => x.ToUpper() + " "
        + f(DateTime.Today);
}

Func<DateTime, string> d =
    x => x.Year + "/" + x.Month;

Func<string, string> c = foo(d);
string result = c("oblove");

  “OBLOVE 2011/7”
Func<string, string>
  foo(Func<DateTime, string> f) {
    return
      x => x.ToUpper() + " "
        + f(DateTime.Today);
}

Func<DateTime, string> d =
    x => x.Year + "/" + x.Month;

Func<string, string> c = foo(d);
string result = c("oblove");

  “OBLOVE 2011/7”
Func<string, string>
  foo(Func<DateTime, string> f) {
    return
      x => x.ToUpper() + " "
        + f(DateTime.Today);
}

Func<DateTime, string> d =
    x => x.Year + "/" + x.Month;

Func<string, string> c = foo(d);
string result = c("oblove");

  “OBLOVE 2011/7”
Func<string, string>
  foo(Func<DateTime, string> f) {
    return
      x => x.ToUpper() + " "
        + f(DateTime.Today);
}

Func<DateTime, string> d =
    x => x.Year + "/" + x.Month;

Func<string, string> c = foo(d);
string result = c("oblove");

  “OBLOVE 2011/7”
Func<string, string>
  foo(Func<DateTime, string> f) {
    return
      x => x.ToUpper() + " "
        + f(DateTime.Today);
}

Func<DateTime, string> d =
    x => x.Year + "/" + x.Month;

Func<string, string> c = foo(d);
string result = c("oblove");

  “OBLOVE 2011/7”
Func<string, string>
  foo(Func<DateTime, string> f) {
    return
      x => x.ToUpper() + " "
        + f(DateTime.Today);
}

Func<DateTime, string> d =
    x => x.Year + "/" + x.Month;

Func<string, string> c = foo(d);
string result = c("oblove");

  “OBLOVE 2011/7”
関数潮流(Function Tendency)
関数潮流(Function Tendency)
関数潮流(Function Tendency)
関数潮流(Function Tendency)
関数潮流(Function Tendency)
関数潮流(Function Tendency)
関数潮流(Function Tendency)
関数潮流(Function Tendency)
関数潮流(Function Tendency)
関数潮流(Function Tendency)
int sum(int acc, IEnumerable<int> list) {
    if (!list.Any()) {
        return acc;
    }

    int head = list.First();
    return sum(acc + head, list.Skip(1));
}



List<int> ls = new List<int> { 3, 5, 8 };
int result = sum(0, ls);
int sum(int acc, IEnumerable<int> list) {
    if (!list.Any()) {
        return acc;
    }

    int head = list.First();
    return sum(acc + head, list.Skip(1));
}



List<int> ls = new List<int> { 3, 5, 8 };
int result = sum(0, ls);
int sum(int acc, IEnumerable<int> list) {
    if (!list.Any()) {
        return acc;
    }

    int head = list.First();
    return sum(acc + head, list.Skip(1));
}



List<int> ls = new List<int> { 3, 5, 8 };
int result = sum(0, ls);
int sum(int acc, IEnumerable<int> list) {
    if (!list.Any()) {
        return acc;
    }

    int head = list.First();
    return sum(acc + head, list.Skip(1));
}



List<int> ls = new List<int> { 3, 5, 8 };
int result = sum(0, ls);
int sum(int acc, IEnumerable<int> list) {
    if (!list.Any()) {
        return acc;
    }

    int head = list.First();
    return sum(acc + head, list.Skip(1));
}



List<int> ls = new List<int> { 3, 5, 8 };
int result = sum(0, ls);
int sum(int acc, IEnumerable<int> list) {
    if (!list.Any()) {
        return acc;
    }

    int head = list.First();
    return sum(acc + head, list.Skip(1));
}



List<int> ls = new List<int> { 3, 5, 8 };
int result = sum(0, ls);
int sum(int acc, IEnumerable<int> list) {
    if (!list.Any()) {
        return acc;
    }

    int head = list.First();
    return sum(acc + head, list.Skip(1));
}



List<int> ls = new List<int> { 3, 5, 8 };
int result = sum(0, ls);
関数潮流(Function Tendency)
関数潮流(Function Tendency)
関数潮流(Function Tendency)
関数潮流(Function Tendency)
関数潮流(Function Tendency)
関数潮流(Function Tendency)
>>> s = ['C#', 'Java', 'Python' ]
>>> map(lambda x: x.upper(), s)
['C#', 'JAVA', 'PYTHON']

>>> map(lambda x: len(x), s)
[2, 4, 6]
>>> s = ['C#', 'Java', 'Python' ]
>>> map(lambda x: x.upper(), s)
['C#', 'JAVA', 'PYTHON']

>>> map(lambda x: len(x), s)
[2, 4, 6]
>>> s = ['C#', 'Java', 'Python' ]
>>> map(lambda x: x.upper(), s)
['C#', 'JAVA', 'PYTHON']

>>> map(lambda x: len(x), s)
[2, 4, 6]
>>> s = [1, 2, 3, 4, 5, 6]
>>> filter(lambda x: x % 2 == 0, s)
[2, 4, 6]

>>> s = ['C#', 'Java', 'Python' ]
>>> map(lambda x: x.upper(),
     filter(lambda x: len(x) > 3, s))
['JAVA', 'PYTHON']
>>> s = [1, 2, 3, 4, 5, 6]
>>> filter(lambda x: x % 2 == 0, s)
[2, 4, 6]

>>> s = ['C#', 'Java', 'Python' ]
>>> map(lambda x: x.upper(),
     filter(lambda x: len(x) > 3, s))
['JAVA', 'PYTHON']
>>> s = [1, 2, 3, 4, 5, 6]
>>> filter(lambda x: x % 2 == 0, s)
[2, 4, 6]

>>> s = ['C#', 'Java', 'Python' ]
>>> map(lambda x: x.upper(),
     filter(lambda x: len(x) > 3, s))
['JAVA', 'PYTHON']
>>> s = [1, 2, 3, 4, 5, 6]
>>> filter(lambda x: x % 2 == 0, s)
[2, 4, 6]

>>> s = ['C#', 'Java', 'Python' ]
>>> map(lambda x: x.upper(),
     filter(lambda x: len(x) > 3, s))
['JAVA', 'PYTHON']
>>> s = [3, 4, 5, 7, 9]
>>> reduce(lambda x, y: x + y, s, 0)
28
>>> reduce(
   lambda x, y:
     x + (1 if (y % 2 == 0) else 0),
   s, 0)
1
>>> s = [3, 4, 5, 7, 9]
>>> reduce(lambda x, y: x + y, s, 0)
28
>>> reduce(
   lambda x, y:
     x + (1 if (y % 2 == 0) else 0),
   s, 0)
1
>>> s = [3, 4, 5, 7, 9]
>>> reduce(lambda x, y: x + y, s, 0)
28
>>> reduce(
   lambda x, y:
     x + (1 if (y % 2 == 0) else 0),
   s, 0)
1
>>> import itertools
>>> s = ['a', 'b', 'c', 'd']
>>> zip(s, itertools.count())
[('a', 0), ('b', 1), ('c', 2), ('d', 3)]

>>> filter(lambda x: x[1] != 1,
      zip(s, itertools.count()))
[('a', 0), ('c', 2), ('d', 3)]
>>> import itertools
>>> s = ['a', 'b', 'c', 'd']
>>> zip(s, itertools.count())
[('a', 0), ('b', 1), ('c', 2), ('d', 3)]

>>> filter(lambda x: x[1] != 1,
      zip(s, itertools.count()))
[('a', 0), ('c', 2), ('d', 3)]
>>> import itertools
>>> s = ['a', 'b', 'c', 'd']
>>> zip(s, itertools.count())
[('a', 0), ('b', 1), ('c', 2), ('d', 3)]

>>> filter(lambda x: x[1] != 1,
      zip(s, itertools.count()))
[('a', 0), ('c', 2), ('d', 3)]
関数潮流(Function Tendency)
関数潮流(Function Tendency)
>>> [x for x in [1, 2, 3, 4, 5]
      if (x % 2 != 0)]
[1, 3, 5]




var l = from x
        in new List<int> { 1, 2, 3, 4, 5 }
        where x % 2 != 0
        select x;
>>> [x * 2 for x in [1, 2, 3, 4, 5]
      if (x % 2 != 0)]
[2, 6, 10]




var l = from x
        in new List<int> { 1, 2, 3, 4, 5 }
        where x % 2 != 0
        select x * 2;
関数潮流(Function Tendency)
def cor(f):
     i = 0
     while True:
         i = f(i)
         yield i

l = cor(lambda x: x + 4)



[l.next() for x in range(0, 3)]
   [4, 8, 12]
def cor(f):
     i = 0
     while True:
         i = f(i)
         yield i

l = cor(lambda x: x + 4)



[l.next() for x in range(0, 3)]
   [4, 8, 12]
def cor(f):
     i = 0
     while True:
         i = f(i)
         yield i

l = cor(lambda x: x + 4)



[l.next() for x in range(0, 3)]
   [4, 8, 12]
def cor(f):
     i = 0
     while True:
         i = f(i)
         yield i

l = cor(lambda x: x + 4)



[l.next() for x in range(0, 3)]
   [4, 8, 12]
def cor(f):
     i = 0
     while True:
         i = f(i)
         yield i

l = cor(lambda x: x + 4)



[l.next() for x in range(0, 3)]
   [4, 8, 12]
def cor(f):
     i = 0
     while True:
         i = f(i)
         yield i

l = cor(lambda x: x + 4)



[l.next() for x in range(0, 3)]
   [4, 8, 12]
def cor(f):
     i = 0
     while True:
         i = f(i)
         yield i

l = cor(lambda x: x + 4)



[l.next() for x in range(0, 3)]
   [4, 8, 12]
IEnumerable<int> cor(Func<int, int> f) {
    int i = 0;
    while (true) {
       i = f(i);
       yield return i;
    }
}

var li = cor(x => x + 4);
var ls = from x in li.Take(3)
    select "<" + x.ToString() + ">";
   [“<4>”, “<8>”, “<12>”]
関数潮流(Function Tendency)
関数潮流(Function Tendency)
関数潮流(Function Tendency)
関数潮流(Function Tendency)
関数潮流(Function Tendency)
関数潮流(Function Tendency)
関数潮流(Function Tendency)
関数潮流(Function Tendency)
関数潮流(Function Tendency)
関数潮流(Function Tendency)
関数潮流(Function Tendency)
import static java.util.Arrays.asList;
import static ch.lambdaj.Lambda.*;
import static org.hamcrest.Matchers.*;

selected =
    filter(greaterThan(3),
      asList(1, 2, 3, 4, 5));
   [4, 5]

List<String> fruits =
    asList("apple", "orange", "banana");
selected =
    filter(startsWith("a"), fruits);
   [“apple”]
import static java.util.Arrays.asList;
import static ch.lambdaj.Lambda.*;
import static org.hamcrest.Matchers.*;

selected =
    filter(greaterThan(3),
      asList(1, 2, 3, 4, 5));
   [4, 5]

List<String> fruits =
    asList("apple", "orange", "banana");
selected =
    filter(startsWith("a"), fruits);
   [“apple”]
import static java.util.Arrays.asList;
import static ch.lambdaj.Lambda.*;
import static org.hamcrest.Matchers.*;

selected =
    filter(greaterThan(3),
      asList(1, 2, 3, 4, 5));
   [4, 5]

List<String> fruits =
    asList("apple", "orange", "banana");
selected =
    filter(startsWith("a"), fruits);
   [“apple”]
import static java.util.Arrays.asList;
import static ch.lambdaj.Lambda.*;
import static org.hamcrest.Matchers.*;

selected =
    filter(greaterThan(3),
      asList(1, 2, 3, 4, 5));
   [4, 5]

List<String> fruits =
    asList("apple", "orange", "banana");
selected =
    filter(startsWith("a"), fruits);
   [“apple”]
import static java.util.Arrays.asList;
import static ch.lambdaj.Lambda.*;
import static org.hamcrest.Matchers.*;

selected =
    filter(greaterThan(3),
      asList(1, 2, 3, 4, 5));
   [4, 5]

List<String> fruits =
    asList("apple", "orange", "banana");
selected =
    filter(startsWith("a"), fruits);
   [“apple”]
selected = convert(fruits,
  new Converter<String, String>() {
    public String convert(String arg0) {
        return arg0.toUpperCase();
    }
  });
   [“APPLE”, “ORANGE”, “BANANA”]

Closure c = closure(); {
  of(System.out).println(var(String.class));
}
c.apply("foo");
c.each(fruits);
selected = convert(fruits,
  new Converter<String, String>() {
    public String convert(String arg0) {
        return arg0.toUpperCase();
    }
  });
   [“APPLE”, “ORANGE”, “BANANA”]

Closure c = closure(); {
  of(System.out).println(var(String.class));
}
c.apply("foo");
c.each(fruits);
selected = convert(fruits,
  new Converter<String, String>() {
    public String convert(String arg0) {
        return arg0.toUpperCase();
    }
  });
   [“APPLE”, “ORANGE”, “BANANA”]

Closure c = closure(); {
  of(System.out).println(var(String.class));
}
c.apply("foo");
c.each(fruits);
selected = convert(fruits,
  new Converter<String, String>() {
    public String convert(String arg0) {
        return arg0.toUpperCase();
    }
  });
   [“APPLE”, “ORANGE”, “BANANA”]

Closure c = closure(); {
  of(System.out).println(var(String.class));
}
c.apply("foo");
c.each(fruits);
selected = convert(fruits,
  new Converter<String, String>() {
    public String convert(String arg0) {
        return arg0.toUpperCase();
    }
  });
   [“APPLE”, “ORANGE”, “BANANA”]

Closure c = closure(); {
  of(System.out).println(var(String.class));
}
c.apply("foo");
c.each(fruits);
関数潮流(Function Tendency)
import static fj.data.Array.*;
import static fj.function.Integers.*;
import fj.data.Array;

Array<Integer> a = array(1, 2, 3, 4, 5, 6);
Array<Integer> b =
  a.filter(even).map(add.f(10));
   [12, 14, 16]
関数潮流(Function Tendency)
関数潮流(Function Tendency)
関数潮流(Function Tendency)
関数潮流(Function Tendency)
関数潮流(Function Tendency)
関数潮流(Function Tendency)
関数潮流(Function Tendency)

More Related Content

What's hot

The Ring programming language version 1.8 book - Part 29 of 202
The Ring programming language version 1.8 book - Part 29 of 202The Ring programming language version 1.8 book - Part 29 of 202
The Ring programming language version 1.8 book - Part 29 of 202
Mahmoud Samir Fayed
 
Millionways
MillionwaysMillionways
Millionways
Brian Lonsdorf
 
Poor Man's Functional Programming
Poor Man's Functional ProgrammingPoor Man's Functional Programming
Poor Man's Functional Programming
Dmitry Buzdin
 
Functional programming basics
Functional programming basicsFunctional programming basics
Functional programming basics
openbala
 
The Ring programming language version 1.10 book - Part 30 of 212
The Ring programming language version 1.10 book - Part 30 of 212The Ring programming language version 1.10 book - Part 30 of 212
The Ring programming language version 1.10 book - Part 30 of 212
Mahmoud Samir Fayed
 
The Ring programming language version 1.9 book - Part 31 of 210
The Ring programming language version 1.9 book - Part 31 of 210The Ring programming language version 1.9 book - Part 31 of 210
The Ring programming language version 1.9 book - Part 31 of 210
Mahmoud Samir Fayed
 
Refactoring to Macros with Clojure
Refactoring to Macros with ClojureRefactoring to Macros with Clojure
Refactoring to Macros with Clojure
Dmitry Buzdin
 
The Ring programming language version 1.5.3 book - Part 22 of 184
The Ring programming language version 1.5.3 book - Part 22 of 184The Ring programming language version 1.5.3 book - Part 22 of 184
The Ring programming language version 1.5.3 book - Part 22 of 184
Mahmoud Samir Fayed
 
A tour of Python
A tour of PythonA tour of Python
A tour of Python
Aleksandar Veselinovic
 
The Ring programming language version 1.5.1 book - Part 34 of 180
The Ring programming language version 1.5.1 book - Part 34 of 180The Ring programming language version 1.5.1 book - Part 34 of 180
The Ring programming language version 1.5.1 book - Part 34 of 180
Mahmoud Samir Fayed
 
Oh Composable World!
Oh Composable World!Oh Composable World!
Oh Composable World!
Brian Lonsdorf
 
What are arrays in java script
What are arrays in java scriptWhat are arrays in java script
What are arrays in java script
Miguel Silva Loureiro
 
Functional programming from its fundamentals
Functional programming from its fundamentalsFunctional programming from its fundamentals
Functional programming from its fundamentals
Mauro Palsgraaf
 
The Ring programming language version 1.5.3 book - Part 10 of 184
The Ring programming language version 1.5.3 book - Part 10 of 184The Ring programming language version 1.5.3 book - Part 10 of 184
The Ring programming language version 1.5.3 book - Part 10 of 184
Mahmoud Samir Fayed
 
TDC218SP | Trilha Kotlin - DSLs in a Kotlin Way
TDC218SP | Trilha Kotlin - DSLs in a Kotlin WayTDC218SP | Trilha Kotlin - DSLs in a Kotlin Way
TDC218SP | Trilha Kotlin - DSLs in a Kotlin Way
tdc-globalcode
 
20170509 rand db_lesugent
20170509 rand db_lesugent20170509 rand db_lesugent
20170509 rand db_lesugent
Prof. Wim Van Criekinge
 
Python3 cheatsheet
Python3 cheatsheetPython3 cheatsheet
Python3 cheatsheet
Gil Cohen
 
The Ring programming language version 1.5.2 book - Part 33 of 181
The Ring programming language version 1.5.2 book - Part 33 of 181The Ring programming language version 1.5.2 book - Part 33 of 181
The Ring programming language version 1.5.2 book - Part 33 of 181
Mahmoud Samir Fayed
 
Implementing virtual machines in go & c 2018 redux
Implementing virtual machines in go & c 2018 reduxImplementing virtual machines in go & c 2018 redux
Implementing virtual machines in go & c 2018 redux
Eleanor McHugh
 
The Ring programming language version 1.8 book - Part 50 of 202
The Ring programming language version 1.8 book - Part 50 of 202The Ring programming language version 1.8 book - Part 50 of 202
The Ring programming language version 1.8 book - Part 50 of 202
Mahmoud Samir Fayed
 

What's hot (20)

The Ring programming language version 1.8 book - Part 29 of 202
The Ring programming language version 1.8 book - Part 29 of 202The Ring programming language version 1.8 book - Part 29 of 202
The Ring programming language version 1.8 book - Part 29 of 202
 
Millionways
MillionwaysMillionways
Millionways
 
Poor Man's Functional Programming
Poor Man's Functional ProgrammingPoor Man's Functional Programming
Poor Man's Functional Programming
 
Functional programming basics
Functional programming basicsFunctional programming basics
Functional programming basics
 
The Ring programming language version 1.10 book - Part 30 of 212
The Ring programming language version 1.10 book - Part 30 of 212The Ring programming language version 1.10 book - Part 30 of 212
The Ring programming language version 1.10 book - Part 30 of 212
 
The Ring programming language version 1.9 book - Part 31 of 210
The Ring programming language version 1.9 book - Part 31 of 210The Ring programming language version 1.9 book - Part 31 of 210
The Ring programming language version 1.9 book - Part 31 of 210
 
Refactoring to Macros with Clojure
Refactoring to Macros with ClojureRefactoring to Macros with Clojure
Refactoring to Macros with Clojure
 
The Ring programming language version 1.5.3 book - Part 22 of 184
The Ring programming language version 1.5.3 book - Part 22 of 184The Ring programming language version 1.5.3 book - Part 22 of 184
The Ring programming language version 1.5.3 book - Part 22 of 184
 
A tour of Python
A tour of PythonA tour of Python
A tour of Python
 
The Ring programming language version 1.5.1 book - Part 34 of 180
The Ring programming language version 1.5.1 book - Part 34 of 180The Ring programming language version 1.5.1 book - Part 34 of 180
The Ring programming language version 1.5.1 book - Part 34 of 180
 
Oh Composable World!
Oh Composable World!Oh Composable World!
Oh Composable World!
 
What are arrays in java script
What are arrays in java scriptWhat are arrays in java script
What are arrays in java script
 
Functional programming from its fundamentals
Functional programming from its fundamentalsFunctional programming from its fundamentals
Functional programming from its fundamentals
 
The Ring programming language version 1.5.3 book - Part 10 of 184
The Ring programming language version 1.5.3 book - Part 10 of 184The Ring programming language version 1.5.3 book - Part 10 of 184
The Ring programming language version 1.5.3 book - Part 10 of 184
 
TDC218SP | Trilha Kotlin - DSLs in a Kotlin Way
TDC218SP | Trilha Kotlin - DSLs in a Kotlin WayTDC218SP | Trilha Kotlin - DSLs in a Kotlin Way
TDC218SP | Trilha Kotlin - DSLs in a Kotlin Way
 
20170509 rand db_lesugent
20170509 rand db_lesugent20170509 rand db_lesugent
20170509 rand db_lesugent
 
Python3 cheatsheet
Python3 cheatsheetPython3 cheatsheet
Python3 cheatsheet
 
The Ring programming language version 1.5.2 book - Part 33 of 181
The Ring programming language version 1.5.2 book - Part 33 of 181The Ring programming language version 1.5.2 book - Part 33 of 181
The Ring programming language version 1.5.2 book - Part 33 of 181
 
Implementing virtual machines in go & c 2018 redux
Implementing virtual machines in go & c 2018 reduxImplementing virtual machines in go & c 2018 redux
Implementing virtual machines in go & c 2018 redux
 
The Ring programming language version 1.8 book - Part 50 of 202
The Ring programming language version 1.8 book - Part 50 of 202The Ring programming language version 1.8 book - Part 50 of 202
The Ring programming language version 1.8 book - Part 50 of 202
 

Viewers also liked

Oblove2009summer Lt.Key
Oblove2009summer Lt.KeyOblove2009summer Lt.Key
Oblove2009summer Lt.Key
riue
 
5分でわかる? 関数型 PHP の潮流
5分でわかる? 関数型 PHP の潮流5分でわかる? 関数型 PHP の潮流
5分でわかる? 関数型 PHP の潮流
Yuya Takeyama
 
10 Insightful Quotes On Designing A Better Customer Experience
10 Insightful Quotes On Designing A Better Customer Experience10 Insightful Quotes On Designing A Better Customer Experience
10 Insightful Quotes On Designing A Better Customer Experience
Yuan Wang
 
Learn BEM: CSS Naming Convention
Learn BEM: CSS Naming ConventionLearn BEM: CSS Naming Convention
Learn BEM: CSS Naming Convention
In a Rocket
 
How to Build a Dynamic Social Media Plan
How to Build a Dynamic Social Media PlanHow to Build a Dynamic Social Media Plan
How to Build a Dynamic Social Media Plan
Post Planner
 
SEO: Getting Personal
SEO: Getting PersonalSEO: Getting Personal
SEO: Getting Personal
Kirsty Hulse
 
Lightning Talk #9: How UX and Data Storytelling Can Shape Policy by Mika Aldaba
Lightning Talk #9: How UX and Data Storytelling Can Shape Policy by Mika AldabaLightning Talk #9: How UX and Data Storytelling Can Shape Policy by Mika Aldaba
Lightning Talk #9: How UX and Data Storytelling Can Shape Policy by Mika Aldaba
ux singapore
 
Succession “Losers”: What Happens to Executives Passed Over for the CEO Job?
Succession “Losers”: What Happens to Executives Passed Over for the CEO Job? Succession “Losers”: What Happens to Executives Passed Over for the CEO Job?
Succession “Losers”: What Happens to Executives Passed Over for the CEO Job?
Stanford GSB Corporate Governance Research Initiative
 

Viewers also liked (8)

Oblove2009summer Lt.Key
Oblove2009summer Lt.KeyOblove2009summer Lt.Key
Oblove2009summer Lt.Key
 
5分でわかる? 関数型 PHP の潮流
5分でわかる? 関数型 PHP の潮流5分でわかる? 関数型 PHP の潮流
5分でわかる? 関数型 PHP の潮流
 
10 Insightful Quotes On Designing A Better Customer Experience
10 Insightful Quotes On Designing A Better Customer Experience10 Insightful Quotes On Designing A Better Customer Experience
10 Insightful Quotes On Designing A Better Customer Experience
 
Learn BEM: CSS Naming Convention
Learn BEM: CSS Naming ConventionLearn BEM: CSS Naming Convention
Learn BEM: CSS Naming Convention
 
How to Build a Dynamic Social Media Plan
How to Build a Dynamic Social Media PlanHow to Build a Dynamic Social Media Plan
How to Build a Dynamic Social Media Plan
 
SEO: Getting Personal
SEO: Getting PersonalSEO: Getting Personal
SEO: Getting Personal
 
Lightning Talk #9: How UX and Data Storytelling Can Shape Policy by Mika Aldaba
Lightning Talk #9: How UX and Data Storytelling Can Shape Policy by Mika AldabaLightning Talk #9: How UX and Data Storytelling Can Shape Policy by Mika Aldaba
Lightning Talk #9: How UX and Data Storytelling Can Shape Policy by Mika Aldaba
 
Succession “Losers”: What Happens to Executives Passed Over for the CEO Job?
Succession “Losers”: What Happens to Executives Passed Over for the CEO Job? Succession “Losers”: What Happens to Executives Passed Over for the CEO Job?
Succession “Losers”: What Happens to Executives Passed Over for the CEO Job?
 

Similar to 関数潮流(Function Tendency)

Hitchhiker's Guide to Functional Programming
Hitchhiker's Guide to Functional ProgrammingHitchhiker's Guide to Functional Programming
Hitchhiker's Guide to Functional Programming
Sergey Shishkin
 
Functional Programming for OO Programmers (part 2)
Functional Programming for OO Programmers (part 2)Functional Programming for OO Programmers (part 2)
Functional Programming for OO Programmers (part 2)
Calvin Cheng
 
TDC2016SP - Trilha Programação Funcional
TDC2016SP - Trilha Programação FuncionalTDC2016SP - Trilha Programação Funcional
TDC2016SP - Trilha Programação Funcional
tdc-globalcode
 
Swift 함수 커링 사용하기
Swift 함수 커링 사용하기Swift 함수 커링 사용하기
Swift 함수 커링 사용하기
진성 오
 
Useful javascript
Useful javascriptUseful javascript
Useful javascript
Lei Kang
 
Scala 2 + 2 > 4
Scala 2 + 2 > 4Scala 2 + 2 > 4
Scala 2 + 2 > 4
Emil Vladev
 
Monadologie
MonadologieMonadologie
Monadologie
league
 
JBUG 11 - Scala For Java Programmers
JBUG 11 - Scala For Java ProgrammersJBUG 11 - Scala For Java Programmers
JBUG 11 - Scala For Java Programmers
Tikal Knowledge
 
Elm: give it a try
Elm: give it a tryElm: give it a try
Elm: give it a try
Eugene Zharkov
 
Beginning Scala Svcc 2009
Beginning Scala Svcc 2009Beginning Scala Svcc 2009
Beginning Scala Svcc 2009
David Pollak
 
Scala - where objects and functions meet
Scala - where objects and functions meetScala - where objects and functions meet
Scala - where objects and functions meet
Mario Fusco
 
Kotlin collections
Kotlin collectionsKotlin collections
Kotlin collections
Myeongin Woo
 
7 Habits For a More Functional Swift
7 Habits For a More Functional Swift7 Habits For a More Functional Swift
7 Habits For a More Functional Swift
Jason Larsen
 
Javascript
JavascriptJavascript
Javascript
Vlad Ifrim
 
Begin with Python
Begin with PythonBegin with Python
Begin with Python
Narong Intiruk
 
SDC - Einführung in Scala
SDC - Einführung in ScalaSDC - Einführung in Scala
SDC - Einführung in Scala
Christian Baranowski
 
Fp in scala part 2
Fp in scala part 2Fp in scala part 2
Fp in scala part 2
Hang Zhao
 
Intro to Functional Programming Workshop (code4lib)
Intro to Functional Programming Workshop (code4lib)Intro to Functional Programming Workshop (code4lib)
Intro to Functional Programming Workshop (code4lib)
Will Kurt
 
Seminar PSU 10.10.2014 mme
Seminar PSU 10.10.2014 mmeSeminar PSU 10.10.2014 mme
Seminar PSU 10.10.2014 mme
Vyacheslav Arbuzov
 
Futures e abstração - QCon São Paulo 2015
Futures e abstração - QCon São Paulo 2015Futures e abstração - QCon São Paulo 2015
Futures e abstração - QCon São Paulo 2015
Leonardo Borges
 

Similar to 関数潮流(Function Tendency) (20)

Hitchhiker's Guide to Functional Programming
Hitchhiker's Guide to Functional ProgrammingHitchhiker's Guide to Functional Programming
Hitchhiker's Guide to Functional Programming
 
Functional Programming for OO Programmers (part 2)
Functional Programming for OO Programmers (part 2)Functional Programming for OO Programmers (part 2)
Functional Programming for OO Programmers (part 2)
 
TDC2016SP - Trilha Programação Funcional
TDC2016SP - Trilha Programação FuncionalTDC2016SP - Trilha Programação Funcional
TDC2016SP - Trilha Programação Funcional
 
Swift 함수 커링 사용하기
Swift 함수 커링 사용하기Swift 함수 커링 사용하기
Swift 함수 커링 사용하기
 
Useful javascript
Useful javascriptUseful javascript
Useful javascript
 
Scala 2 + 2 > 4
Scala 2 + 2 > 4Scala 2 + 2 > 4
Scala 2 + 2 > 4
 
Monadologie
MonadologieMonadologie
Monadologie
 
JBUG 11 - Scala For Java Programmers
JBUG 11 - Scala For Java ProgrammersJBUG 11 - Scala For Java Programmers
JBUG 11 - Scala For Java Programmers
 
Elm: give it a try
Elm: give it a tryElm: give it a try
Elm: give it a try
 
Beginning Scala Svcc 2009
Beginning Scala Svcc 2009Beginning Scala Svcc 2009
Beginning Scala Svcc 2009
 
Scala - where objects and functions meet
Scala - where objects and functions meetScala - where objects and functions meet
Scala - where objects and functions meet
 
Kotlin collections
Kotlin collectionsKotlin collections
Kotlin collections
 
7 Habits For a More Functional Swift
7 Habits For a More Functional Swift7 Habits For a More Functional Swift
7 Habits For a More Functional Swift
 
Javascript
JavascriptJavascript
Javascript
 
Begin with Python
Begin with PythonBegin with Python
Begin with Python
 
SDC - Einführung in Scala
SDC - Einführung in ScalaSDC - Einführung in Scala
SDC - Einführung in Scala
 
Fp in scala part 2
Fp in scala part 2Fp in scala part 2
Fp in scala part 2
 
Intro to Functional Programming Workshop (code4lib)
Intro to Functional Programming Workshop (code4lib)Intro to Functional Programming Workshop (code4lib)
Intro to Functional Programming Workshop (code4lib)
 
Seminar PSU 10.10.2014 mme
Seminar PSU 10.10.2014 mmeSeminar PSU 10.10.2014 mme
Seminar PSU 10.10.2014 mme
 
Futures e abstração - QCon São Paulo 2015
Futures e abstração - QCon São Paulo 2015Futures e abstração - QCon São Paulo 2015
Futures e abstração - QCon São Paulo 2015
 

Recently uploaded

Fluttercon 2024: Showing that you care about security - OpenSSF Scorecards fo...
Fluttercon 2024: Showing that you care about security - OpenSSF Scorecards fo...Fluttercon 2024: Showing that you care about security - OpenSSF Scorecards fo...
Fluttercon 2024: Showing that you care about security - OpenSSF Scorecards fo...
Chris Swan
 
Implementations of Fused Deposition Modeling in real world
Implementations of Fused Deposition Modeling  in real worldImplementations of Fused Deposition Modeling  in real world
Implementations of Fused Deposition Modeling in real world
Emerging Tech
 
Running a Go App in Kubernetes: CPU Impacts
Running a Go App in Kubernetes: CPU ImpactsRunning a Go App in Kubernetes: CPU Impacts
Running a Go App in Kubernetes: CPU Impacts
ScyllaDB
 
@Call @Girls Pune 0000000000 Riya Khan Beautiful Girl any Time
@Call @Girls Pune 0000000000 Riya Khan Beautiful Girl any Time@Call @Girls Pune 0000000000 Riya Khan Beautiful Girl any Time
@Call @Girls Pune 0000000000 Riya Khan Beautiful Girl any Time
amitchopra0215
 
Why do You Have to Redesign?_Redesign Challenge Day 1
Why do You Have to Redesign?_Redesign Challenge Day 1Why do You Have to Redesign?_Redesign Challenge Day 1
Why do You Have to Redesign?_Redesign Challenge Day 1
FellyciaHikmahwarani
 
How to Avoid Learning the Linux-Kernel Memory Model
How to Avoid Learning the Linux-Kernel Memory ModelHow to Avoid Learning the Linux-Kernel Memory Model
How to Avoid Learning the Linux-Kernel Memory Model
ScyllaDB
 
Calgary MuleSoft Meetup APM and IDP .pptx
Calgary MuleSoft Meetup APM and IDP .pptxCalgary MuleSoft Meetup APM and IDP .pptx
Calgary MuleSoft Meetup APM and IDP .pptx
ishalveerrandhawa1
 
20240705 QFM024 Irresponsible AI Reading List June 2024
20240705 QFM024 Irresponsible AI Reading List June 202420240705 QFM024 Irresponsible AI Reading List June 2024
20240705 QFM024 Irresponsible AI Reading List June 2024
Matthew Sinclair
 
What's New in Copilot for Microsoft365 May 2024.pptx
What's New in Copilot for Microsoft365 May 2024.pptxWhat's New in Copilot for Microsoft365 May 2024.pptx
What's New in Copilot for Microsoft365 May 2024.pptx
Stephanie Beckett
 
Cookies program to display the information though cookie creation
Cookies program to display the information though cookie creationCookies program to display the information though cookie creation
Cookies program to display the information though cookie creation
shanthidl1
 
DealBook of Ukraine: 2024 edition
DealBook of Ukraine: 2024 editionDealBook of Ukraine: 2024 edition
DealBook of Ukraine: 2024 edition
Yevgen Sysoyev
 
@Call @Girls Thiruvananthapuram 🚒 XXXXXXXXXX 🚒 Priya Sharma Beautiful And Cu...
@Call @Girls Thiruvananthapuram  🚒 XXXXXXXXXX 🚒 Priya Sharma Beautiful And Cu...@Call @Girls Thiruvananthapuram  🚒 XXXXXXXXXX 🚒 Priya Sharma Beautiful And Cu...
@Call @Girls Thiruvananthapuram 🚒 XXXXXXXXXX 🚒 Priya Sharma Beautiful And Cu...
kantakumariji156
 
20240704 QFM023 Engineering Leadership Reading List June 2024
20240704 QFM023 Engineering Leadership Reading List June 202420240704 QFM023 Engineering Leadership Reading List June 2024
20240704 QFM023 Engineering Leadership Reading List June 2024
Matthew Sinclair
 
GDG Cloud Southlake #34: Neatsun Ziv: Automating Appsec
GDG Cloud Southlake #34: Neatsun Ziv: Automating AppsecGDG Cloud Southlake #34: Neatsun Ziv: Automating Appsec
GDG Cloud Southlake #34: Neatsun Ziv: Automating Appsec
James Anderson
 
[Talk] Moving Beyond Spaghetti Infrastructure [AOTB] 2024-07-04.pdf
[Talk] Moving Beyond Spaghetti Infrastructure [AOTB] 2024-07-04.pdf[Talk] Moving Beyond Spaghetti Infrastructure [AOTB] 2024-07-04.pdf
[Talk] Moving Beyond Spaghetti Infrastructure [AOTB] 2024-07-04.pdf
Kief Morris
 
How Netflix Builds High Performance Applications at Global Scale
How Netflix Builds High Performance Applications at Global ScaleHow Netflix Builds High Performance Applications at Global Scale
How Netflix Builds High Performance Applications at Global Scale
ScyllaDB
 
Coordinate Systems in FME 101 - Webinar Slides
Coordinate Systems in FME 101 - Webinar SlidesCoordinate Systems in FME 101 - Webinar Slides
Coordinate Systems in FME 101 - Webinar Slides
Safe Software
 
What’s New in Teams Calling, Meetings and Devices May 2024
What’s New in Teams Calling, Meetings and Devices May 2024What’s New in Teams Calling, Meetings and Devices May 2024
What’s New in Teams Calling, Meetings and Devices May 2024
Stephanie Beckett
 
Recent Advancements in the NIST-JARVIS Infrastructure
Recent Advancements in the NIST-JARVIS InfrastructureRecent Advancements in the NIST-JARVIS Infrastructure
Recent Advancements in the NIST-JARVIS Infrastructure
KAMAL CHOUDHARY
 
20240702 QFM021 Machine Intelligence Reading List June 2024
20240702 QFM021 Machine Intelligence Reading List June 202420240702 QFM021 Machine Intelligence Reading List June 2024
20240702 QFM021 Machine Intelligence Reading List June 2024
Matthew Sinclair
 

Recently uploaded (20)

Fluttercon 2024: Showing that you care about security - OpenSSF Scorecards fo...
Fluttercon 2024: Showing that you care about security - OpenSSF Scorecards fo...Fluttercon 2024: Showing that you care about security - OpenSSF Scorecards fo...
Fluttercon 2024: Showing that you care about security - OpenSSF Scorecards fo...
 
Implementations of Fused Deposition Modeling in real world
Implementations of Fused Deposition Modeling  in real worldImplementations of Fused Deposition Modeling  in real world
Implementations of Fused Deposition Modeling in real world
 
Running a Go App in Kubernetes: CPU Impacts
Running a Go App in Kubernetes: CPU ImpactsRunning a Go App in Kubernetes: CPU Impacts
Running a Go App in Kubernetes: CPU Impacts
 
@Call @Girls Pune 0000000000 Riya Khan Beautiful Girl any Time
@Call @Girls Pune 0000000000 Riya Khan Beautiful Girl any Time@Call @Girls Pune 0000000000 Riya Khan Beautiful Girl any Time
@Call @Girls Pune 0000000000 Riya Khan Beautiful Girl any Time
 
Why do You Have to Redesign?_Redesign Challenge Day 1
Why do You Have to Redesign?_Redesign Challenge Day 1Why do You Have to Redesign?_Redesign Challenge Day 1
Why do You Have to Redesign?_Redesign Challenge Day 1
 
How to Avoid Learning the Linux-Kernel Memory Model
How to Avoid Learning the Linux-Kernel Memory ModelHow to Avoid Learning the Linux-Kernel Memory Model
How to Avoid Learning the Linux-Kernel Memory Model
 
Calgary MuleSoft Meetup APM and IDP .pptx
Calgary MuleSoft Meetup APM and IDP .pptxCalgary MuleSoft Meetup APM and IDP .pptx
Calgary MuleSoft Meetup APM and IDP .pptx
 
20240705 QFM024 Irresponsible AI Reading List June 2024
20240705 QFM024 Irresponsible AI Reading List June 202420240705 QFM024 Irresponsible AI Reading List June 2024
20240705 QFM024 Irresponsible AI Reading List June 2024
 
What's New in Copilot for Microsoft365 May 2024.pptx
What's New in Copilot for Microsoft365 May 2024.pptxWhat's New in Copilot for Microsoft365 May 2024.pptx
What's New in Copilot for Microsoft365 May 2024.pptx
 
Cookies program to display the information though cookie creation
Cookies program to display the information though cookie creationCookies program to display the information though cookie creation
Cookies program to display the information though cookie creation
 
DealBook of Ukraine: 2024 edition
DealBook of Ukraine: 2024 editionDealBook of Ukraine: 2024 edition
DealBook of Ukraine: 2024 edition
 
@Call @Girls Thiruvananthapuram 🚒 XXXXXXXXXX 🚒 Priya Sharma Beautiful And Cu...
@Call @Girls Thiruvananthapuram  🚒 XXXXXXXXXX 🚒 Priya Sharma Beautiful And Cu...@Call @Girls Thiruvananthapuram  🚒 XXXXXXXXXX 🚒 Priya Sharma Beautiful And Cu...
@Call @Girls Thiruvananthapuram 🚒 XXXXXXXXXX 🚒 Priya Sharma Beautiful And Cu...
 
20240704 QFM023 Engineering Leadership Reading List June 2024
20240704 QFM023 Engineering Leadership Reading List June 202420240704 QFM023 Engineering Leadership Reading List June 2024
20240704 QFM023 Engineering Leadership Reading List June 2024
 
GDG Cloud Southlake #34: Neatsun Ziv: Automating Appsec
GDG Cloud Southlake #34: Neatsun Ziv: Automating AppsecGDG Cloud Southlake #34: Neatsun Ziv: Automating Appsec
GDG Cloud Southlake #34: Neatsun Ziv: Automating Appsec
 
[Talk] Moving Beyond Spaghetti Infrastructure [AOTB] 2024-07-04.pdf
[Talk] Moving Beyond Spaghetti Infrastructure [AOTB] 2024-07-04.pdf[Talk] Moving Beyond Spaghetti Infrastructure [AOTB] 2024-07-04.pdf
[Talk] Moving Beyond Spaghetti Infrastructure [AOTB] 2024-07-04.pdf
 
How Netflix Builds High Performance Applications at Global Scale
How Netflix Builds High Performance Applications at Global ScaleHow Netflix Builds High Performance Applications at Global Scale
How Netflix Builds High Performance Applications at Global Scale
 
Coordinate Systems in FME 101 - Webinar Slides
Coordinate Systems in FME 101 - Webinar SlidesCoordinate Systems in FME 101 - Webinar Slides
Coordinate Systems in FME 101 - Webinar Slides
 
What’s New in Teams Calling, Meetings and Devices May 2024
What’s New in Teams Calling, Meetings and Devices May 2024What’s New in Teams Calling, Meetings and Devices May 2024
What’s New in Teams Calling, Meetings and Devices May 2024
 
Recent Advancements in the NIST-JARVIS Infrastructure
Recent Advancements in the NIST-JARVIS InfrastructureRecent Advancements in the NIST-JARVIS Infrastructure
Recent Advancements in the NIST-JARVIS Infrastructure
 
20240702 QFM021 Machine Intelligence Reading List June 2024
20240702 QFM021 Machine Intelligence Reading List June 202420240702 QFM021 Machine Intelligence Reading List June 2024
20240702 QFM021 Machine Intelligence Reading List June 2024
 

関数潮流(Function Tendency)

  • 76. js> function add2(x) { return x + 2; } js> add2(5); 7 js> var f = function(x) { return x + 2; } js> f(8); 10 js> (function(x) { return x + 2; })(9) 11
  • 77. js> function add2(x) { return x + 2; } js> add2(5); 7 js> var f = function(x) { return x + 2; } js> f(8); 10 js> (function(x) { return x + 2; })(9) 11
  • 78. js> function add2(x) { return x + 2; } js> add2(5); 7 js> var f = function(x) { return x + 2; } js> f(8); 10 js> (function(x) { return x + 2; })(9) 11
  • 79. js> function add2(x) { return x + 2; } js> add2(5); 7 js> var f = function(x) { return x + 2; } js> f(8); 10 js> (function(x) { return x + 2; })(9) 11
  • 80. js> function add2(x) { return x + 2; } js> add2(5); 7 js> var f = function(x) { return x + 2; } js> f(8); 10 js> (function(x) { return x + 2; })(9) 11
  • 81. Func<int, int> f = (x) => x + 2; var f = function(x) { return x + 2; } f = lambda x: x + 2; f = x -> x + 2 (fset 'f (lambda (x) (+ x 2)))
  • 87. Func<string, string> foo(Func<DateTime, string> f) { return x => x.ToUpper() + " " + f(DateTime.Today); } Func<DateTime, string> d = x => x.Year + "/" + x.Month; Func<string, string> c = foo(d); string result = c("oblove"); “OBLOVE 2011/7”
  • 88. Func<string, string> foo(Func<DateTime, string> f) { return x => x.ToUpper() + " " + f(DateTime.Today); } Func<DateTime, string> d = x => x.Year + "/" + x.Month; Func<string, string> c = foo(d); string result = c("oblove"); “OBLOVE 2011/7”
  • 89. Func<string, string> foo(Func<DateTime, string> f) { return x => x.ToUpper() + " " + f(DateTime.Today); } Func<DateTime, string> d = x => x.Year + "/" + x.Month; Func<string, string> c = foo(d); string result = c("oblove"); “OBLOVE 2011/7”
  • 90. Func<string, string> foo(Func<DateTime, string> f) { return x => x.ToUpper() + " " + f(DateTime.Today); } Func<DateTime, string> d = x => x.Year + "/" + x.Month; Func<string, string> c = foo(d); string result = c("oblove"); “OBLOVE 2011/7”
  • 91. Func<string, string> foo(Func<DateTime, string> f) { return x => x.ToUpper() + " " + f(DateTime.Today); } Func<DateTime, string> d = x => x.Year + "/" + x.Month; Func<string, string> c = foo(d); string result = c("oblove"); “OBLOVE 2011/7”
  • 92. Func<string, string> foo(Func<DateTime, string> f) { return x => x.ToUpper() + " " + f(DateTime.Today); } Func<DateTime, string> d = x => x.Year + "/" + x.Month; Func<string, string> c = foo(d); string result = c("oblove"); “OBLOVE 2011/7”
  • 93. Func<string, string> foo(Func<DateTime, string> f) { return x => x.ToUpper() + " " + f(DateTime.Today); } Func<DateTime, string> d = x => x.Year + "/" + x.Month; Func<string, string> c = foo(d); string result = c("oblove"); “OBLOVE 2011/7”
  • 104. int sum(int acc, IEnumerable<int> list) { if (!list.Any()) { return acc; } int head = list.First(); return sum(acc + head, list.Skip(1)); } List<int> ls = new List<int> { 3, 5, 8 }; int result = sum(0, ls);
  • 105. int sum(int acc, IEnumerable<int> list) { if (!list.Any()) { return acc; } int head = list.First(); return sum(acc + head, list.Skip(1)); } List<int> ls = new List<int> { 3, 5, 8 }; int result = sum(0, ls);
  • 106. int sum(int acc, IEnumerable<int> list) { if (!list.Any()) { return acc; } int head = list.First(); return sum(acc + head, list.Skip(1)); } List<int> ls = new List<int> { 3, 5, 8 }; int result = sum(0, ls);
  • 107. int sum(int acc, IEnumerable<int> list) { if (!list.Any()) { return acc; } int head = list.First(); return sum(acc + head, list.Skip(1)); } List<int> ls = new List<int> { 3, 5, 8 }; int result = sum(0, ls);
  • 108. int sum(int acc, IEnumerable<int> list) { if (!list.Any()) { return acc; } int head = list.First(); return sum(acc + head, list.Skip(1)); } List<int> ls = new List<int> { 3, 5, 8 }; int result = sum(0, ls);
  • 109. int sum(int acc, IEnumerable<int> list) { if (!list.Any()) { return acc; } int head = list.First(); return sum(acc + head, list.Skip(1)); } List<int> ls = new List<int> { 3, 5, 8 }; int result = sum(0, ls);
  • 110. int sum(int acc, IEnumerable<int> list) { if (!list.Any()) { return acc; } int head = list.First(); return sum(acc + head, list.Skip(1)); } List<int> ls = new List<int> { 3, 5, 8 }; int result = sum(0, ls);
  • 117. >>> s = ['C#', 'Java', 'Python' ] >>> map(lambda x: x.upper(), s) ['C#', 'JAVA', 'PYTHON'] >>> map(lambda x: len(x), s) [2, 4, 6]
  • 118. >>> s = ['C#', 'Java', 'Python' ] >>> map(lambda x: x.upper(), s) ['C#', 'JAVA', 'PYTHON'] >>> map(lambda x: len(x), s) [2, 4, 6]
  • 119. >>> s = ['C#', 'Java', 'Python' ] >>> map(lambda x: x.upper(), s) ['C#', 'JAVA', 'PYTHON'] >>> map(lambda x: len(x), s) [2, 4, 6]
  • 120. >>> s = [1, 2, 3, 4, 5, 6] >>> filter(lambda x: x % 2 == 0, s) [2, 4, 6] >>> s = ['C#', 'Java', 'Python' ] >>> map(lambda x: x.upper(), filter(lambda x: len(x) > 3, s)) ['JAVA', 'PYTHON']
  • 121. >>> s = [1, 2, 3, 4, 5, 6] >>> filter(lambda x: x % 2 == 0, s) [2, 4, 6] >>> s = ['C#', 'Java', 'Python' ] >>> map(lambda x: x.upper(), filter(lambda x: len(x) > 3, s)) ['JAVA', 'PYTHON']
  • 122. >>> s = [1, 2, 3, 4, 5, 6] >>> filter(lambda x: x % 2 == 0, s) [2, 4, 6] >>> s = ['C#', 'Java', 'Python' ] >>> map(lambda x: x.upper(), filter(lambda x: len(x) > 3, s)) ['JAVA', 'PYTHON']
  • 123. >>> s = [1, 2, 3, 4, 5, 6] >>> filter(lambda x: x % 2 == 0, s) [2, 4, 6] >>> s = ['C#', 'Java', 'Python' ] >>> map(lambda x: x.upper(), filter(lambda x: len(x) > 3, s)) ['JAVA', 'PYTHON']
  • 124. >>> s = [3, 4, 5, 7, 9] >>> reduce(lambda x, y: x + y, s, 0) 28 >>> reduce( lambda x, y: x + (1 if (y % 2 == 0) else 0), s, 0) 1
  • 125. >>> s = [3, 4, 5, 7, 9] >>> reduce(lambda x, y: x + y, s, 0) 28 >>> reduce( lambda x, y: x + (1 if (y % 2 == 0) else 0), s, 0) 1
  • 126. >>> s = [3, 4, 5, 7, 9] >>> reduce(lambda x, y: x + y, s, 0) 28 >>> reduce( lambda x, y: x + (1 if (y % 2 == 0) else 0), s, 0) 1
  • 127. >>> import itertools >>> s = ['a', 'b', 'c', 'd'] >>> zip(s, itertools.count()) [('a', 0), ('b', 1), ('c', 2), ('d', 3)] >>> filter(lambda x: x[1] != 1, zip(s, itertools.count())) [('a', 0), ('c', 2), ('d', 3)]
  • 128. >>> import itertools >>> s = ['a', 'b', 'c', 'd'] >>> zip(s, itertools.count()) [('a', 0), ('b', 1), ('c', 2), ('d', 3)] >>> filter(lambda x: x[1] != 1, zip(s, itertools.count())) [('a', 0), ('c', 2), ('d', 3)]
  • 129. >>> import itertools >>> s = ['a', 'b', 'c', 'd'] >>> zip(s, itertools.count()) [('a', 0), ('b', 1), ('c', 2), ('d', 3)] >>> filter(lambda x: x[1] != 1, zip(s, itertools.count())) [('a', 0), ('c', 2), ('d', 3)]
  • 132. >>> [x for x in [1, 2, 3, 4, 5] if (x % 2 != 0)] [1, 3, 5] var l = from x in new List<int> { 1, 2, 3, 4, 5 } where x % 2 != 0 select x;
  • 133. >>> [x * 2 for x in [1, 2, 3, 4, 5] if (x % 2 != 0)] [2, 6, 10] var l = from x in new List<int> { 1, 2, 3, 4, 5 } where x % 2 != 0 select x * 2;
  • 135. def cor(f): i = 0 while True: i = f(i) yield i l = cor(lambda x: x + 4) [l.next() for x in range(0, 3)] [4, 8, 12]
  • 136. def cor(f): i = 0 while True: i = f(i) yield i l = cor(lambda x: x + 4) [l.next() for x in range(0, 3)] [4, 8, 12]
  • 137. def cor(f): i = 0 while True: i = f(i) yield i l = cor(lambda x: x + 4) [l.next() for x in range(0, 3)] [4, 8, 12]
  • 138. def cor(f): i = 0 while True: i = f(i) yield i l = cor(lambda x: x + 4) [l.next() for x in range(0, 3)] [4, 8, 12]
  • 139. def cor(f): i = 0 while True: i = f(i) yield i l = cor(lambda x: x + 4) [l.next() for x in range(0, 3)] [4, 8, 12]
  • 140. def cor(f): i = 0 while True: i = f(i) yield i l = cor(lambda x: x + 4) [l.next() for x in range(0, 3)] [4, 8, 12]
  • 141. def cor(f): i = 0 while True: i = f(i) yield i l = cor(lambda x: x + 4) [l.next() for x in range(0, 3)] [4, 8, 12]
  • 142. IEnumerable<int> cor(Func<int, int> f) { int i = 0; while (true) { i = f(i); yield return i; } } var li = cor(x => x + 4); var ls = from x in li.Take(3) select "<" + x.ToString() + ">"; [“<4>”, “<8>”, “<12>”]
  • 154. import static java.util.Arrays.asList; import static ch.lambdaj.Lambda.*; import static org.hamcrest.Matchers.*; selected = filter(greaterThan(3), asList(1, 2, 3, 4, 5)); [4, 5] List<String> fruits = asList("apple", "orange", "banana"); selected = filter(startsWith("a"), fruits); [“apple”]
  • 155. import static java.util.Arrays.asList; import static ch.lambdaj.Lambda.*; import static org.hamcrest.Matchers.*; selected = filter(greaterThan(3), asList(1, 2, 3, 4, 5)); [4, 5] List<String> fruits = asList("apple", "orange", "banana"); selected = filter(startsWith("a"), fruits); [“apple”]
  • 156. import static java.util.Arrays.asList; import static ch.lambdaj.Lambda.*; import static org.hamcrest.Matchers.*; selected = filter(greaterThan(3), asList(1, 2, 3, 4, 5)); [4, 5] List<String> fruits = asList("apple", "orange", "banana"); selected = filter(startsWith("a"), fruits); [“apple”]
  • 157. import static java.util.Arrays.asList; import static ch.lambdaj.Lambda.*; import static org.hamcrest.Matchers.*; selected = filter(greaterThan(3), asList(1, 2, 3, 4, 5)); [4, 5] List<String> fruits = asList("apple", "orange", "banana"); selected = filter(startsWith("a"), fruits); [“apple”]
  • 158. import static java.util.Arrays.asList; import static ch.lambdaj.Lambda.*; import static org.hamcrest.Matchers.*; selected = filter(greaterThan(3), asList(1, 2, 3, 4, 5)); [4, 5] List<String> fruits = asList("apple", "orange", "banana"); selected = filter(startsWith("a"), fruits); [“apple”]
  • 159. selected = convert(fruits, new Converter<String, String>() { public String convert(String arg0) { return arg0.toUpperCase(); } }); [“APPLE”, “ORANGE”, “BANANA”] Closure c = closure(); { of(System.out).println(var(String.class)); } c.apply("foo"); c.each(fruits);
  • 160. selected = convert(fruits, new Converter<String, String>() { public String convert(String arg0) { return arg0.toUpperCase(); } }); [“APPLE”, “ORANGE”, “BANANA”] Closure c = closure(); { of(System.out).println(var(String.class)); } c.apply("foo"); c.each(fruits);
  • 161. selected = convert(fruits, new Converter<String, String>() { public String convert(String arg0) { return arg0.toUpperCase(); } }); [“APPLE”, “ORANGE”, “BANANA”] Closure c = closure(); { of(System.out).println(var(String.class)); } c.apply("foo"); c.each(fruits);
  • 162. selected = convert(fruits, new Converter<String, String>() { public String convert(String arg0) { return arg0.toUpperCase(); } }); [“APPLE”, “ORANGE”, “BANANA”] Closure c = closure(); { of(System.out).println(var(String.class)); } c.apply("foo"); c.each(fruits);
  • 163. selected = convert(fruits, new Converter<String, String>() { public String convert(String arg0) { return arg0.toUpperCase(); } }); [“APPLE”, “ORANGE”, “BANANA”] Closure c = closure(); { of(System.out).println(var(String.class)); } c.apply("foo"); c.each(fruits);
  • 165. import static fj.data.Array.*; import static fj.function.Integers.*; import fj.data.Array; Array<Integer> a = array(1, 2, 3, 4, 5, 6); Array<Integer> b = a.filter(even).map(add.f(10)); [12, 14, 16]

Editor's Notes

  1. \n
  2. \n
  3. \n
  4. \n
  5. \n
  6. \n
  7. \n
  8. \n
  9. \n
  10. \n
  11. \n
  12. \n
  13. \n
  14. \n
  15. \n
  16. \n
  17. \n
  18. \n
  19. \n
  20. \n
  21. \n
  22. \n
  23. \n
  24. \n
  25. \n
  26. \n
  27. \n
  28. \n
  29. \n
  30. \n
  31. \n
  32. \n
  33. \n
  34. \n
  35. \n
  36. \n
  37. \n
  38. \n
  39. \n
  40. \n
  41. \n
  42. \n
  43. \n
  44. \n
  45. \n
  46. \n
  47. \n
  48. \n
  49. \n
  50. \n
  51. \n
  52. \n
  53. \n
  54. \n
  55. \n
  56. \n
  57. \n
  58. \n
  59. \n
  60. \n
  61. \n
  62. \n
  63. \n
  64. \n
  65. \n
  66. \n
  67. \n
  68. \n
  69. \n
  70. \n
  71. \n
  72. \n
  73. \n
  74. \n
  75. \n
  76. \n
  77. \n
  78. \n
  79. \n
  80. \n
  81. \n
  82. \n
  83. \n
  84. \n
  85. \n
  86. \n
  87. \n
  88. \n
  89. \n
  90. \n
  91. \n
  92. \n
  93. \n
  94. \n
  95. \n
  96. \n
  97. \n
  98. \n
  99. \n
  100. \n
  101. \n
  102. \n
  103. \n
  104. \n
  105. \n
  106. \n
  107. \n
  108. \n
  109. \n
  110. \n
  111. \n
  112. \n
  113. \n
  114. \n
  115. \n
  116. \n
  117. \n
  118. \n
  119. \n
  120. \n
  121. \n
  122. \n
  123. \n
  124. \n
  125. \n
  126. \n
  127. \n
  128. \n
  129. \n
  130. \n
  131. \n
  132. \n
  133. \n
  134. \n
  135. \n
  136. \n
  137. \n
  138. \n
  139. \n
  140. \n
  141. \n
  142. \n
  143. \n
  144. \n
  145. \n
  146. \n
  147. \n