Juxt
まだ誰も着手していません。
評価
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 初心者へのやさしさ
- 38/100
- issue の種類
- 機能追加
- 明瞭さ
- おおむね明確
- 活発さ
- 停滞
- 技術スタック
- fsharp
- 領域
- tooling
調査の方向性
Operators モジュールから始め、既存の sequence、item、uncurry、uncurryN 関数を調べて、それらの命名と構成に合わせます。提案されている juxt2、juxt3、juxt4 のバリアントを実装し、その後タプルを生成する例のカバレッジを追加して、プロジェクトのテストが通ることを確認します。
索引モデルが issue の本文から書いたものです。
説明
Hello and thank you for creating F#+! I'd like to propose adding juxtapose functions to the Operators module. These functions are defined as follows:
let juxt2 f g x = f x, g x
let juxt3 f g h x = f x, g x, h x
let juxt4 f g h i x = f x, g x, h x, i x
// etc
This function is called juxt in Clojure and the Python toolz library. I believe this function was first introduced by John Backus in his paper called Can programming be liberated from the von Neumann style? where it was called construction.
In Haskell and F#+ there's a similar function called sequence. Unfortunately, it returns a list and not a tuple, forcing all the result types to be the same.
juxt in combination with item and uncurry/uncurryN make point-free programming with tuples easier. Here are some examples:
open FSharpPlus
// Basic examples
let square: float -> float =
juxt2 id id >> uncurry ( * )
let avg: list<float> -> float =
juxt2 List.sum (List.length >> float) >> uncurry (/)
// Grouping and ungrouping tuples
let ``(a,b),c`` (a,b,c) = (a,b),c
let ``~(a,b),c~`` ((a,b),c) = a,b,c
``(a,b),c``(1,2,3) = (juxt2 (juxt2 item1 item2) item3)(1,2,3) // ((1, 2), 3)
``~(a,b),c~``((1,2),3) = (juxt3 (item1 >> item1) (item1 >> item2) item2)((1,2),3) // (1, 2, 3)
Please let me know if this function already exists in F#+ (or F# for that matter) and I missed it. Thank you!
- 主要言語
- F#
- スター
- 941
- フォーク
- 106
- PR マージ指標
- 30日以内にマージされた PR はありません
コントリビューションガイド
このリポジトリのコントリビューションガイドは索引されていません
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
fsprojects/FSharpPlus のほかの issue
-
難易度 5/5 1週間以上 初心者へのやさしさ 35/100
fsprojects/FSharpPlus#683 · コメント 1 件 · リアクション 2 件 ·
-
bug
難易度 3/5 1〜2日 初心者へのやさしさ 35/100
fsprojects/FSharpPlus#678 ·
-
難易度 5/5 1週間以上 初心者へのやさしさ 35/100
fsprojects/FSharpPlus#644 ·
-
breaking change F#+ v2.0
難易度 4/5 3〜5日 初心者へのやさしさ 30/100
fsprojects/FSharpPlus#643 ·
-
lens type signature オープンbreaking change F#+ v2.0
難易度 3/5 1〜2日 初心者へのやさしさ 35/100
fsprojects/FSharpPlus#641 ·
fsprojects/FSharpPlus の issue をすべて見る
似ている issue
-
kaliscan.com オープンN: AdGuard for iOS P3: Medium T: Ads
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
AdguardTeam/AdguardFilters#242501 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
-
[BUG] createTool tools cannot be registered with Mastra when exactOptionalPropertyTypes is enabled オープンcustomer-eng status: needs triage
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
-
add-toolnames MCP Toolnames Toolnames checkup
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
rajbos/ai-engineering-fluency#2190 · コメント 3 件 ·
-
enhancement
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
gajus/eslint-plugin-jsdoc#1776 · リアクション 1 件 ·