Movatterモバイル変換


[0]ホーム

URL:


ghc-prim-0.5.2.0: GHC primitives

Copyright(c) The University of Glasgow 2009
Licensesee libraries/ghc-prim/LICENSE
Maintainercvs-ghc@haskell.org
Stabilityinternal
Portabilitynon-portable (GHC Extensions)
Safe HaskellNone
LanguageHaskell2010

GHC.Types

Contents

Description

GHC type definitions. Use GHC.Exts from the base package instead of importing this module directly.

Synopsis

Documentation

dataBoolSource#

Constructors

False 
True 

dataCharSource#

The character typeChar is an enumeration whose values representUnicode (or equivalently ISO/IEC 10646) code points (i.e. characters, seehttp://www.unicode.org/ for details). This set extends the ISO 8859-1(Latin-1) character set (the first 256 characters), which is itself an extensionof the ASCII character set (the first 128 characters). A character literal inHaskell has typeChar.

To convert aChar to or from the correspondingInt value definedby Unicode, usetoEnum andfromEnum from theEnum class respectively (or equivalentlyord andchr).

Constructors

C#Char# 

dataIntSource#

A fixed-precision integer type with at least the range[-2^29 .. 2^29-1]. The exact range for a given implementation can be determined by usingminBound andmaxBound from theBounded class.

Constructors

I#Int# 

dataWordSource#

AWord is an unsigned integral type, with the same size asInt.

Constructors

W#Word# 

dataFloatSource#

Single-precision floating point numbers. It is desirable that this type be at least equal in range and precision to the IEEE single-precision type.

Constructors

F#Float# 

dataDoubleSource#

Double-precision floating point numbers. It is desirable that this type be at least equal in range and precision to the IEEE double-precision type.

Constructors

D#Double# 

dataOrderingSource#

Constructors

LT 
EQ 
GT 

newtypeIO aSource#

A value of typeIO a is a computation which, when performed,does some I/O before returning a value of typea.

There is really only one way to "perform" an I/O action: bind it toMain.main in your program. When your program is run, the I/O willbe performed. It isn't possible to perform I/O from an arbitraryfunction, unless that function is itself in theIO monad and calledat some point, directly or indirectly, fromMain.main.

IO is a monad, soIO actions can be combined using either the do-notationor the>> and>>= operations from theMonad class.

Constructors

IO (State#RealWorld -> (#State#RealWorld, a#)) 

isTrue# ::Int# ->BoolSource#

Alias fortagToEnum#. Returns True if its parameter is 1# and False if it is 0#.

dataSPECSource#

SPEC is used by GHC in theSpecConstr pass in order to inform the compiler when to be particularly aggressive. In particular, it tells GHC to specialize regardless of size or the number of specializations. However, not all loops fall into this category.

Libraries can specify this by usingSPEC data type to inform which loops should be aggressively specialized.

Constructors

SPEC 
SPEC2 

dataNatSource#

(Kind) This is the kind of type-level natural numbers.

dataSymbolSource#

(Kind) This is the kind of type-level symbols. Declared here because class IP needs it

type familyAny :: kwhere ...Source#

The type constructorAny is type to which you can unsafely coerce any lifted type, and back. More concretely, for a lifted typet and valuex :: t, --unsafeCoerce (unsafeCoerce x :: Any) :: t is equivalent tox.

class a~~ bSource#

Lifted, heterogeneous equality. By lifted, we mean that it can be bogus (deferred type error). By heterogeneous, the two typesa andb might have different kinds. Because~~ can appear unexpectedly in error messages to users who do not care about the difference between heterogeneous equality~~ and homogeneous equality~, this is printed as~ unless-fprint-equality-relations is set.

classCoercible a bSource#

Coercible is a two-parameter class that has instances for typesa andb if the compiler can infer that they have the same representation. This class does not have regular instances; instead they are created on-the-fly during type-checking. Trying to manually declare an instance ofCoercible is an error.

Nevertheless one can pretend that the following three kinds of instances exist. First, as a trivial base-case:

instance Coercible a a

Furthermore, for every type constructor there is an instance that allows to coerce under the type constructor. For example, letD be a prototypical type constructor (data ornewtype) with three type arguments, which have rolesnominal,representational resp.phantom. Then there is an instance of the form

instance Coercible b b' => Coercible (D a b c) (D a b' c')

Note that thenominal type arguments are equal, therepresentational type arguments can differ, but need to have aCoercible instance themself, and thephantom type arguments can be changed arbitrarily.

The third kind of instance exists for everynewtype NT = MkNT T and comes in two variants, namely

instance Coercible a T => Coercible a NT
instance Coercible T b => Coercible NT b

This instance is only usable if the constructorMkNT is in scope.

If, as a library author of a type constructor likeSet a, you want to prevent a user of your module to writecoerce :: Set T -> Set NT, you need to set the role ofSet's type parameter tonominal, by writing

type role Set nominal

For more details about this feature, please refer toSafe Coercions by Joachim Breitner, Richard A. Eisenberg, Simon Peyton Jones and Stephanie Weirich.

Since: 4.7.0.0

dataTYPE (a ::RuntimeRep)Source#

dataRuntimeRepSource#

GHC maintains a property that the kind of all inhabited types (as distinct from type constructors or type-level data) tells us the runtime representation of values of that type. This datatype encodes the choice of runtime value. Note thatTYPE is parameterised byRuntimeRep; this is precisely what we mean by the fact that a type's kind encodes the runtime representation.

For boxed values (that is, values that are represented by a pointer), a further distinction is made, between lifted types (that contain ⊥), and unlifted ones (that don't).

Constructors

VecRepVecCountVecElem

a SIMD vector type

TupleRep [RuntimeRep]

An unboxed tuple of the given reps

SumRep [RuntimeRep]

An unboxed sum of the given reps

LiftedRep

lifted; represented by a pointer

UnliftedRep

unlifted; represented by a pointer

IntRep

signed, word-sized value

WordRep

unsigned, word-sized value

Int64Rep

signed, 64-bit value (on 32-bit only)

Word64Rep

unsigned, 64-bit value (on 32-bit only)

AddrRep

A pointer, butnot to a Haskell value

FloatRep

a 32-bit floating point number

DoubleRep

a 64-bit floating point number

typeType =TYPELiftedRepSource#

The kind of types with values. For exampleInt :: Type.

type* =TYPELiftedRepSource#

A backward-compatible (pre-GHC 8.0) synonym forType

type(★) =TYPELiftedRepSource#

A unicode backward-compatible (pre-GHC 8.0) synonym forType

dataConstraintSource#

The kind of constraints, likeShow a

dataVecCountSource#

Length of a SIMD vector type

Constructors

Vec2 
Vec4 
Vec8 
Vec16 
Vec32 
Vec64 

dataVecElemSource#

Element of a SIMD vector type

Constructors

Int8ElemRep 
Int16ElemRep 
Int32ElemRep 
Int64ElemRep 
Word8ElemRep 
Word16ElemRep 
Word32ElemRep 
Word64ElemRep 
FloatElemRep 
DoubleElemRep 

Runtime type representation

dataModuleSource#

Constructors

ModuleTrNameTrName 

dataTrNameSource#

Constructors

TrNameSAddr# 
TrNameD [Char] 

dataTyConSource#

Constructors

TyConWord#Word#ModuleTrNameInt#KindRep 

dataTypeLitSortSource#

Constructors

TypeLitSymbol 
TypeLitNat 

dataKindRepSource#

The representation produced by GHC for conjuring up the kind of aTypeRep. See Note [Representing TyCon kinds: KindRep] in TcTypeable.

Constructors

KindRepTyConAppTyCon [KindRep] 
KindRepVar !KindBndr 
KindRepAppKindRepKindRep 
KindRepFunKindRepKindRep 
KindRepTYPE !RuntimeRep 
KindRepTypeLitSTypeLitSortAddr# 
KindRepTypeLitDTypeLitSort [Char] 

typeKindBndr =IntSource#

A de Bruijn index for a binder within aKindRep.

Produced byHaddock version 2.19.0.1


[8]ページ先頭

©2009-2025 Movatter.jp