Hacker News new | ask | show | jobs
by zalzane 3973 days ago
>"a formula written on paper in pencil was improperly transcribed"

offtopic, but a unit type would have prevented that. i had no idea how many errors i was making in my math programs before i started using F#'s type checker to make sure all the types lined up properly.

1 comments

I don't know the actual transcription error, but how's it going to find a 5 being made a 6 or something?
it wont, but the vast majority of errors with math formulas are along the lines of adding velocities with positions, raising something to the wrong power, using a multiply instead of an add, putting a parenthesis in the wrong spot, performing equations in the wrong order, etc.

all of those can get caught with type checking, but it isn't perfect