>But if you dislike tuples you can use nested pairs, like
>
>  infixr 0 :.
>  data T a b = a :. b
>
>Now you can write
>
>  'a' :. True :. "Hello" :. ()
>
>which has type
>
>  T Char (T Bool (T String ()))
>
>But I guess that's not what you were after?
>
>    -- Lennart

Fergus replied:
> > [...] if you dislike tuples you can use nested pairs
>
> At the cost of losing a little type-safety.

Well, since no one else mentions it: It's fun to (try to) define some
functions over these ``heterogeneous lists''.

In which languages can you define, e.g., a length function?-)

Claus

PS. I've got a length function for ``heterogeneous lists'', as
    they appear in nested pairs, in Hugs. However, it uses the
    type system extensions available in 1.3c or in 1.4 [981111 BETA].
    How much can you do in plain Haskell??? in Cayenne?-)


Reply via email to