I need to think a bit about how to reply to this, but I wanted to say thanks - that's a really informative response, and I look forward to checking out those links. "try[ing] to allow fancy types in ways that allow the fanciness to be completely localised -- that is, you have additional explicit type signatures only on those values whose types are fancy" sounds like the best solution - if you're doing serious type hackery you probably won't mind too much about having to put the odd type signature in.
Have you read Alexandrescu's Modern C++ Design (http://www.amazon.com/Modern-C%2B%2B-Design-Programming-Patterns/dp/0201704315/sr=8-1/qid=1169935681/ref=pd_bbs_sr_1/102-8745197-6163322?ie=UTF8&s=books)? It's about some of the extremely cool things you can do with template metaprogramming - dimension checking of physical units, compile-time assertions, all sorts. Highly recommended.
Re: Types
I need to think a bit about how to reply to this, but I wanted to say thanks - that's a really informative response, and I look forward to checking out those links. "try[ing] to allow fancy types in ways that allow the fanciness to be completely localised -- that is, you have additional explicit type signatures only on those values whose types are fancy" sounds like the best solution - if you're doing serious type hackery you probably won't mind too much about having to put the odd type signature in.
Have you read Alexandrescu's Modern C++ Design (http://www.amazon.com/Modern-C%2B%2B-Design-Programming-Patterns/dp/0201704315/sr=8-1/qid=1169935681/ref=pd_bbs_sr_1/102-8745197-6163322?ie=UTF8&s=books)? It's about some of the extremely cool things you can do with template metaprogramming - dimension checking of physical units, compile-time assertions, all sorts. Highly recommended.