<br><font size=2 face="sans-serif">Hello,</font>
<br>
<br><tt><font size=2>> Thanks a lot, this helps a bit, but access to
function bodies is exactly<br>
> what I need. Or being more precise, I need the functionality of ghci's<br>
> command ':t'. So functions that behave as follows, where everything
is<br>
> of course meta-represented in some way as ADT:<br>
> <br>
> Prelude Data.Typeable> typeOf (\a -> (Just
(a:"")))<br>
> (\a -> (Just (a:""))) :: Char -> Maybe
[Char]<br>
> <br>
> Prelude Data.Typeable> getDomain $ typeOf (\a ->
(Just (a:"")))<br>
> [Char]<br>
> <br>
> Prelude Data.Typeable>getCodomain $ typeOf (\a ->
(Just (a:"")))<br>
> (Maybe [Char])<br>
> </font></tt>
<br><tt><font size=2>Data.Typeable should allow for all of the previous.</font></tt>
<br><tt><font size=2><br>
> Prelude Data.Typeable>getTypeConstructors (Maybe [Char])<br>
> [ (Just) :: [Char] -> Maybe [Char]<br>
> , (Nothing) :: Maybe [Char]<br>
> ]<br>
> <br>
> Prelude Data.Typeable>getTypeConstructors [Char]<br>
> [ (:) :: Char -> [Char] -> [Char]<br>
> , ([]) :: [Char]<br>
> ]<br>
> </font></tt>
<br><tt><font size=2>Data.Generics allows you to do this (to a certain
extent), i.e. there is a function </font></tt>
<br>
<br><tt><font size=2> dataTypeConstrs :: DataType -> [Constr]</font></tt>
<br><tt><font size=2><br>
-Jeff</font></tt>
<br>
<br>
<span style="font-family:'Arial',sans-serif; font-size:8pt; color:#000000">---<br>
<br>
This e-mail may contain confidential and/or privileged information. If you <br>
are not the intended recipient (or have received this e-mail in error) <br>
please notify the sender immediately and destroy this e-mail. Any <br>
unauthorized copying, disclosure or distribution of the material in this <br>
e-mail is strictly forbidden.</span>