mixed-types-num-0.5.4.0: Alternative Prelude with numeric and logic expressions typed bottom-up
CopyrightCopyright (C) 2009-2011 John Goerzen
LicenseBSD3
MaintainerJohn Goerzen <jgoerzen@complete.org>
Stabilityprovisional
Portabilityportable
Safe HaskellSafe-Inferred
LanguageHaskell2010

Data.Convertible.Base

Description

 
Synopsis

The conversion process

convert :: Convertible a b => a -> b Source #

Convert from one type of data to another. Raises an exception if there is an error with the conversion. For a function that does not raise an exception in that case, see safeConvert.

class Convertible a b where Source #

A typeclass that represents something that can be converted. A Convertible a b instance represents an a that can be converted to a b.

Methods

safeConvert :: a -> ConvertResult b Source #

Convert a to b, returning Right on success and Left on error. For a simpler interface, see convert.

Instances

Instances details
Convertible Char Int Source # 
Instance details

Defined in Data.Convertible.Instances.Num

Convertible Char Int8 Source # 
Instance details

Defined in Data.Convertible.Instances.Num

Convertible Char Int16 Source # 
Instance details

Defined in Data.Convertible.Instances.Num

Convertible Char Int32 Source # 
Instance details

Defined in Data.Convertible.Instances.Num

Convertible Char Int64 Source # 
Instance details

Defined in Data.Convertible.Instances.Num

Convertible Char Integer Source # 
Instance details

Defined in Data.Convertible.Instances.Num

Convertible Char Word Source # 
Instance details

Defined in Data.Convertible.Instances.Num

Convertible Char Word8 Source # 
Instance details

Defined in Data.Convertible.Instances.Num

Convertible Char Word16 Source # 
Instance details

Defined in Data.Convertible.Instances.Num

Convertible Char Word32 Source # 
Instance details

Defined in Data.Convertible.Instances.Num

Convertible Char Word64 Source # 
Instance details

Defined in Data.Convertible.Instances.Num

Convertible Double Float Source # 
Instance details

Defined in Data.Convertible.Instances.Num

Convertible Double Int Source # 
Instance details

Defined in Data.Convertible.Instances.Num

Convertible Double Int8 Source # 
Instance details

Defined in Data.Convertible.Instances.Num

Convertible Double Int16 Source # 
Instance details

Defined in Data.Convertible.Instances.Num

Convertible Double Int32 Source # 
Instance details

Defined in Data.Convertible.Instances.Num

Convertible Double Int64 Source # 
Instance details

Defined in Data.Convertible.Instances.Num

Convertible Double Integer Source # 
Instance details

Defined in Data.Convertible.Instances.Num

Convertible Double Rational Source # 
Instance details

Defined in Data.Convertible.Instances.Num

Convertible Double Word Source # 
Instance details

Defined in Data.Convertible.Instances.Num

Convertible Double Word8 Source # 
Instance details

Defined in Data.Convertible.Instances.Num

Convertible Double Word16 Source # 
Instance details

Defined in Data.Convertible.Instances.Num

Convertible Double Word32 Source # 
Instance details

Defined in Data.Convertible.Instances.Num

Convertible Double Word64 Source # 
Instance details

Defined in Data.Convertible.Instances.Num

Convertible Float Double Source # 
Instance details

Defined in Data.Convertible.Instances.Num

Convertible Float Int Source # 
Instance details

Defined in Data.Convertible.Instances.Num

Convertible Float Int8 Source # 
Instance details

Defined in Data.Convertible.Instances.Num

Convertible Float Int16 Source # 
Instance details

Defined in Data.Convertible.Instances.Num

Convertible Float Int32 Source # 
Instance details

Defined in Data.Convertible.Instances.Num

Convertible Float Int64 Source # 
Instance details

Defined in Data.Convertible.Instances.Num

Convertible Float Integer Source # 
Instance details

Defined in Data.Convertible.Instances.Num

Convertible Float Rational Source # 
Instance details

Defined in Data.Convertible.Instances.Num

Convertible Float Word Source # 
Instance details

Defined in Data.Convertible.Instances.Num

Convertible Float Word8 Source # 
Instance details

Defined in Data.Convertible.Instances.Num

Convertible Float Word16 Source # 
Instance details

Defined in Data.Convertible.Instances.Num

Convertible Float Word32 Source # 
Instance details

Defined in Data.Convertible.Instances.Num

Convertible Float Word64 Source # 
Instance details

Defined in Data.Convertible.Instances.Num

Convertible Int Char Source # 
Instance details

Defined in Data.Convertible.Instances.Num

Convertible Int Double Source # 
Instance details

Defined in Data.Convertible.Instances.Num

Convertible Int Float Source # 
Instance details

Defined in Data.Convertible.Instances.Num

Convertible Int Int8 Source # 
Instance details

Defined in Data.Convertible.Instances.Num

Convertible Int Int16 Source # 
Instance details

Defined in Data.Convertible.Instances.Num

Convertible Int Int32 Source # 
Instance details

Defined in Data.Convertible.Instances.Num

Convertible Int Int64 Source # 
Instance details

Defined in Data.Convertible.Instances.Num

Convertible Int Integer Source # 
Instance details

Defined in Data.Convertible.Instances.Num

Convertible Int Rational Source # 
Instance details

Defined in Data.Convertible.Instances.Num

Convertible Int Word Source # 
Instance details

Defined in Data.Convertible.Instances.Num

Convertible Int Word8 Source # 
Instance details

Defined in Data.Convertible.Instances.Num

Convertible Int Word16 Source # 
Instance details

Defined in Data.Convertible.Instances.Num

Convertible Int Word32 Source # 
Instance details

Defined in Data.Convertible.Instances.Num

Convertible Int Word64 Source # 
Instance details

Defined in Data.Convertible.Instances.Num

Convertible Int8 Char Source # 
Instance details

Defined in Data.Convertible.Instances.Num

Convertible Int8 Double Source # 
Instance details

Defined in Data.Convertible.Instances.Num

Convertible Int8 Float Source # 
Instance details

Defined in Data.Convertible.Instances.Num

Convertible Int8 Int Source # 
Instance details

Defined in Data.Convertible.Instances.Num

Convertible Int8 Int16 Source # 
Instance details

Defined in Data.Convertible.Instances.Num

Convertible Int8 Int32 Source # 
Instance details

Defined in Data.Convertible.Instances.Num

Convertible Int8 Int64 Source # 
Instance details

Defined in Data.Convertible.Instances.Num

Convertible Int8 Integer Source # 
Instance details

Defined in Data.Convertible.Instances.Num

Convertible Int8 Rational Source # 
Instance details

Defined in Data.Convertible.Instances.Num

Convertible Int8 Word Source # 
Instance details

Defined in Data.Convertible.Instances.Num

Convertible Int8 Word8 Source # 
Instance details

Defined in Data.Convertible.Instances.Num

Convertible Int8 Word16 Source # 
Instance details

Defined in Data.Convertible.Instances.Num

Convertible Int8 Word32 Source # 
Instance details

Defined in Data.Convertible.Instances.Num

Convertible Int8 Word64 Source # 
Instance details

Defined in Data.Convertible.Instances.Num

Convertible Int16 Char Source # 
Instance details

Defined in Data.Convertible.Instances.Num

Convertible Int16 Double Source # 
Instance details

Defined in Data.Convertible.Instances.Num

Convertible Int16 Float Source # 
Instance details

Defined in Data.Convertible.Instances.Num

Convertible Int16 Int Source # 
Instance details

Defined in Data.Convertible.Instances.Num

Convertible Int16 Int8 Source # 
Instance details

Defined in Data.Convertible.Instances.Num

Convertible Int16 Int32 Source # 
Instance details

Defined in Data.Convertible.Instances.Num

Convertible Int16 Int64 Source # 
Instance details

Defined in Data.Convertible.Instances.Num

Convertible Int16 Integer Source # 
Instance details

Defined in Data.Convertible.Instances.Num

Convertible Int16 Rational Source # 
Instance details

Defined in Data.Convertible.Instances.Num

Convertible Int16 Word Source # 
Instance details

Defined in Data.Convertible.Instances.Num

Convertible Int16 Word8 Source # 
Instance details

Defined in Data.Convertible.Instances.Num

Convertible Int16 Word16 Source # 
Instance details

Defined in Data.Convertible.Instances.Num

Convertible Int16 Word32 Source # 
Instance details

Defined in Data.Convertible.Instances.Num

Convertible Int16 Word64 Source # 
Instance details

Defined in Data.Convertible.Instances.Num

Convertible Int32 Char Source # 
Instance details

Defined in Data.Convertible.Instances.Num

Convertible Int32 Double Source # 
Instance details

Defined in Data.Convertible.Instances.Num

Convertible Int32 Float Source # 
Instance details

Defined in Data.Convertible.Instances.Num

Convertible Int32 Int Source # 
Instance details

Defined in Data.Convertible.Instances.Num

Convertible Int32 Int8 Source # 
Instance details

Defined in Data.Convertible.Instances.Num

Convertible Int32 Int16 Source # 
Instance details

Defined in Data.Convertible.Instances.Num

Convertible Int32 Int64 Source # 
Instance details

Defined in Data.Convertible.Instances.Num

Convertible Int32 Integer Source # 
Instance details

Defined in Data.Convertible.Instances.Num

Convertible Int32 Rational Source # 
Instance details

Defined in Data.Convertible.Instances.Num

Convertible Int32 Word Source # 
Instance details

Defined in Data.Convertible.Instances.Num

Convertible Int32 Word8 Source # 
Instance details

Defined in Data.Convertible.Instances.Num

Convertible Int32 Word16 Source # 
Instance details

Defined in Data.Convertible.Instances.Num

Convertible Int32 Word32 Source # 
Instance details

Defined in Data.Convertible.Instances.Num

Convertible Int32 Word64 Source # 
Instance details

Defined in Data.Convertible.Instances.Num

Convertible Int64 Char Source # 
Instance details

Defined in Data.Convertible.Instances.Num

Convertible Int64 Double Source # 
Instance details

Defined in Data.Convertible.Instances.Num

Convertible Int64 Float Source # 
Instance details

Defined in Data.Convertible.Instances.Num

Convertible Int64 Int Source # 
Instance details

Defined in Data.Convertible.Instances.Num

Convertible Int64 Int8 Source # 
Instance details

Defined in Data.Convertible.Instances.Num

Convertible Int64 Int16 Source # 
Instance details

Defined in Data.Convertible.Instances.Num

Convertible Int64 Int32 Source # 
Instance details

Defined in Data.Convertible.Instances.Num

Convertible Int64 Integer Source # 
Instance details

Defined in Data.Convertible.Instances.Num

Convertible Int64 Rational Source # 
Instance details

Defined in Data.Convertible.Instances.Num

Convertible Int64 Word Source # 
Instance details

Defined in Data.Convertible.Instances.Num

Convertible Int64 Word8 Source # 
Instance details

Defined in Data.Convertible.Instances.Num

Convertible Int64 Word16 Source # 
Instance details

Defined in Data.Convertible.Instances.Num

Convertible Int64 Word32 Source # 
Instance details

Defined in Data.Convertible.Instances.Num

Convertible Int64 Word64 Source # 
Instance details

Defined in Data.Convertible.Instances.Num

Convertible Integer Char Source # 
Instance details

Defined in Data.Convertible.Instances.Num

Convertible Integer Double Source # 
Instance details

Defined in Data.Convertible.Instances.Num

Convertible Integer Float Source # 
Instance details

Defined in Data.Convertible.Instances.Num

Convertible Integer Int Source # 
Instance details

Defined in Data.Convertible.Instances.Num

Convertible Integer Int8 Source # 
Instance details

Defined in Data.Convertible.Instances.Num

Convertible Integer Int16 Source # 
Instance details

Defined in Data.Convertible.Instances.Num

Convertible Integer Int32 Source # 
Instance details

Defined in Data.Convertible.Instances.Num

Convertible Integer Int64 Source # 
Instance details

Defined in Data.Convertible.Instances.Num

Convertible Integer Integer Source # 
Instance details

Defined in Data.Convertible.Instances.Num

Convertible Integer Rational Source # 
Instance details

Defined in Data.Convertible.Instances.Num

Convertible Integer Word Source # 
Instance details

Defined in Data.Convertible.Instances.Num

Convertible Integer Word8 Source # 
Instance details

Defined in Data.Convertible.Instances.Num

Convertible Integer Word16 Source # 
Instance details

Defined in Data.Convertible.Instances.Num

Convertible Integer Word32 Source # 
Instance details

Defined in Data.Convertible.Instances.Num

Convertible Integer Word64 Source # 
Instance details

Defined in Data.Convertible.Instances.Num

Convertible Rational Double Source # 
Instance details

Defined in Data.Convertible.Instances.Num

Convertible Rational Float Source # 
Instance details

Defined in Data.Convertible.Instances.Num

Convertible Rational Int Source # 
Instance details

Defined in Data.Convertible.Instances.Num

Convertible Rational Int8 Source # 
Instance details

Defined in Data.Convertible.Instances.Num

Convertible Rational Int16 Source # 
Instance details

Defined in Data.Convertible.Instances.Num

Convertible Rational Int32 Source # 
Instance details

Defined in Data.Convertible.Instances.Num

Convertible Rational Int64 Source # 
Instance details

Defined in Data.Convertible.Instances.Num

Convertible Rational Integer Source # 
Instance details

Defined in Data.Convertible.Instances.Num

Convertible Rational Word Source # 
Instance details

Defined in Data.Convertible.Instances.Num

Convertible Rational Word8 Source # 
Instance details

Defined in Data.Convertible.Instances.Num

Convertible Rational Word16 Source # 
Instance details

Defined in Data.Convertible.Instances.Num

Convertible Rational Word32 Source # 
Instance details

Defined in Data.Convertible.Instances.Num

Convertible Rational Word64 Source # 
Instance details

Defined in Data.Convertible.Instances.Num

Convertible Word Char Source # 
Instance details

Defined in Data.Convertible.Instances.Num

Convertible Word Double Source # 
Instance details

Defined in Data.Convertible.Instances.Num

Convertible Word Float Source # 
Instance details

Defined in Data.Convertible.Instances.Num

Convertible Word Int Source # 
Instance details

Defined in Data.Convertible.Instances.Num

Convertible Word Int8 Source # 
Instance details

Defined in Data.Convertible.Instances.Num

Convertible Word Int16 Source # 
Instance details

Defined in Data.Convertible.Instances.Num

Convertible Word Int32 Source # 
Instance details

Defined in Data.Convertible.Instances.Num

Convertible Word Int64 Source # 
Instance details

Defined in Data.Convertible.Instances.Num

Convertible Word Integer Source # 
Instance details

Defined in Data.Convertible.Instances.Num

Convertible Word Rational Source # 
Instance details

Defined in Data.Convertible.Instances.Num

Convertible Word Word8 Source # 
Instance details

Defined in Data.Convertible.Instances.Num

Convertible Word Word16 Source # 
Instance details

Defined in Data.Convertible.Instances.Num

Convertible Word Word32 Source # 
Instance details

Defined in Data.Convertible.Instances.Num

Convertible Word Word64 Source # 
Instance details

Defined in Data.Convertible.Instances.Num

Convertible Word8 Char Source # 
Instance details

Defined in Data.Convertible.Instances.Num

Convertible Word8 Double Source # 
Instance details

Defined in Data.Convertible.Instances.Num

Convertible Word8 Float Source # 
Instance details

Defined in Data.Convertible.Instances.Num

Convertible Word8 Int Source # 
Instance details

Defined in Data.Convertible.Instances.Num

Convertible Word8 Int8 Source # 
Instance details

Defined in Data.Convertible.Instances.Num

Convertible Word8 Int16 Source # 
Instance details

Defined in Data.Convertible.Instances.Num

Convertible Word8 Int32 Source # 
Instance details

Defined in Data.Convertible.Instances.Num

Convertible Word8 Int64 Source # 
Instance details

Defined in Data.Convertible.Instances.Num

Convertible Word8 Integer Source # 
Instance details

Defined in Data.Convertible.Instances.Num

Convertible Word8 Rational Source # 
Instance details

Defined in Data.Convertible.Instances.Num

Convertible Word8 Word Source # 
Instance details

Defined in Data.Convertible.Instances.Num

Convertible Word8 Word16 Source # 
Instance details

Defined in Data.Convertible.Instances.Num

Convertible Word8 Word32 Source # 
Instance details

Defined in Data.Convertible.Instances.Num

Convertible Word8 Word64 Source # 
Instance details

Defined in Data.Convertible.Instances.Num

Convertible Word16 Char Source # 
Instance details

Defined in Data.Convertible.Instances.Num

Convertible Word16 Double Source # 
Instance details

Defined in Data.Convertible.Instances.Num

Convertible Word16 Float Source # 
Instance details

Defined in Data.Convertible.Instances.Num

Convertible Word16 Int Source # 
Instance details

Defined in Data.Convertible.Instances.Num

Convertible Word16 Int8 Source # 
Instance details

Defined in Data.Convertible.Instances.Num

Convertible Word16 Int16 Source # 
Instance details

Defined in Data.Convertible.Instances.Num

Convertible Word16 Int32 Source # 
Instance details

Defined in Data.Convertible.Instances.Num

Convertible Word16 Int64 Source # 
Instance details

Defined in Data.Convertible.Instances.Num

Convertible Word16 Integer Source # 
Instance details

Defined in Data.Convertible.Instances.Num

Convertible Word16 Rational Source # 
Instance details

Defined in Data.Convertible.Instances.Num

Convertible Word16 Word Source # 
Instance details

Defined in Data.Convertible.Instances.Num

Convertible Word16 Word8 Source # 
Instance details

Defined in Data.Convertible.Instances.Num

Convertible Word16 Word32 Source # 
Instance details

Defined in Data.Convertible.Instances.Num

Convertible Word16 Word64 Source # 
Instance details

Defined in Data.Convertible.Instances.Num

Convertible Word32 Char Source # 
Instance details

Defined in Data.Convertible.Instances.Num

Convertible Word32 Double Source # 
Instance details

Defined in Data.Convertible.Instances.Num

Convertible Word32 Float Source # 
Instance details

Defined in Data.Convertible.Instances.Num

Convertible Word32 Int Source # 
Instance details

Defined in Data.Convertible.Instances.Num

Convertible Word32 Int8 Source # 
Instance details

Defined in Data.Convertible.Instances.Num

Convertible Word32 Int16 Source # 
Instance details

Defined in Data.Convertible.Instances.Num

Convertible Word32 Int32 Source # 
Instance details

Defined in Data.Convertible.Instances.Num

Convertible Word32 Int64 Source # 
Instance details

Defined in Data.Convertible.Instances.Num

Convertible Word32 Integer Source # 
Instance details

Defined in Data.Convertible.Instances.Num

Convertible Word32 Rational Source # 
Instance details

Defined in Data.Convertible.Instances.Num

Convertible Word32 Word Source # 
Instance details

Defined in Data.Convertible.Instances.Num

Convertible Word32 Word8 Source # 
Instance details

Defined in Data.Convertible.Instances.Num

Convertible Word32 Word16 Source # 
Instance details

Defined in Data.Convertible.Instances.Num

Convertible Word32 Word64 Source # 
Instance details

Defined in Data.Convertible.Instances.Num

Convertible Word64 Char Source # 
Instance details

Defined in Data.Convertible.Instances.Num

Convertible Word64 Double Source # 
Instance details

Defined in Data.Convertible.Instances.Num

Convertible Word64 Float Source # 
Instance details

Defined in Data.Convertible.Instances.Num

Convertible Word64 Int Source # 
Instance details

Defined in Data.Convertible.Instances.Num

Convertible Word64 Int8 Source # 
Instance details

Defined in Data.Convertible.Instances.Num

Convertible Word64 Int16 Source # 
Instance details

Defined in Data.Convertible.Instances.Num

Convertible Word64 Int32 Source # 
Instance details

Defined in Data.Convertible.Instances.Num

Convertible Word64 Int64 Source # 
Instance details

Defined in Data.Convertible.Instances.Num

Convertible Word64 Integer Source # 
Instance details

Defined in Data.Convertible.Instances.Num

Convertible Word64 Rational Source # 
Instance details

Defined in Data.Convertible.Instances.Num

Convertible Word64 Word Source # 
Instance details

Defined in Data.Convertible.Instances.Num

Convertible Word64 Word8 Source # 
Instance details

Defined in Data.Convertible.Instances.Num

Convertible Word64 Word16 Source # 
Instance details

Defined in Data.Convertible.Instances.Num

Convertible Word64 Word32 Source # 
Instance details

Defined in Data.Convertible.Instances.Num

Handling the results

type ConvertResult a = Either ConvertError a Source #

The result of a safe conversion via safeConvert.