[Haskell-cafe] typeclass question
Jonathan Cast
jonathanccast at fastmail.fm
Thu Sep 11 12:03:33 EDT 2008
On Thu, 2008-09-11 at 13:23 +0200, Johannes Waldmann wrote:
> > Well, it's a library that others might use, so I would prefer to avoid
> > using language extensions, especially functional deps which I don't
> > understand, and which seem to have an uncertain future.
>
> I think there will be a storm of protest
> if support for this simple shape of dependencies ( ... | a -> b )
> would be dropped from the major Haskell implementations.
For backwards-compatibility reasons, or because you think they're better
than type families?
Personally, I am quite enthusiastic about type families, although that
is influenced by a (somewhat abandoned) project of mine that ended up
with a 3 parameter type class (5 for the sub-class created for
quickCheck support) with one-to-one relations every way. And multiple
`global' variables implemented with dynamic parameters (they would have
needed to be thread-local, eventually, anyway) with types parameterized
on the afore-mentioned 3 parameters plus two more to allow the choice
between ST and STM. When you get types like this:
-- | Wait for another thread to change the buffer contents.
displayWaitRedisplay :: (Buffer b d mk,
?currentBuffer :: BufferState b d mk STM
TVar,
?currentWindow :: Window b d mk c STM TVar)
=> b TVar -> STM ()
types like this:
-- | Wait for another thread to change the buffer contents.
displayWaitRedisplay :: (Buffer b, ?currentBuffer :: BufferState b STM,
?currentWindow :: Window b c STM)
=> b TVar -> STM ()
look like heaven.
jcc
More information about the Haskell-Cafe
mailing list