Safe Haskell | Safe-Inferred |
---|---|
Language | GHC2021 |
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 :: TyCon -> Text
Documentation
isFunction :: SomeTypeRep -> Bool Source #
Return true if the type of this type rep represents a function
showFullValueType :: Typeable a => a -> Text Source #
Show the full type of a typeable value
showFullFunctionType :: Typeable a => a -> ([Text], Text) Source #
Show the full type of a typeable function
showTheFullValueType :: forall (r1 :: RuntimeRep) (arg :: TYPE r1). TypeRep arg -> Text Source #
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) Source #
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 Source #
Show a type like m a
showSingleType :: SomeTypeRep -> Text Source #
Show a single type. Don't display the module for GHC types
mustShowModuleName :: Text -> Bool Source #
Return true if the module name can be shown
tweakNested :: Text -> Text Source #
Tweak some standard module names for better display
parenthesizeNested :: Text -> Text Source #
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 :: TyCon -> Text Source #
Show a type constructor with its module name