The reason it doesn't return an Int is that you might want an integral value outside the 32 bit range. Come to think of it we should probably add a version that does return Int to purescript-integers.
Number.toString might just be the Show Number instance. Not sure.
Ohh sorry, I didn't realise you wanted to specify the radix. I'm not aware of any library that has that, but we should definitely have it in core somewhere, IMO.
View all comments
Show parent comment
1
u/sharkdp Feb 09 '16
Thanks for the reference. Shouldn't this return an
Int?I've implemented this by using the FFI in the meantime (https://github.com/sharkdp/purescript-colors/blob/master/src/Color.js). Is there any way I could write
toHexwith existing library functions? That is, do we have Number.prototype.toString somewhere?