Hacktoberfest 2026: los issues que los mantenedores marcaron para octubre, abiertos y aptos para principiantes. Explorar issues de Hacktoberfest

Compatibility: unary negation of 0.0 loses negative zero versus purs

Cerrado
#614 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
4/5
Tiempo estimado
3-5 días
Aptitud para principiantes
48/100
Tipo de issue
Documentación
Claridad
Bastante claro
Estado de actividad
Activo
Stack tecnológico
node.js, rust

Línea de trabajo

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.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

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.

Lenguaje dominante
Rust
Estrellas
117
Forks
11
Merge medio
4 h 22 min
PR fusionados (30 d)
126

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de purefunctor/purescript-iris

Todos los issues de purefunctor/purescript-iris

Issues similares

Más issues de Rust

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.