HORIZON HASKELLDocslts/ghc-9.10.x248f8f02026-10-05Search names, modules, packages, or :: a typeCtrl K

GHC 9.10.3 · lts/ghc-9.10.x · 248f8f0 · 2026-10-05

Modulebasement-0.0.16Haskell2010

Basement.Cast

  • 1 class
  • Packagebasement-0.0.16
  • Exports1
  • LanguageHaskell2010
  • LicenceBSD-3-Clause
  • SourceCast.hs
classclass 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

Methods

  • cast :: source -> destination
Instances19Cast, …