Chris Angus wrote:
| and values could be requested from it a la...
|
| lookup :: a -> Name -> Maybe a
|
| Where the initial "a" is needed to make it all typesafe
I don't understand why this extra argument is needed.
| Reflect.lookup (bot::String -> IO Image) (makeFnName name)
If it is just to satisfy the type system, you could equally
well leave it out, because the type can be derived from the
way the result is used in the program.
This is the same problem as in the Dynamic typing extension
in Hugs:
type Dyn = ...
toDyn :: Typeable a => a -> Dyn
fromDyn :: Typeable a => Dyn -> Maybe a
(Where "Typeable a" is really there to make sure one does
not have a polymorphic use ...)
Or the same as a possible eval function:
eval :: Result a => String -> Maybe a
So the type of lookup could just be:
lookup :: Reflective a => Name -> Maybe a
Or maybe a more interesting type would be:
lookup :: Name -> Dyn
I like some of the ideas behind reflection, but I am not
sure if I like the exact way you propose this extension.
But I don't know enough about reflection to propose
something different.
Regards,
Koen.
--
Koen Claessen http://www.cs.chalmers.se/~koen
phone:+46-31-772 5424 e-mail:[EMAIL PROTECTED]
-----------------------------------------------------
Chalmers University of Technology, Gothenburg, Sweden