top | item 39971456

(no title)

simon04 | 1 year ago

Unfortunately typing doesn't fix this. The 2nd callback function argument of Array.map is (index:number), and the 2nd argument of Number.parseInt is (radix:number).

It's a very nasty issue to debug.

discuss

order

iso8859-1|1 year ago

If there were typing, there would be no reason to not use newtypes[0] for radix and index. These values should only be explicitly unwrapped to plain numbers.

It would look like this

    newtype Radix = Radix { radixToWord :: Word }
    newtype Index = Index { indexToWord :: Word }
[0]: https://wiki.haskell.org/Newtype