Skip to content

Instantly share code, notes, and snippets.

@philcleveland
Created November 15, 2014 17:25
Show Gist options
  • Save philcleveland/51f74e9285db941091ce to your computer and use it in GitHub Desktop.
Save philcleveland/51f74e9285db941091ce to your computer and use it in GitHub Desktop.
Problem get UOM to work in the srm_color method
//ounce
//gallon
[<Measure>] type gal
//lovibond
[<Measure>] type L
//pounds
[<Measure>] type lbs
//gc = grain color
//weight = grain weight in lbs
//vol = batch volume in gal
//(gc:float) (weight:float)
let mcu (arr:(float<L>*float<lbs>)[]) (vol:float<gal>) =
let total =
arr |>
Seq.map(fun x->
let gc, weight = x
gc*weight) |>
Seq.sum
total / vol
let srm_color mcu:float<L lbs/gal> =
1.4922 * (mcu**0.6859)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment