R – Good information about type systems based on contracts/constraints

constraints, contract, language-theory, programming-languages, types

Problem:

I am looking for good introduction about type systems,
which are based on contracts/constraints
(sorry, I don't remember which term one is appropriate for a type system).

I need that information to be able to implement an experimental type system of such kind.

As far as I know, such type system is used in XSD (Xml Schema Definition).

Instead of defining a data type, one defines constraints on the set of possible values.

Example:

I define some method with a parameter, which is either "nothing", or matches the integral range [0..100].

Such method would accept following values:

"nothing"01...100

I hope, I could make my self clear.

Best Solution

You can have a look at languages like Haskell, or even Agda. Also, Oleg has lots of great resources.