[Haskell-cafe] Type trickery

Andrew Coppin andrewcoppin at btinternet.com
Wed Mar 16 13:05:56 CET 2011


> You could define a function:
>
> withContainer ∷ (∀ s. Container s → α) → α
>
> which creates a container, parameterizes it with an 's' that is only
> scoped over the continuation and applies the continuation to the
> created container.

Hmm, yes. That will work, but I wonder if there's some way of doing this 
that doesn't limit the scope of the container to one single span of code...



More information about the Haskell-Cafe mailing list