#4459: Polymorphic Data.Dynamic
-----------------------------------------------------+----------------------
Reporter: vivian | Owner:
Type: feature request | Status: new
Priority: normal | Milestone:
Component: GHC API | Version: 7.1
Keywords: polymorphic, dynamic, class, linking | Testcase:
Blockedby: | Difficulty:
Os: Unknown/Multiple | Blocking:
Architecture: Unknown/Multiple | Failure:
None/Unknown
-----------------------------------------------------+----------------------
Description changed by igloo:
Old description:
> At some point in the compilation process an expression acquires a fully-
> specified, possibly polymorphic, type. If we add an operation that join
> that type and that expresssion, say `TypedAny`, then we can implement the
> part of #4316 requested by mitar.
>
> In GHCi we can evaluate `HValue`s '''and also''' string them together
> with `bind` statements.
>
> The function
> {{{
> applyDynamic :: TypedAny -> TypedAny -> Maybe TypedAny
> }}}
> includes in its implementation a dictionary lookup and possible dynamic
> object linking for class methods.
>
> the function
> {{{
> fromDynamic :: TypedAny -> Maybe a
> }}}
> like `applyDynamic`, runs the typechecker at runtime to unify (and
> possibly link) the dynamic type (TypedAny) and the static type (a).
>
> ''Conjecture '' Since we already have `typecase` (classes), with type
> families, this feature provides/simulates dependent types.
New description:
At some point in the compilation process an expression acquires a fully-
specified, possibly polymorphic, type. If we add an operation that join
that type and that expresssion, say `TypedAny`, then we can implement the
part of #4316 requested by mitar.
In GHCi we can evaluate `HValue`s '''and also''' string them together with
`bind` statements.
The function
{{{
applyDynamic :: TypedAny -> TypedAny -> Maybe TypedAny
}}}
includes in its implementation a dictionary lookup and possible dynamic
object linking for class methods.
the function
{{{
fromDynamic :: TypedAny -> Maybe a
}}}
like `applyDynamic`, runs the typechecker at runtime to unify (and
possibly link) the dynamic type (!TypedAny) and the static type (a).
''Conjecture '' Since we already have `typecase` (classes), with type
families, this feature provides/simulates dependent types.
--
--
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/4459#comment:1>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
_______________________________________________
Glasgow-haskell-bugs mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs