basement-0.0.6: Foundation scrap box of array & string

LicenseBSD-style
MaintainerHaskell Foundation
Safe HaskellNone
LanguageHaskell2010

Basement.Cast

Description

 

Synopsis

Documentation

class Cast source destination where Source #

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

Methods

cast :: source -> destination Source #

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