私は次のことを書きました
[<Measure>]
type m
[<Measure>]
type s
[<Measure>]
type v = m/s
type Vector3<[<Measure>] 'a> =
{
X : float<'a>
Y : float<'a>
Z : float<'a>
}
static member (*)
(v:Vector3<'a>,f:float<'b>):Vector3<'a*'b> =
{ X = v.X*f; Y = v.Y*f ; Z = v.Z * f}
今、私はこのように使用しようとしています:
let next_pos (position:Vector3<m> , velocity: Vector3<m/s> ,dt : float<s> -> Vector3<m>) =
position + (velocity * dt)
コンパイルエラーが発生しますが、測定単位が正しく表現されていると確信しています。私の間違いは何ですか?