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

John Meacham john at repetae.net
Mon Mar 7 18:23:09 EST 2005


On Mon, Mar 07, 2005 at 08:47:11PM +0100, 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).

It would be interesting if you could use the HList framework for
'partially typed lists' in that if your stack is an hlist, an operation
like plus would be
plus :: forall a. HList a => Int :*: Int :*: a -> Int :*: a

which says that plus goes from ANY Hlist starting with two ints and
returns that hlist with a single Int on it. basically you use a
universally quantified type to represent the unknown tail of the list
(everything else on the stack).

not sure if it works.. just brainstorming.... It seems very natural if
it could be made to work.

        John



-- 
John Meacham - ⑆repetae.net⑆john⑈ 


More information about the Haskell-Cafe mailing list