| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
Data.Registry.Internal.Reflection
Description
Utility functions to display or manipulate types
Synopsis
- isFunction :: SomeTypeRep -> Bool
- showFullValueType :: Typeable a => a -> Text
- showFullFunctionType :: Typeable a => a -> ([Text], Text)
- showTheFullValueType :: forall (r1 :: RuntimeRep) (arg :: TYPE r1). TypeRep arg -> Text
- showTheFullFunctionType :: forall (r1 :: RuntimeRep) (arg :: TYPE r1). TypeRep arg -> ([Text], Text)
- showNested :: SomeTypeRep -> SomeTypeRep -> Text
- showSingleType :: SomeTypeRep -> Text
- mustShowModuleName :: Text -> Bool
- tweakNested :: Text -> Text
- parenthesizeNested :: Text -> Text
- showWithModuleName :: SomeTypeRep -> Text
Documentation
isFunction :: SomeTypeRep -> Bool #
Return true if the type of this type rep represents a function
showFullValueType :: Typeable a => a -> Text #
Show the full type of a typeable value
showFullFunctionType :: Typeable a => a -> ([Text], Text) #
Show the full type of a typeable function
showTheFullValueType :: forall (r1 :: RuntimeRep) (arg :: TYPE r1). TypeRep arg -> Text #
Show the full type of a typeable value
where nested types like IO[Int] or functions are represented and
non GHC types are shown with their module names
showTheFullFunctionType :: forall (r1 :: RuntimeRep) (arg :: TYPE r1). TypeRep arg -> ([Text], Text) #
Show the full type of a typeable value where nested types like IO[Int] or functions are represented and non GHC types are shown with their module names
showNested :: SomeTypeRep -> SomeTypeRep -> Text #
Show a type like m a
showSingleType :: SomeTypeRep -> Text #
Show a single type. Don't display the module for GHC types
mustShowModuleName :: Text -> Bool #
Return true if the module name can be shown
tweakNested :: Text -> Text #
Tweak some standard module names for better display
parenthesizeNested :: Text -> Text #
This is an attempt to better render "nested" types like IO (Maybe Text)
The input value is "IO Maybe Text" and the output text will be "IO (Maybe Text)"
This will unfortunately not work with types having several type parameters
like IO (Either Text Int)
showWithModuleName :: SomeTypeRep -> Text #
Show a type with its module name