You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When I define a data type with an integer member, the show_xx function doesn't add parenthesis around a negative integer member, hence I can't just copy the output and paste into my code to construct an identical value (I use this functionality to write tests).
For example, I wrote
typea = Tofint [@@deriving show]
And invoke show_a (T (-20)), the output is (T -20).
By the way, I found Haskell's deriving Show handle negative integers correctly.
The text was updated successfully, but these errors were encountered:
When I define a data type with an integer member, the
show_xx
function doesn't add parenthesis around a negative integer member, hence I can't just copy the output and paste into my code to construct an identical value (I use this functionality to write tests).For example, I wrote
And invoke
show_a (T (-20))
, the output is(T -20)
.By the way, I found Haskell's
deriving Show
handle negative integers correctly.The text was updated successfully, but these errors were encountered: