Closed nh2 closed 5 years ago
:rotating_light: :police_car: :rotating_light: This is the Haskell police :policeman: :stop_sign:
We have found some illegal code on your premises! :mag_right: :open_mouth: It is not law-abiding! :scroll: :point_left:
The code
rnf _ = ()
is always wrong for any instance!
Any request to evaluate to normal form must at least evaluate to weak head normal form.
Even worse in this case, the ForeignPtr inside the type is often created by unsafePerformIO, and you'd really expect that rnf enforces that.
ForeignPtr
unsafePerformIO
rnf
Whoops!
We probably thought it wasn't necessary to evaluate the ForeignPtr inside of the Mat because it is a newtype.
Mat
newtype
Whoops that was my stupid mistake.
:rotating_light: :police_car: :rotating_light: This is the Haskell police :policeman: :stop_sign:
We have found some illegal code on your premises! :mag_right: :open_mouth: It is not law-abiding! :scroll: :point_left:
The code
is always wrong for any instance!
Any request to evaluate to normal form must at least evaluate to weak head normal form.
Even worse in this case, the
ForeignPtr
inside the type is often created byunsafePerformIO
, and you'd really expect thatrnf
enforces that.