Another typing question

Nick Name
Tue, 5 Aug 2003 15:22:08 +0200

On Tue, 5 Aug 2003 12:23:06 +0200
Konrad Hinsen <> wrote:

> 3
>  Is there any way to parametrize a type by a value, rather than
>  another type? What I would like to do is to define "list of length 3"
>  and "list of length 4" as separate parametrization of the same type,
>  such that I could write functions that accept lists (under my new
>  typename) of any length as long as parameters have the same length.
>  The goal is to remove the need for runtime checks all over the code.

This is called "dependent types" and is not a feature of haskell (nor of
any language that I know); there was "cayenne" (try a google search) but
I don't believe it is still mantained.

BTW, why is there no general interest for such a thing as dependent