Last active
December 16, 2015 22:29
-
-
Save voluntas/5507279 to your computer and use it in GitHub Desktop.
Revisions
-
voluntas revised this gist
May 3, 2013 . 1 changed file with 2 additions and 2 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 charactersOriginal file line number Diff line number Diff line change @@ -2,8 +2,8 @@ lists:filtermap/2 コトハジメ ========================== :更新: 2013-05-03 :バージョン: 0.0.1 :作者: @voluntas :URL: http://voluntas.github.io/ -
voluntas revised this gist
May 3, 2013 . 1 changed file with 10 additions and 2 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 charactersOriginal file line number Diff line number Diff line change @@ -2,13 +2,21 @@ lists:filtermap/2 コトハジメ ========================== :更新: 2013-04-16 :バージョン: 0.0.2 :作者: @voluntas :URL: http://voluntas.github.io/ 概要 ==== :hash: https://github.com/erlang/otp/commit/3ac04f901ecfb3fed128759964ccc54fa4ee7b2a R16B01 から非ドキュメントだった lists:zf/2 が lists:filtermap2/ として入るみたいです。 たまーに使いたくなる関数なのですが、非ドキュメントだったりして使うのを躊躇していたのですが今後は積極的に使えそうです。 .. note:: もちろん R16B01 でも zf/2 は残りますが filtermap/2 として使うことをお勧めします。 lists:zf/2 ========== -
voluntas revised this gist
May 3, 2013 . 1 changed file with 2 additions and 1 deletion.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 charactersOriginal file line number Diff line number Diff line change @@ -13,13 +13,14 @@ R16B01 から非ドキュメントだった lists:zf/2 が lists:filtermap2/ と lists:zf/2 ========== 戻り値として true または false または {true, any()} を返すことでリストに入る値を変更できます。 - true の場合はそのままもらった値 - false の場合はスキップ - {true, any()} の場合は any() の値 サンプル ------- .. code-block:: erlang -
voluntas revised this gist
May 3, 2013 . 1 changed file with 3 additions and 3 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 charactersOriginal file line number Diff line number Diff line change @@ -1,6 +1,6 @@ ========================== lists:filtermap/2 コトハジメ ========================== :hash: https://github.com/erlang/otp/commit/3ac04f901ecfb3fed128759964ccc54fa4ee7b2a -
voluntas revised this gist
May 3, 2013 . 1 changed file with 3 additions and 3 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 charactersOriginal file line number Diff line number Diff line change @@ -1,6 +1,6 @@ ========================= lists:filtermap/2 のススメ ========================= :hash: https://github.com/erlang/otp/commit/3ac04f901ecfb3fed128759964ccc54fa4ee7b2a -
voluntas revised this gist
May 3, 2013 . 1 changed file with 11 additions and 3 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 charactersOriginal file line number Diff line number Diff line change @@ -1,9 +1,17 @@ ================== lists:zf/2 のススメ ================== :hash: https://github.com/erlang/otp/commit/3ac04f901ecfb3fed128759964ccc54fa4ee7b2a 概要 ==== R16B01 から非ドキュメントだった lists:zf/2 が lists:filtermap2/ として入るみたいです。 もちろん R16B01 でも zf/2 は残りますが filtermap/2 として使うことをお勧めします。 lists:zf/2 ========== true または false または {true, any()} を返します。 -
voluntas revised this gist
May 3, 2013 . 1 changed file with 2 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 charactersOriginal file line number Diff line number Diff line change @@ -1,6 +1,8 @@ lists:zf/2 のメモ ================ :hash: https://github.com/erlang/otp/commit/3ac04f901ecfb3fed128759964ccc54fa4ee7b2a R16B01 でも zf/2 は残りますが filtermap/2 として使うのがよろしいかと。 true または false または {true, any()} を返します。 -
voluntas revised this gist
May 3, 2013 . 1 changed file with 2 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 charactersOriginal file line number Diff line number Diff line change @@ -1,6 +1,8 @@ lists:zf/2 のメモ ================ R16B01 でも zf/2 は残りますが filtermap/2 として使うのがよろしいかと。 true または false または {true, any()} を返します。 - true の場合はそのままもらった値 -
voluntas revised this gist
May 3, 2013 . 1 changed file with 3 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 charactersOriginal file line number Diff line number Diff line change @@ -1,3 +1,6 @@ lists:zf/2 のメモ ================ true または false または {true, any()} を返します。 - true の場合はそのままもらった値 -
voluntas created this gist
May 3, 2013 .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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,22 @@ true または false または {true, any()} を返します。 - true の場合はそのままもらった値 - false の場合はスキップ - {true, any()} の場合は any() の値 サンプル .. code-block:: erlang 3> F = fun(N) -> 3> case N of 3> 1 -> 3> true; 3> 3 -> 3> false; 3> _ -> 3> {true, 10} 3> end 3> end, 3> lists:zf(F, [1,2,3,4,5]). [1,10,10,10]