Copyright | Haskell Foundation (c) Dong Han 2017-2018 |
---|---|
License | BSD |
Maintainer | winterland1989@gmail.com |
Stability | experimental |
Portability | non-portable |
Safe Haskell | None |
Language | Haskell2010 |
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.
Documentation
class Cast source destination where Source #
Cast
between primitive types of the same size.
Instances
Cast Double Int64 Source # | |
Cast Double Word64 Source # | |
Cast Float Int32 Source # | |
Cast Float Word32 Source # | |
Cast Int Word Source # | |
Cast Int8 Word8 Source # | |
Cast Int16 Word16 Source # | |
Cast Int32 Float Source # | |
Cast Int32 Word32 Source # | |
Cast Int64 Double Source # | |
Cast Int64 Word64 Source # | |
Cast Word Int Source # | |
Cast Word8 Int8 Source # | |
Cast Word16 Int16 Source # | |
Cast Word32 Float Source # | |
Cast Word32 Int32 Source # | |
Cast Word64 Double Source # | |
Cast Word64 Int64 Source # | |
Coercible a b => Cast a b Source # | |
Defined in Std.Data.PrimArray.Cast |