Safe Haskell | None |
---|---|
Language | Haskell2010 |
- data a :> b = a :> b
- newtype WordN = WordN Word32
- newtype IntN = IntN Int32
- data N8
- data N16
- data N32
- data N64
- data NNative
- data BitWidth n where
- bitWidth :: BitWidth n -> String
- data U
- data S
- data Signedness s where
- U :: Signedness U
- S :: Signedness S
- signedness :: Signedness s -> String
- type family GenericInt s n
- type family WidthOf a
- type family SignOf a
- fromWordN :: BitWidth n -> WordN -> GenericInt U n
- fromIntN :: BitWidth n -> IntN -> GenericInt S n
- genericLen :: BitWidth n -> [a] -> GenericInt U n
- type Length = WordN
- type Index = WordN
- data TargetArr n a = TargetArr (GenericInt U n) [a]
- class MonadType m where
- voidTypeRep :: TypeRep (m ())
- type Mut = IO
- type MArr a = IOArray Index a
- type Par = Par
- type IV = IVar
- newtype FVal a = FVal {
- unFVal :: a
- data TypeRep a where
- UnitType :: TypeRep ()
- BoolType :: TypeRep Bool
- IntType :: (BoundedInt (GenericInt s n), Size (GenericInt s n) ~ Range (GenericInt s n)) => Signedness s -> BitWidth n -> TypeRep (GenericInt s n)
- FloatType :: TypeRep Float
- DoubleType :: TypeRep Double
- ComplexType :: RealFloat a => TypeRep a -> TypeRep (Complex a)
- ArrayType :: TypeRep a -> TypeRep [a]
- TargetArrType :: BitWidth n -> TypeRep a -> TypeRep (TargetArr n a)
- Tup2Type :: TypeRep a -> TypeRep b -> TypeRep (a, b)
- Tup3Type :: TypeRep a -> TypeRep b -> TypeRep c -> TypeRep (a, b, c)
- Tup4Type :: TypeRep a -> TypeRep b -> TypeRep c -> TypeRep d -> TypeRep (a, b, c, d)
- Tup5Type :: TypeRep a -> TypeRep b -> TypeRep c -> TypeRep d -> TypeRep e -> TypeRep (a, b, c, d, e)
- Tup6Type :: TypeRep a -> TypeRep b -> TypeRep c -> TypeRep d -> TypeRep e -> TypeRep f -> TypeRep (a, b, c, d, e, f)
- Tup7Type :: TypeRep a -> TypeRep b -> TypeRep c -> TypeRep d -> TypeRep e -> TypeRep f -> TypeRep g -> TypeRep (a, b, c, d, e, f, g)
- FunType :: TypeRep a -> TypeRep b -> TypeRep (a -> b)
- MutType :: TypeRep a -> TypeRep (Mut a)
- RefType :: TypeRep a -> TypeRep (IORef a)
- MArrType :: TypeRep a -> TypeRep (MArr a)
- ParType :: TypeRep a -> TypeRep (Par a)
- IVarType :: TypeRep a -> TypeRep (IV a)
- FValType :: TypeRep a -> TypeRep (FVal a)
- argType :: TypeRep (a -> b) -> TypeRep a
- resType :: TypeRep (a -> b) -> TypeRep b
- data TypeEq a b where
- defaultSize :: TypeRep a -> Size a
- signEq :: Signedness s1 -> Signedness s2 -> Maybe (TypeEq s1 s2)
- widthEq :: BitWidth n1 -> BitWidth n2 -> Maybe (TypeEq n1 n2)
- typeEq :: TypeRep a -> TypeRep b -> Maybe (TypeEq a b)
- showTup :: [String] -> String
- type family TargetType n a
- class (Eq a, Show a, Typeable a, Show (Size a), Lattice (Size a)) => Type a where
- typeRepByProxy :: Type a => Proxy a -> TypeRep a
- data AnySize = AnySize
- anySizeFun :: AnySize -> AnySize
- anySizeFun2 :: AnySize -> AnySize -> AnySize
- type family Size a
- data RangeSet a where
- sizeToRange :: forall a. Type a => Size a -> RangeSet a
- tIntN :: Patch IntN IntN
- tWordN :: Patch WordN WordN
- tIndex :: Patch Index Index
- tLength :: Patch Length Length
- tArr :: Patch a a -> Patch [a] [a]
Heterogenous lists
Heterogeneous list
a :> b infixr 5 |
Integers
Target-dependent unsigned integers
Bounded WordN | |
Enum WordN | |
Eq WordN | |
Integral WordN | |
Num WordN | |
Ord WordN | |
Real WordN | |
Show WordN | |
Ix WordN | |
Arbitrary WordN | |
NFData WordN | |
Storable WordN | |
Bits WordN | |
FiniteBits WordN | |
Default WordN | |
Random WordN | |
Type WordN | |
Numeric WordN | |
Eq WordN | |
Ord WordN | |
Integral WordN | |
Bits WordN | |
Typeable * WordN | |
Show (MArr a) | |
Type a => Type (MArr a) | |
Slice sl => Slice ((:.) sl (Data Length)) | |
Shape sh => Shape ((:.) sh (Data Length)) | |
type UnsignedRep WordN = Word32 | |
type Size WordN = Range WordN | |
type SignOf WordN = U | |
type WidthOf WordN = NNative | |
type TargetType n WordN = GenericInt U n | |
type TargetType n (MArr a) = MArr (TargetType n a) | |
type Size (MArr a) = (:>) (Range Length) (Size a) | |
type SliceShape ((:.) sl (Data Length)) = SliceShape sl | |
type FullShape ((:.) sl (Data Length)) = (:.) (FullShape sl) (Data Length) |
Target-dependent signed integers
Bounded IntN | |
Enum IntN | |
Eq IntN | |
Integral IntN | |
Num IntN | |
Ord IntN | |
Real IntN | |
Show IntN | |
Ix IntN | |
Arbitrary IntN | |
NFData IntN | |
Storable IntN | |
Bits IntN | |
FiniteBits IntN | |
Default IntN | |
Random IntN | |
Type IntN | |
Numeric IntN | |
Eq IntN | |
Ord IntN | |
Integral IntN | |
Bits IntN | |
Typeable * IntN | |
type UnsignedRep IntN = Word32 | |
type Size IntN = Range IntN | |
type SignOf IntN = S | |
type WidthOf IntN = NNative | |
type TargetType n IntN = GenericInt S n |
Type representation of 16 bits
type GenericInt S N16 = Int16 | |
type GenericInt U N16 = Word16 |
Type representation of 32 bits
type GenericInt S N32 = Int32 | |
type GenericInt U N32 = Word32 |
Type representation of 64 bits
type GenericInt S N64 = Int64 | |
type GenericInt U N64 = Word64 |
Type representation of the native number of bits on the target
type GenericInt S NNative = IntN | |
type GenericInt U NNative = WordN |
Type representation of "unsigned"
type GenericInt U NNative = WordN | |
type GenericInt U N64 = Word64 | |
type GenericInt U N32 = Word32 | |
type GenericInt U N16 = Word16 | |
type GenericInt U N8 = Word8 |
Type representation of "signed"
type GenericInt S NNative = IntN | |
type GenericInt S N64 = Int64 | |
type GenericInt S N32 = Int32 | |
type GenericInt S N16 = Int16 | |
type GenericInt S N8 = Int8 |
signedness :: Signedness s -> String Source
type family GenericInt s n Source
A generalization of unsigned and signed integers. The first parameter represents the signedness and the sectond parameter the number of bits.
type GenericInt S NNative = IntN | |
type GenericInt S N64 = Int64 | |
type GenericInt S N32 = Int32 | |
type GenericInt S N16 = Int16 | |
type GenericInt S N8 = Int8 | |
type GenericInt U NNative = WordN | |
type GenericInt U N64 = Word64 | |
type GenericInt U N32 = Word32 | |
type GenericInt U N16 = Word16 | |
type GenericInt U N8 = Word8 |
genericLen :: BitWidth n -> [a] -> GenericInt U n Source
Arrays
Array whose length is represented by an n
-bit word
TargetArr (GenericInt U n) [a] |
Monadic Types
class MonadType m where Source
This class is used to allow constructs to be abstract in the monad
voidTypeRep :: TypeRep (m ()) Source
Mutable data
Par Monad
Future values
Type representation
Representation of supported types
defaultSize :: TypeRep a -> Size a Source
signEq :: Signedness s1 -> Signedness s2 -> Maybe (TypeEq s1 s2) Source
Type equality on Signedness
type family TargetType n a Source
class (Eq a, Show a, Typeable a, Show (Size a), Lattice (Size a)) => Type a where Source
The set of supported types
Gives the type representation a value.
toTarget :: BitWidth n -> a -> TargetType n a Source
typeRepByProxy :: Type a => Proxy a -> TypeRep a Source
Sized types
anySizeFun :: AnySize -> AnySize Source
anySizeFun2 :: AnySize -> AnySize -> AnySize Source
type Size Bool = AnySize | |
type Size Double = AnySize | |
type Size Float = AnySize | |
type Size Int8 = Range Int8 | |
type Size Int16 = Range Int16 | |
type Size Int32 = Range Int32 | |
type Size Int64 = Range Int64 | |
type Size Word8 = Range Word8 | |
type Size Word16 = Range Word16 | |
type Size Word32 = Range Word32 | |
type Size Word64 = Range Word64 | |
type Size () = AnySize | |
type Size IntN = Range IntN | |
type Size WordN = Range WordN | |
type Size [a] = (:>) (Range Length) (Size a) | |
type Size (Complex a) = AnySize | |
type Size (IORef a) = Size a | |
type Size (FVal a) = Size a | |
type Size (IV a) = Size a | |
type Size (Par a) = Size a | |
type Size (MArr a) = (:>) (Range Length) (Size a) | |
type Size (Mut a) = Size a | |
type Size (a -> b) = (Size a, Size b) | |
type Size (a, b) = (Size a, Size b) | |
type Size (TargetArr n a) = (:>) (Range (GenericInt U n)) (Size a) | |
type Size (a, b, c) = (Size a, Size b, Size c) | |
type Size (a, b, c, d) = (Size a, Size b, Size c, Size d) | |
type Size (a, b, c, d, e) = (Size a, Size b, Size c, Size d, Size e) | |
type Size (a, b, c, d, e, f) = (Size a, Size b, Size c, Size d, Size e, Size f) | |
type Size (a, b, c, d, e, f, g) = (Size a, Size b, Size c, Size d, Size e, Size f, Size g) |
A generalization of Range
that serves two purposes: (1) Adding an extra
Universal
constructor to support unbounded types (Range
can only
represent bounded ranges), and (2) pack a BoundedInt
constraint with the
RangeSet
constructor. This is what allows sizeToRange
to be defined as a
total function with Type
as the only constraint.