Search Results

Search found 3 results on 1 pages for 'oldrich svec'.

Page 1/1 | 1 

  • Pattern Matching of Units of Measure in F#

    - by Oldrich Svec
    This function: let convert (v: float<_>) = match v with | :? float<m> -> v / 0.1<m> | :? float<m/s> -> v / 0.2<m/s> | _ -> failwith "unknown" produces an error The type 'float<'u>' does not have any proper subtypes and cannot be used as the source of a type test or runtime coercion. Is there any way how to pattern match units of measure?

    Read the article

1