NonEmpty version of `span`

オープン
#163 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
28/100
issue の種類
機能追加
明瞭さ
おおむね明確
活発さ
停滞
領域
backend

調査の方向性

Start by reading the existing span implementation and its tests in the purescript-lists repository. The issue suggests preserving the non-empty result in the signature, or checking whether init is empty and reusing the original list; decide how this should fit the existing API before making a change. Done means the chosen behavior preserves non-emptiness and is covered by tests.

索引モデルが issue の本文から書いたものです。

説明

status: needs more info

Although a little unwieldy, the NonEmpty version of span should really have a signature like this, to preserve the non-emptyness (the current version loses it):

span :: forall a. 
  (a -> Boolean) -> 
  NonEmptyList a -> 
  Either { init :: List a, rest :: NonEmptyList a } { init :: NonEmptyList a, rest :: List a }

Or maybe it should be a new function?

Edit: Just realized it's probably just as easy to check whether init is empty and use the original list instead of rest in that case. I'll leave this here anyway

主要言語
PureScript
スター
61
フォーク
50
平均マージ
2日 6時間
マージ済み PR(30日)
1

環境構築

  • Dockerfile・Docker Compose ファイルなし
  • プルリクエストのテンプレートあり
  • コントリビューションガイドなし

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

purescript/purescript-lists のほかの issue

purescript/purescript-lists の issue をすべて見る

似ている issue

Backend & API Design の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。