<div dir="ltr">neat! Thanks for sharing. Seems like it'll be handy for sanity checking physics ideas before writing the fancy realizations</div><div class="gmail_extra"><br><br><div class="gmail_quote">On Tue, Mar 11, 2014 at 12:30 PM, Tom Hawkins <span dir="ltr"><<a href="mailto:tomahawkins@gmail.com" target="_blank">tomahawkins@gmail.com</a>></span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><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" target="_blank">http://hackage.haskell.org/package/engineering-units</a><br>


</div><div><br></div></div>
<br>_______________________________________________<br>
Haskell-Cafe mailing list<br>
<a href="mailto:Haskell-Cafe@haskell.org">Haskell-Cafe@haskell.org</a><br>
<a href="http://www.haskell.org/mailman/listinfo/haskell-cafe" target="_blank">http://www.haskell.org/mailman/listinfo/haskell-cafe</a><br>
<br></blockquote></div><br></div>