convertible-1.1.1.0: Typeclasses and instances for converting between types

CopyrightCopyright (C) 2009-2011 John Goerzen
LicenseBSD3
MaintainerJohn Goerzen <jgoerzen@complete.org>
Stabilityprovisional
Portabilityportable
Safe HaskellSafe
LanguageHaskell98

Data.Convertible.Instances.Num

Contents

Description

Numeric instances for Convertible.

Copyright (C) 2009-2011 John Goerzen jgoerzen@complete.org

All rights reserved.

For license and copyright information, see the file LICENSE

These instances perform conversion between numeric types such as Double, Int, Integer, Rational, and the like. Here are some notes about the conversion process:

Conversions from floating-point types such as Double to integral types are done via the truncate function. This is a somewhat arbitrary decision; if you need different behavior, you will have to write your own instance or manually perform the conversion.

All conversions perform bounds checking. If a value is too large for its destination type, you will get a ConvertError informing you of this. Note that this behavior differs from functions in the Haskell standard libraries, which will perform the conversion without error, but give you garbage in the end.

Conversions do not perform precision checking; loss of precision is implied with certain conversions (for instance, Double to Float) and this is not an error.

Orphan instances

Convertible Char Int # 
Convertible Char Int8 # 
Convertible Char Int16 # 
Convertible Char Int32 # 
Convertible Char Int64 # 
Convertible Char Integer # 
Convertible Char Word # 
Convertible Char Word8 # 
Convertible Char Word16 # 
Convertible Char Word32 # 
Convertible Char Word64 # 
Convertible Double Float # 
Convertible Double Int # 
Convertible Double Int8 # 
Convertible Double Int16 # 
Convertible Double Int32 # 
Convertible Double Int64 # 
Convertible Double Integer # 
Convertible Double Rational # 
Convertible Double Word # 
Convertible Double Word8 # 
Convertible Double Word16 # 
Convertible Double Word32 # 
Convertible Double Word64 # 
Convertible Float Double # 
Convertible Float Int # 
Convertible Float Int8 # 
Convertible Float Int16 # 
Convertible Float Int32 # 
Convertible Float Int64 # 
Convertible Float Integer # 
Convertible Float Rational # 
Convertible Float Word # 
Convertible Float Word8 # 
Convertible Float Word16 # 
Convertible Float Word32 # 
Convertible Float Word64 # 
Convertible Int Char # 
Convertible Int Double # 
Convertible Int Float # 
Convertible Int Int8 # 
Convertible Int Int16 # 
Convertible Int Int32 # 
Convertible Int Int64 # 
Convertible Int Integer # 
Convertible Int Rational # 
Convertible Int Word # 
Convertible Int Word8 # 
Convertible Int Word16 # 
Convertible Int Word32 # 
Convertible Int Word64 # 
Convertible Int8 Char # 
Convertible Int8 Double # 
Convertible Int8 Float # 
Convertible Int8 Int # 
Convertible Int8 Int16 # 
Convertible Int8 Int32 # 
Convertible Int8 Int64 # 
Convertible Int8 Integer # 
Convertible Int8 Rational # 
Convertible Int8 Word # 
Convertible Int8 Word8 # 
Convertible Int8 Word16 # 
Convertible Int8 Word32 # 
Convertible Int8 Word64 # 
Convertible Int16 Char # 
Convertible Int16 Double # 
Convertible Int16 Float # 
Convertible Int16 Int # 
Convertible Int16 Int8 # 
Convertible Int16 Int32 # 
Convertible Int16 Int64 # 
Convertible Int16 Integer # 
Convertible Int16 Rational # 
Convertible Int16 Word # 
Convertible Int16 Word8 # 
Convertible Int16 Word16 # 
Convertible Int16 Word32 # 
Convertible Int16 Word64 # 
Convertible Int32 Char # 
Convertible Int32 Double # 
Convertible Int32 Float # 
Convertible Int32 Int # 
Convertible Int32 Int8 # 
Convertible Int32 Int16 # 
Convertible Int32 Int64 # 
Convertible Int32 Integer # 
Convertible Int32 Rational # 
Convertible Int32 Word # 
Convertible Int32 Word8 # 
Convertible Int32 Word16 # 
Convertible Int32 Word32 # 
Convertible Int32 Word64 # 
Convertible Int64 Char # 
Convertible Int64 Double # 
Convertible Int64 Float # 
Convertible Int64 Int # 
Convertible Int64 Int8 # 
Convertible Int64 Int16 # 
Convertible Int64 Int32 # 
Convertible Int64 Integer # 
Convertible Int64 Rational # 
Convertible Int64 Word # 
Convertible Int64 Word8 # 
Convertible Int64 Word16 # 
Convertible Int64 Word32 # 
Convertible Int64 Word64 # 
Convertible Integer Char # 
Convertible Integer Double # 
Convertible Integer Float # 
Convertible Integer Int # 
Convertible Integer Int8 # 
Convertible Integer Int16 # 
Convertible Integer Int32 # 
Convertible Integer Int64 # 
Convertible Integer Integer # 
Convertible Integer Rational # 
Convertible Integer Word # 
Convertible Integer Word8 # 
Convertible Integer Word16 # 
Convertible Integer Word32 # 
Convertible Integer Word64 # 
Convertible Rational Double # 
Convertible Rational Float # 
Convertible Rational Int # 
Convertible Rational Int8 # 
Convertible Rational Int16 # 
Convertible Rational Int32 # 
Convertible Rational Int64 # 
Convertible Rational Integer # 
Convertible Rational Word # 
Convertible Rational Word8 # 
Convertible Rational Word16 # 
Convertible Rational Word32 # 
Convertible Rational Word64 # 
Convertible Word Char # 
Convertible Word Double # 
Convertible Word Float # 
Convertible Word Int # 
Convertible Word Int8 # 
Convertible Word Int16 # 
Convertible Word Int32 # 
Convertible Word Int64 # 
Convertible Word Integer # 
Convertible Word Rational # 
Convertible Word Word8 # 
Convertible Word Word16 # 
Convertible Word Word32 # 
Convertible Word Word64 # 
Convertible Word8 Char # 
Convertible Word8 Double # 
Convertible Word8 Float # 
Convertible Word8 Int # 
Convertible Word8 Int8 # 
Convertible Word8 Int16 # 
Convertible Word8 Int32 # 
Convertible Word8 Int64 # 
Convertible Word8 Integer # 
Convertible Word8 Rational # 
Convertible Word8 Word # 
Convertible Word8 Word16 # 
Convertible Word8 Word32 # 
Convertible Word8 Word64 # 
Convertible Word16 Char # 
Convertible Word16 Double # 
Convertible Word16 Float # 
Convertible Word16 Int # 
Convertible Word16 Int8 # 
Convertible Word16 Int16 # 
Convertible Word16 Int32 # 
Convertible Word16 Int64 # 
Convertible Word16 Integer # 
Convertible Word16 Rational # 
Convertible Word16 Word # 
Convertible Word16 Word8 # 
Convertible Word16 Word32 # 
Convertible Word16 Word64 # 
Convertible Word32 Char # 
Convertible Word32 Double # 
Convertible Word32 Float # 
Convertible Word32 Int # 
Convertible Word32 Int8 # 
Convertible Word32 Int16 # 
Convertible Word32 Int32 # 
Convertible Word32 Int64 # 
Convertible Word32 Integer # 
Convertible Word32 Rational # 
Convertible Word32 Word # 
Convertible Word32 Word8 # 
Convertible Word32 Word16 # 
Convertible Word32 Word64 # 
Convertible Word64 Char # 
Convertible Word64 Double # 
Convertible Word64 Float # 
Convertible Word64 Int # 
Convertible Word64 Int8 # 
Convertible Word64 Int16 # 
Convertible Word64 Int32 # 
Convertible Word64 Int64 # 
Convertible Word64 Integer # 
Convertible Word64 Rational # 
Convertible Word64 Word # 
Convertible Word64 Word8 # 
Convertible Word64 Word16 # 
Convertible Word64 Word32 #