origamitower / folktale

[not actively maintained!] A standard library for functional programming in JavaScript
https://folktale.origamitower.com/
MIT License
2.04k stars 102 forks source link

value of Maybe is shown as `null`, when in fact it isn't #191

Closed freder closed 6 years ago

freder commented 6 years ago

new folktale user here. ↓ this has caused some confusion for me while playing with the library:

Steps to reproduce

console.log(Maybe.of(Infinity));
console.log(Maybe.of(Infinity).unsafeGet());
console.log(Maybe.of(NaN));
console.log(Maybe.of(NaN).unsafeGet());

Expected behaviour

should print

folktale:Maybe.Just({ value: Infinity })
Infinity
folktale:Maybe.Just({ value: NaN })
NaN

Observed behaviour

prints

folktale:Maybe.Just({ value: null })
Infinity
folktale:Maybe.Just({ value: null })
NaN
robotlolita commented 6 years ago

I'm going to try releasing a new version with this fix this weekend.

robotlolita commented 6 years ago

This has been released as folktale@2.3.0.