[Haskell-cafe] Can Haskell enforce the dimension?
bulat.ziganshin at gmail.com
Fri Apr 9 12:43:46 EDT 2010
Friday, April 9, 2010, 8:28:23 PM, you wrote:
> In C++, template can be used to enforce the dimension. For example,
> F=m*a is OK and F=m*t will issue a compile time error.
> Is there a way to do this in Haskell?
yes. but standard * operation has type t->t->t. so you need either to
use other operation or don't import standard Num class
Bulat mailto:Bulat.Ziganshin at gmail.com
More information about the Haskell-Cafe