Big problem with not big list

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

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

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
25/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
停滞
領域
backend

調査の方向性

The report includes a reproducer using Data.List.Lazy.iterate, take, and length, and points to src/Data/List/Lazy.purs near line 189 as a possible cause. Start by reproducing the stack overflow with the provided examples and inspect the lazy list implementation there. Done means the large iterate examples work without a stack overflow or the issue is clarified as expected behavior.

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

説明

status: needs more info

Hello everyone! I have some experiments with lazy list. But I have some problem.

module Main where

import Prelude (Unit, map, mod, show, ($), (*), (+), (/=), (<<<), (<=))
import Data.List.Lazy (all, filter, repeat, take, iterate, length, takeWhile, (:))
import Control.Monad.Eff (Eff)
import Control.Monad.Eff.Console (CONSOLE, log)
import Data.Lazy (defer, force)

main :: Eff (console::CONSOLE) Unit
main = do
  -- log <<< show <<< length <<< take 1000000 <<< map (_+10) <<< repeat $ 1 -- works
  -- log <<< show <<< length <<< take 10000000 <<< map (_+10) <<< repeat $ 1 -- hard
  -- log <<< show <<< length <<< take 100000000 <<< map (_+10) <<< repeat $ 1 -- oh my...
  -- log <<< show <<< length <<< take 100000 <<< iterate(_+1) $ 1 -- Maximum call stack size exceeded
  -- log <<< show <<< length <<< take 10000 <<< iterate(_+1) $ 1 -- Maximum call stack size exceeded
  log <<< show <<< length <<< take 1000 <<< iterate(_+1) $ 1 -- only this code works!!!

As u can see iterate has some strange behavior. I think this problem in map here https://github.com/purescript/purescript-lists/blob/master/src/Data/List/Lazy.purs#L189

Or maybe I don't know how use lazy list in purescript. If it is, please help me =)

主要言語
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 を短くまとめたダイジェスト。