[Haskell-cafe] Joy Combinators (Occurs check: infinite type)

Keean Schupke k.schupke at imperial.ac.uk
Mon Mar 7 15:30:30 EST 2005


Daniel Fischer wrote:

>
>And, BTW, that's why Keean et al's HList library doesn't help here either, the 
>type of an HList determines the number of elements and the type of each, so 
>there we face the same problems as with nested tuples. What we need is 
>type Stack = [ArbitraryType] (from the HList paper, I surmise that [Dynamic] 
>would be possilble, but that seems to have it's own problems).
>
>  
>
Well it depends on what you want to do... If the types of elements are
determined by the computation then you can use an HList as is, and there
is no problem.

The only time there is a problem is if the _type_ of an element to be put
in an HList depends on an IO action. In this case you need to existentially
quanify the HList.

So you can use the HList in both cases, but you have to deal with 
existential
types if the type of the HList is dependant on IO (you dont have to do this
if only the value of an element depends on IO).

    Keean.


More information about the Haskell-Cafe mailing list