Re: Contexts in Existential Types
14 Mar
2001
14 Mar
'01
4:21 a.m.
At 2001-03-13 19:36, I wrote:
Would it be appropriate for Haskell to be able to remember contexts in existential types? For instance, currently this does not work in Hugs:
-- class Charable a where obtainChar :: a -> Char
instance Charable Char where obtainChar c = c
data AnyCharable = forall c. (Charable c) => MkAnyCharable c
anyA = MkAnyCharable 'a' recoverA = obtainChar ((\(MkAnyCharable c) -> c) anyA) --
Whoops, my error. It is possible to do this: -- recoverA = (\(MkAnyCharable c) -> obtainChar c) anyA -- Sorry... -- Ashley Yakeley, Seattle WA
9298
Age (days ago)
9298
Last active (days ago)
0 comments
1 participants
participants (1)
-
Ashley Yakeley