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