-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
exoego
committed
Jul 5, 2019
1 parent
c2883a1
commit 84fe4fe
Showing
131 changed files
with
1,725 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
name: 日本語 | ||
home: | ||
title: "{{ site.title }}" | ||
description: Scala 関数の図解 | ||
keywords: "scala 関数, scala をわかりやすく説明, scala を学ぶ, 関数プログラミング, 視覚的 scala, scala 図解" | ||
functions: | ||
title: "{{ page.name }} - {{ site.title }}" | ||
description: "Scala {{ page.name }} 関数. Scala の {{ page.name }} 関数の図解" | ||
keywords: "{{ page.name }} 関数, scala {{ page.name }} 関数" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
--- | ||
name: aggregate | ||
--- | ||
|
||
# `aggregate` | ||
|
||
@include [signatures/aggregate.md] | ||
|
||
`aggregate` は二項演算子 `seqop` を要素のかたまりに適用し、二項演算子 `combop` を使って中間結果を結合します。 | ||
値 `z` は型 `B` の<strong>零元</strong>であり、何回も使われるかもしれません。 | ||
|
||
@include [figure.html source="../images/aggregate.svg" desc="関数 aggregate の図"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
--- | ||
name: andThen | ||
--- | ||
|
||
# `andThen` | ||
|
||
@include [signatures/andThen.md] | ||
|
||
`andThen` は匿名関数を作成します。その関数は、受け取った値にまずこの関数を適用し、次にその値に `g` を適用した結果を返します。 | ||
これは [`compose`](./compose) の逆です。 | ||
|
||
@include [figure.html source="../images/andThen.svg" desc="関数 andThen の図"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
--- | ||
name: appended | ||
--- | ||
|
||
# `appended` | ||
|
||
@include [signatures/appended.md] | ||
|
||
`appended` は、このコレクションの末尾に `b` が加わったコピーを作成します。 | ||
|
||
@include [figure.html source="../images/appended.svg" desc="関数 appended の図"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
--- | ||
name: appendedAll | ||
--- | ||
|
||
# `appendedAll` | ||
|
||
@include [signatures/appendedAll.md] | ||
|
||
`appendedAll` は、このコレクションの末尾にコレクション `bs` が加わったコピーを作成します。 | ||
|
||
@include [figure.html source="../images/appendedAll.svg" desc="関数 appendedAll の図"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
--- | ||
name: chain | ||
--- | ||
|
||
# `chain` | ||
|
||
@include [signatures/chain.md] | ||
|
||
`chain` は匿名関数を作成します。その関数は、受け取った値をコレクション `fs` に含まれるすべての関数を順々に摘要した結果を返します。 | ||
|
||
@include [figure.html source="../images/chain.svg" desc="関数 chain の図"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
--- | ||
name: collect | ||
--- | ||
|
||
# `collect` | ||
|
||
@include [signatures/collect.md] | ||
|
||
`collect` は、部分関数 `f` が定義された要素に `f` を適用し、それ以外の要素を捨てて、結果を要素とするコレクションを作成します。 | ||
|
||
@include [figure.html source="../images/collect.svg" desc="関数 collect の図"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
--- | ||
name: collectFirst | ||
--- | ||
|
||
# `collectFirst` | ||
|
||
@include [signatures/collectFirst.md] | ||
|
||
`collectFirst` は、このコレクション内で部分関数 `f` が定義された最初の要素に適用し、その結果を `Some` で包んで返します。 | ||
|
||
@include [figure.html source="../images/collectFirst.svg" desc="関数 collectFirst の図: 適用できる要素がある場合"] | ||
|
||
もし部分関数 `f` がこのコレクション内のどの要素にも定義されていなければ、`None` を返します。 | ||
|
||
@include [figure.html source="../images/collectFirst.2.svg" desc="関数 collectFirst の図: 適用できる要素がない場合"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
--- | ||
name: combinations | ||
--- | ||
|
||
# `combinations` | ||
|
||
@include [signatures/combinations.md] | ||
|
||
`combinations` は、このコレクションに含まれる要素から `k` 個取り出したありえる組み合わせをすべて計算し、それらを列挙する `Iterator` を返します。 | ||
|
||
@include [figure.html source="../images/combinations.svg" desc="関数 combinations の図"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
--- | ||
name: compose | ||
--- | ||
|
||
# `compose` | ||
|
||
@include [signatures/compose.md] | ||
|
||
`compose` は匿名関数を作成します。その関数は、受け取った値に `g` を適用し、次にその値にこの関数を適用した結果を返します。 | ||
これは [`andThen`](./andThen) の逆です。 | ||
|
||
@include [figure.html source="../images/compose.svg" desc="関数 compose の図"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
--- | ||
name: concat | ||
--- | ||
|
||
# `concat` | ||
|
||
@include [signatures/concat.md] | ||
|
||
`concat` は、任意の数のコレクションを受け取り、それらの要素を使って1つのコレクションを作成します。 | ||
|
||
@include [figure.html source="../images/concat.svg" desc="関数 concat の図"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
--- | ||
name: const | ||
--- | ||
|
||
# `const` | ||
|
||
@include [signatures/const.md] | ||
|
||
`const` は、値 `x` を受け取って、いかなる入力値 `y` に対してもその値 `x` を返す匿名関数を作成します。 | ||
|
||
@include [figure.html source="../images/const.svg" desc="関数 const の図"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
--- | ||
name: contains | ||
--- | ||
|
||
# `contains` | ||
|
||
@include [signatures/contains.md] | ||
|
||
`contains` は、与えられた値 `g` と等しい(`==`)要素がこのコレクションに少なくとも1つあるかを調べ、もしそうであれば `true` を返します。 | ||
|
||
@include [figure.html source="../images/contains.svg" desc="関数 contains の図: 等しい要素がある場合"] | ||
|
||
もしその値に等しい要素がなければ、`contains` は `false` を返します。 | ||
|
||
@include [figure.html source="../images/contains.2.svg" desc="関数 contains の図: 等しい要素がない場合"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
--- | ||
name: containsSlice | ||
--- | ||
|
||
# `containsSlice` | ||
|
||
@include [signatures/containsSlice.md] | ||
|
||
`containsSlice`は、与えられたコレクション `as` がこのコレクションの部分であるかを調べ、もしそうであれば `true` を返します。 | ||
|
||
@include [figure.html source="../images/containsSlice.svg" desc="関数 containsSlice の図"] | ||
|
||
もしコレクション `as` がこのコレクションの部分として見つからなければ、`containsSlice` は `false` を返します。 | ||
|
||
@include [figure.html source="../images/containsSlice.2.svg" desc="関数 containsSlice の図"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
--- | ||
name: corresponds | ||
--- | ||
|
||
# `corresponds` | ||
|
||
@include [signatures/corresponds.md] | ||
|
||
`corresponds` は、このコレクションとコレクション `bs` の同じ添字のペアごとに述語 `p` が満たされるか調べ、もしそうであれば `true` を返します。 | ||
|
||
@include [figure.html source="../images/corresponds.svg" desc="関数 corresponds の図"] | ||
|
||
もし `p` を満足しない要素のペアまたはペアにならない要素が1つでもあれば、この関数は `false` を返します。 | ||
|
||
@include [figure.html source="../images/corresponds.2.svg" desc="関数 corresponds の図"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
--- | ||
name: count | ||
--- | ||
|
||
# `count` | ||
|
||
@include [signatures/count.md] | ||
|
||
`count` は、述語 `p` を満たす要素がこのコレクションに何個あるかを割り出します。 | ||
|
||
@include [figure.html source="../images/count.svg" desc="関数 count の図"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
--- | ||
name: curried | ||
--- | ||
|
||
# `curried` | ||
|
||
@include [signatures/curried.md] | ||
|
||
`curried` は、元の関数の1つ目のパラメーターを処理して残りの引数を取る関数を作成します。続いてその関数は、元の関数の2つ目のパラメーターを処理して残りの引数を取る関数を作成します。…というのが、すべてのパラメーターがなくなるまで続き、最終的な結果が計算されます。 | ||
|
||
@include [figure.html source="../images/curried.svg" desc="関数 curried の図"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
--- | ||
name: diff | ||
--- | ||
|
||
# `diff` | ||
|
||
@include [signatures/diff.md] | ||
|
||
`diff` は、このコレクションとコレクション `as` の重複を許す差集合を計算します。 | ||
|
||
@include [figure.html source="../images/diff.svg" desc="関数 diff の図"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
--- | ||
name: distinct | ||
--- | ||
|
||
# `distinct` | ||
|
||
@include [signatures/distinct.md] | ||
|
||
`distinct` は、このコレクションから重複する要素を除いたコピーを作成します。 | ||
|
||
@include [figure.html source="../images/distinct.svg" desc="関数 distinct の図"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
--- | ||
name: distinctBy | ||
--- | ||
|
||
# `distinctBy` | ||
|
||
@include [signatures/distinctBy.md] | ||
|
||
`distinctBy` は、このコレクションのコピーを作成しますが、関数 `f` を適用した結果が同じになる要素のうち1つだけを残します。 | ||
|
||
@include [figure.html source="../images/distinctBy.svg" desc="関数 distinctBy の図"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
--- | ||
name: drop | ||
--- | ||
|
||
# `drop` | ||
|
||
@include [signatures/drop.md] | ||
|
||
`drop` は、このコレクションの先頭 `i` 個を捨てて、残りを保持するコレクションを作成します。 | ||
|
||
@include [figure.html source="../images/drop.svg" desc="関数 drop の図"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
--- | ||
name: dropRight | ||
--- | ||
|
||
# `dropRight` | ||
|
||
@include [signatures/dropRight.md] | ||
|
||
`dropRight` は、このコレクションの最後の `i` 件を捨てて、残りを保持するコレクションを作成します。 | ||
|
||
@include [figure.html source="../images/dropRight.svg" desc="関数 dropRight の図"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
--- | ||
name: dropWhile | ||
--- | ||
|
||
# `dropWhile` | ||
|
||
@include [signatures/dropWhile.md] | ||
|
||
`dropWhile` は、先頭から始めて要素が述語 `p` を満たす間は捨て続けて、残りを保持したコレクションを作成します。 | ||
|
||
@include [figure.html source="../images/dropWhile.svg" desc="関数 dropWhile の図"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
--- | ||
name: empty | ||
--- | ||
|
||
# `empty` | ||
|
||
@include [signatures/empty.md] | ||
|
||
`empty` は、型 `A` の要素を含めるコレクションを要素なしで作成します。 | ||
|
||
@include [figure.html source="../images/empty.svg" desc="関数 empty の図"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
--- | ||
name: endsWith | ||
--- | ||
|
||
# `endsWith` | ||
|
||
@include [signatures/endsWith.md] | ||
|
||
`endsWith` は、コレクション `as` がこのコレクションの末尾と一致するかを調べ、もしそうであれば `true` を返します。 | ||
|
||
@include [figure.html source="../images/endsWith.svg" desc="関数 endsWith の図: 末尾である場合"] | ||
|
||
もし `as` がこのコレクションの末尾と一致しなければ、この関数は `false` を返します。 | ||
|
||
@include [figure.html source="../images/endsWith.2.svg" desc="関数 endsWith の図: 末尾でない場合"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
--- | ||
name: fill | ||
--- | ||
|
||
# `fill` | ||
|
||
@include [signatures/fill.md] | ||
|
||
`fill` は、何らかの計算 `a` の結果を含む n 次元のコレクションを作成します。 | ||
|
||
@include [figure.html source="../images/fill.svg" desc="関数 fill の図"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
--- | ||
name: filter | ||
--- | ||
|
||
# `filter` | ||
|
||
@include [signatures/filter.md] | ||
|
||
`filter` は、このコレクションの要素で述語 `p` を満たすものを残し、残りを捨てたコレクションを作成します。 | ||
|
||
@include [figure.html source="../images/filter.svg" desc="関数 filter の図"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
--- | ||
name: filterKeys | ||
--- | ||
|
||
# `filterKeys` | ||
|
||
@include [signatures/filterKeys.md] | ||
|
||
`filterKeys` は、キーが述語 `p` を満たすキーと値のペアを残し、残りを捨てた `Map` を作成します。 | ||
|
||
@include [figure.html source="../images/filterKeys.svg" desc="関数 filterKeys の図"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
--- | ||
name: filterNot | ||
--- | ||
|
||
# `filterNot` | ||
|
||
@include [signatures/filterNot.md] | ||
|
||
`filter` は、このコレクションの要素で述語 `p` を満たさないものを残し、残りを捨てたコレクションを作成します。 | ||
|
||
@include [figure.html source="../images/filterNot.svg" desc="関数 filterNot の図"] |
Oops, something went wrong.