basement-0.0.12: Foundation scrap box of array & string
LicenseBSD-style
MaintainerHaskell Foundation
Safe HaskellNone
LanguageHaskell2010

Basement.Cast

Description

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

Documentation

class Cast source destination where #

Cast an object of type a to b.

Do not add instance of this class if the source type is not of the same size of the destination type. Also keep in mind this is casting a value of a given type into a destination type. The value won't be changed to fit the destination represention.

If you wish to convert a value of a given type into another type, look at From and TryFrom.

cast (-10 :: Int) :: Word === 18446744073709551606

Minimal complete definition

Nothing

Methods

cast :: source -> destination #

default cast :: (PrimType source, PrimType destination, PrimSize source ~ PrimSize destination) => source -> destination #

Instances

Instances details
Cast Int Int64 # 
Instance details

Defined in Basement.Cast

Methods

cast :: Int -> Int64 #

Cast Int Word # 
Instance details

Defined in Basement.Cast

Methods

cast :: Int -> Word #

Cast Int Word64 # 
Instance details

Defined in Basement.Cast

Methods

cast :: Int -> Word64 #

Cast Int8 Word8 # 
Instance details

Defined in Basement.Cast

Methods

cast :: Int8 -> Word8 #

Cast Int16 Word16 # 
Instance details

Defined in Basement.Cast

Methods

cast :: Int16 -> Word16 #

Cast Int32 Word32 # 
Instance details

Defined in Basement.Cast

Methods

cast :: Int32 -> Word32 #

Cast Int64 Int # 
Instance details

Defined in Basement.Cast

Methods

cast :: Int64 -> Int #

Cast Int64 Word # 
Instance details

Defined in Basement.Cast

Methods

cast :: Int64 -> Word #

Cast Int64 Word64 # 
Instance details

Defined in Basement.Cast

Methods

cast :: Int64 -> Word64 #

Cast Word Int # 
Instance details

Defined in Basement.Cast

Methods

cast :: Word -> Int #

Cast Word Int64 # 
Instance details

Defined in Basement.Cast

Methods

cast :: Word -> Int64 #

Cast Word Word64 # 
Instance details

Defined in Basement.Cast

Methods

cast :: Word -> Word64 #

Cast Word8 Int8 # 
Instance details

Defined in Basement.Cast

Methods

cast :: Word8 -> Int8 #

Cast Word16 Int16 # 
Instance details

Defined in Basement.Cast

Methods

cast :: Word16 -> Int16 #

Cast Word32 Int32 # 
Instance details

Defined in Basement.Cast

Methods

cast :: Word32 -> Int32 #

Cast Word64 Int # 
Instance details

Defined in Basement.Cast

Methods

cast :: Word64 -> Int #

Cast Word64 Int64 # 
Instance details

Defined in Basement.Cast

Methods

cast :: Word64 -> Int64 #

Cast Word64 Word # 
Instance details

Defined in Basement.Cast

Methods

cast :: Word64 -> Word #

Cast (Block a) (Block Word8) # 
Instance details

Defined in Basement.Cast

Methods

cast :: Block a -> Block Word8 #