• 0 Posts
  • 24 Comments
Joined 11 months ago
cake
Cake day: July 24th, 2023

help-circle















  • What’s the problem with -0?
    It conceptually makes sense for to negativ values to close to 0 to be represented as -0.
    In practice I have never seen a problem with -0.

    On NaN: While its use cases can nowadays be replaced with language constructs like result types, it was created before exceptions or sum types. The way it propagates kind of mirrors Haskells monadic Maybe.
    We should be demanding more and better wrapper types from our language/standard library designers.




  • You can’t random-access an iterator and use it again later.

    If your specific use case really needs random access to a list while lazy computing the elements just wrap them in Lazy and put them in a vector.

    Can Rust compute the value of calling a function an infinite number of times?

    The return type of an infinitely recursive function / infinite loops is ⊥, a type that by definition has no values. (Known in rust as !)