Skip to content

Instantly share code, notes, and snippets.

@adacola
adacola / UnitsOfMeasure.fs
Last active December 31, 2015 22:59
F# Advent Calendar 21日目の記事で使用したコードです。 http://qiita.com/adacola/items/b65752b678e81bc8e354
// 単位の定義
[<Measure>] type m
[<Measure>] type s
[<Measure>] type kg
[<Measure>] type 歳
// 単位の別名
[<Measure>] type meter = m
// 組立単位は単位を組み合わせて定義します。単位 N は kg * m / (s * s) の別名扱いです。
[<Measure>] type N = kg * m / (s * s)