Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

Compatibility: unary negation of 0.0 loses negative zero versus purs

クローズ
#614 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

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

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
48/100
issue の種類
ドキュメント
明瞭さ
おおむね明確
活発さ
活発
技術スタック
node.js, rust

調査の方向性

Start by reviewing PR #474 and the reported unary-negation lowering and constant-folding behavior. Run the standalone Spago reproducer to compare signed-zero results between purs and Iris. Done means documenting the chosen compatibility contract and adding the small regression test if deliberate divergence is retained.

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

説明

This is a documented runtime divergence, not yet a compiler-bug claim. With purs 0.15.15, Iris 0.1.1, Node 22.16.0 and registry set 81.1.0, a valid Number expression involving (-0.0) differs after unary negation is lowered. The signed-zero choice appears intentional in merged PR #474, which emits 0 - value and folds the negative-zero literal to positive zero. This issue asks that the compatibility contract be decided/documented, rather than presupposing the implementation must be changed.

Standalone observation (a fresh Spago package with prelude, effect, console, and argonaut-core dependencies; workspace.packageSet.registry: 81.1.0):

module Main where

import Prelude
import Data.Argonaut.Core as J
import Effect (Effect)
import Effect.Console (log)

main :: Effect Unit
main = log (show (map (1.0 / _) (J.toNumber (J.fromNumber (-0.0)))))

Purs prints (Just -Infinity); Iris 0.1.1 prints (Just Infinity). This is not JSON serialization: JSON.stringify(-0) is "0" on either side. In the generated caller, purs passes -0.0 to fromNumber, whereas Iris passes 0; both package paths use the same identity fromNumber FFI. The reciprocal merely exposes the zero sign observably.

The outcome may be an intentional interpretation of PureScript numeric negation rather than an Iris defect. What observable signed-zero behavior should Iris promise relative to purs for unary negation and constant folding? If deliberate divergence is supported, documenting it with a small regression test would let downstream users reason about it. No private repository link or fixture is required for the reproducer.

主要言語
Rust
スター
117
フォーク
11
平均マージ
4時間 22分
マージ済み PR(30日)
126

環境構築

はじめの一歩

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

purefunctor/purescript-iris のほかの issue

purefunctor/purescript-iris の issue をすべて見る

似ている issue

Rust の issue をもっと見る

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

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