Z-Data-0.8.3.0: Array, vector and text
CopyrightHaskell Foundation (c) Dong Han 2017-2018
LicenseBSD
Maintainerwinterland1989@gmail.com
Stabilityexperimental
Portabilitynon-portable
Safe HaskellNone
LanguageHaskell2010

Z.Data.Array.Cast

Description

This module is borrowed from basement's Cast module with conditional instances removed. The purpose of Cast is to provide primitive types which share the same byte size, so that arrays and vectors parameterized by them can be safely coerced without breaking the index bounds. You can also use it to directly cast primitives just like reinterpret_cast. A Coercible based instance is also provide for convenience.

Synopsis
  • class Cast source destination where
    • cast :: source -> destination

Documentation

class Cast source destination where Source #

Cast between primitive types of the same size.

Methods

cast :: source -> destination Source #

Instances

Instances details
Cast Double Int64 Source # 
Instance details

Defined in Z.Data.Array.Cast

Methods

cast :: Double -> Int64 Source #

Cast Double Word64 Source # 
Instance details

Defined in Z.Data.Array.Cast

Methods

cast :: Double -> Word64 Source #

Cast Float Int32 Source # 
Instance details

Defined in Z.Data.Array.Cast

Methods

cast :: Float -> Int32 Source #

Cast Float Word32 Source # 
Instance details

Defined in Z.Data.Array.Cast

Methods

cast :: Float -> Word32 Source #

Cast Int Word Source # 
Instance details

Defined in Z.Data.Array.Cast

Methods

cast :: Int -> Word Source #

Cast Int8 Word8 Source # 
Instance details

Defined in Z.Data.Array.Cast

Methods

cast :: Int8 -> Word8 Source #

Cast Int16 Word16 Source # 
Instance details

Defined in Z.Data.Array.Cast

Methods

cast :: Int16 -> Word16 Source #

Cast Int32 Float Source # 
Instance details

Defined in Z.Data.Array.Cast

Methods

cast :: Int32 -> Float Source #

Cast Int32 Word32 Source # 
Instance details

Defined in Z.Data.Array.Cast

Methods

cast :: Int32 -> Word32 Source #

Cast Int64 Double Source # 
Instance details

Defined in Z.Data.Array.Cast

Methods

cast :: Int64 -> Double Source #

Cast Int64 Word64 Source # 
Instance details

Defined in Z.Data.Array.Cast

Methods

cast :: Int64 -> Word64 Source #

Cast Word Int Source # 
Instance details

Defined in Z.Data.Array.Cast

Methods

cast :: Word -> Int Source #

Cast Word8 Int8 Source # 
Instance details

Defined in Z.Data.Array.Cast

Methods

cast :: Word8 -> Int8 Source #

Cast Word16 Int16 Source # 
Instance details

Defined in Z.Data.Array.Cast

Methods

cast :: Word16 -> Int16 Source #

Cast Word32 Float Source # 
Instance details

Defined in Z.Data.Array.Cast

Methods

cast :: Word32 -> Float Source #

Cast Word32 Int32 Source # 
Instance details

Defined in Z.Data.Array.Cast

Methods

cast :: Word32 -> Int32 Source #

Cast Word64 Double Source # 
Instance details

Defined in Z.Data.Array.Cast

Methods

cast :: Word64 -> Double Source #

Cast Word64 Int64 Source # 
Instance details

Defined in Z.Data.Array.Cast

Methods

cast :: Word64 -> Int64 Source #

Coercible a b => Cast a b Source # 
Instance details

Defined in Z.Data.Array.Cast

Methods

cast :: a -> b Source #