<div dir="ltr">Hi,<div><br></div><div>I just uploaded a handy library for managing engineering units.  It provides a Num type that allows you to mix units into calculations.  It also converts between units automatically and will error out if you try to mix values with inconsistent units.</div>
<div><br></div><div>Here's an example that computes the horsepower of a hydraulic pump (power = pressure * flow):</div><div><br></div><div>  flow = 20 * gpm            -- Gallons per minute.</div><div>  pressure = 3000 * psi  -- Pounds per square inch.</div>
<div>  power = pressure * flow</div><div><br></div><div>  powerHP = value power hp     -- Get the value in horsepower.</div><div>  powerKW = value power kw    -- Get the value in Kilowatts.</div><div><br></div><div>If you don't see your units in the library, it's easy to add new ones:</div>
<div><br></div><div>  mm :: Value</div><div>  mm = 0.001 * m</div><div><br></div><div>Wish I had this back in college.</div><div><br></div><div>-Tom</div><div><br></div><div><a href="http://hackage.haskell.org/package/engineering-units">http://hackage.haskell.org/package/engineering-units</a><br>
</div><div><br></div></div>