haskell-gi-0.26.17: Generate Haskell bindings for GObject Introspection capable libraries

Safe Haskell | Safe-Inferred
Language | Haskell2010

Data.GI.CodeGen.Type

Description

An abstraction for representing type constructors. This is a very simplified version of `Typeable`, which we don't use directly to avoid compatibility headaches.

Synopsis

- data Type
  - = TBasicType BasicType
  - | TError
  - | TVariant
  - | TGValue
  - | TParamSpec
  - | TCArray Bool Int Int Type
  - | TGArray Type
  - | TPtrArray Type
  - | TByteArray
  - | TGList Type
  - | TGSList Type
  - | TGHash Type Type
  - | TGClosure (Maybe Type)
  - | TInterface Name
- data BasicType
  - = TBoolean
  - | TInt
  - | TUInt
  - | TLong
  - | TULong
  - | TInt8
  - | TUInt8
  - | TInt16
  - | TUInt16
  - | TInt32
  - | TUInt32
  - | TInt64
  - | TUInt64
  - | TFloat
  - | TDouble
  - | TUniChar
  - | TGType
  - | TUTF8
  - | TFileName
  - | TPtr
  - | TIntPtr
  - | TUIntPtr
  - | TShort
  - | TUShort
  - | TSize
  - | TSSize
  - | Ttime_t
  - | Toff_t
  - | Tdev_t
  - | Tgid_t
  - | Tpid_t
  - | Tsocklen_t
  - | Tuid_t
- data TypeRep
- con :: Text -> [TypeRep] -> TypeRep
- con0 :: Text -> TypeRep
- typeShow :: TypeRep -> Text
- typeConName :: TypeRep -> Text
- io :: TypeRep -> TypeRep
- ptr :: TypeRep -> TypeRep
- funptr :: TypeRep -> TypeRep
- maybeT :: TypeRep -> TypeRep

# Documentation

data Type Source #

This type represents the types found in GObject Introspection interfaces: the types of constants, arguments, etc.

Constructors

TBasicType BasicType |
TError | GError
TVariant | GVariant
TGValue | GValue
TParamSpec | GParamSpec
TCArray Bool Int Int Type | Zero terminated, Array Fixed Size, Array Length, Element Type
TGArray Type | GArray
TPtrArray Type | GPtrArray
TByteArray | GByteArray
TGList Type | GList
TGSList Type | GSList
TGHash Type Type | GHashTable
TGClosure (Maybe Type) | GClosure containing the given API (if known)
TInterface Name | A reference to some API in the GIR

#### Instances

Instances details

Show Type Source # |
Instance details Defined in Data.GI.GIR.BasicTypes Methods showsPrec :: Int -> Type -> ShowS Source # show :: Type -> String Source # showList :: [Type] -> ShowS Source #
Eq Type Source # |
Instance details Defined in Data.GI.GIR.BasicTypes Methods (==) :: Type -> Type -> Bool Source # (/=) :: Type -> Type -> Bool Source #
Ord Type Source # |
Instance details Defined in Data.GI.GIR.BasicTypes Methods compare :: Type -> Type -> Ordering Source # (<) :: Type -> Type -> Bool Source # (<=) :: Type -> Type -> Bool Source # (>) :: Type -> Type -> Bool Source # (>=) :: Type -> Type -> Bool Source # max :: Type -> Type -> Type Source # min :: Type -> Type -> Type Source #

data BasicType Source #

Basic types. These are generally trivial to marshal, and the GIR assumes that they are defined.

Constructors

TBoolean | gboolean
TInt | gint
TUInt | guint
TLong | glong
TULong | gulong
TInt8 | gint8
TUInt8 | guint8
TInt16 | gint16
TUInt16 | guint16
TInt32 | gint32
TUInt32 | guint32
TInt64 | gint64
TUInt64 | guint64
TFloat | gfloat
TDouble | gdouble
TUniChar | gunichar
TGType | GType
TUTF8 | gchar*, encoded as UTF-8
TFileName | gchar*, encoding a filename
TPtr | gpointer
TIntPtr | gintptr
TUIntPtr | guintptr
TShort | gshort
TUShort | gushort
TSize | gsize
TSSize | gssize
Ttime_t | time_t
Toff_t | off_t
Tdev_t | dev_t
Tgid_t | gid_t
Tpid_t | pid_t
Tsocklen_t | socklen_t
Tuid_t | uid_t

#### Instances

Instances details

Show BasicType Source # |
Instance details Defined in Data.GI.GIR.BasicTypes Methods showsPrec :: Int -> BasicType -> ShowS Source # show :: BasicType -> String Source # showList :: [BasicType] -> ShowS Source #
Eq BasicType Source # |
Instance details Defined in Data.GI.GIR.BasicTypes Methods (==) :: BasicType -> BasicType -> Bool Source # (/=) :: BasicType -> BasicType -> Bool Source #
Ord BasicType Source # |

Instance details

Defined in Data.GI.GIR.BasicTypes

Methods

compare :: BasicType -> BasicType -> Ordering Source #

(<) :: BasicType -> BasicType -> Bool Source #

(<=) :: BasicType -> BasicType -> Bool Source #

(>) :: BasicType -> BasicType -> Bool Source #

(>=) :: BasicType -> BasicType -> Bool Source #

max :: BasicType -> BasicType -> BasicType Source #

min :: BasicType -> BasicType -> BasicType Source #

data TypeRep Source #

A fully applied type.

#### Instances

Instances details

Eq TypeRep Source # |
Instance details Defined in Data.GI.CodeGen.Type Methods (==) :: TypeRep -> TypeRep -> Bool Source # (/=) :: TypeRep -> TypeRep -> Bool Source #

con :: Text -> [TypeRep] -> TypeRep Source #

Type constructor applied to the given types.

con0 :: Text -> TypeRep Source #

A shorthand for a type constructor taking no arguments.

typeShow :: TypeRep -> Text Source #

Give a valid Haskell source representation of the given `TypeRep`.

typeConName :: TypeRep -> Text Source #

Return a textual representation of the type constructor for the given `TypeRep`.

io :: TypeRep -> TypeRep Source #

Embed in the `IO` monad.

ptr :: TypeRep -> TypeRep Source #

A `Ptr` to the type.

funptr :: TypeRep -> TypeRep Source #

A `FunPtr` to the type.

maybeT :: TypeRep -> TypeRep Source #

Embed in the `Maybe` monad.