conversion-1.2.1: Universal converter between values of different types

Safe HaskellNone
LanguageHaskell2010

Conversion

Synopsis

Documentation

class Conversion a b where #

A type-class, which provides a non-partial conversion function from a value of type a to a value of type b.

Minimal complete definition

convert

Methods

convert :: a -> b #

Instances

Conversion Double Rational # 

Methods

convert :: Double -> Rational #

Conversion Float Double # 

Methods

convert :: Float -> Double #

Conversion Float Rational # 

Methods

convert :: Float -> Rational #

Conversion Int Int64 # 

Methods

convert :: Int -> Int64 #

Conversion Int Integer # 

Methods

convert :: Int -> Integer #

Conversion Int8 Int # 

Methods

convert :: Int8 -> Int #

Conversion Int8 Int16 # 

Methods

convert :: Int8 -> Int16 #

Conversion Int8 Int32 # 

Methods

convert :: Int8 -> Int32 #

Conversion Int8 Int64 # 

Methods

convert :: Int8 -> Int64 #

Conversion Int8 Integer # 

Methods

convert :: Int8 -> Integer #

Conversion Int16 Int # 

Methods

convert :: Int16 -> Int #

Conversion Int16 Int32 # 

Methods

convert :: Int16 -> Int32 #

Conversion Int16 Int64 # 

Methods

convert :: Int16 -> Int64 #

Conversion Int16 Integer # 

Methods

convert :: Int16 -> Integer #

Conversion Int32 Int # 

Methods

convert :: Int32 -> Int #

Conversion Int32 Int64 # 

Methods

convert :: Int32 -> Int64 #

Conversion Int32 Integer # 

Methods

convert :: Int32 -> Integer #

Conversion Int64 Integer # 

Methods

convert :: Int64 -> Integer #

Conversion Word Integer # 

Methods

convert :: Word -> Integer #

Conversion Word Word64 # 

Methods

convert :: Word -> Word64 #

Conversion Word8 Int # 

Methods

convert :: Word8 -> Int #

Conversion Word8 Int16 # 

Methods

convert :: Word8 -> Int16 #

Conversion Word8 Int32 # 

Methods

convert :: Word8 -> Int32 #

Conversion Word8 Int64 # 

Methods

convert :: Word8 -> Int64 #

Conversion Word8 Integer # 

Methods

convert :: Word8 -> Integer #

Conversion Word8 Word # 

Methods

convert :: Word8 -> Word #

Conversion Word8 Word16 # 

Methods

convert :: Word8 -> Word16 #

Conversion Word8 Word32 # 

Methods

convert :: Word8 -> Word32 #

Conversion Word8 Word64 # 

Methods

convert :: Word8 -> Word64 #

Conversion Word16 Int # 

Methods

convert :: Word16 -> Int #

Conversion Word16 Int32 # 

Methods

convert :: Word16 -> Int32 #

Conversion Word16 Int64 # 

Methods

convert :: Word16 -> Int64 #

Conversion Word16 Integer # 

Methods

convert :: Word16 -> Integer #

Conversion Word16 Word32 # 

Methods

convert :: Word16 -> Word32 #

Conversion Word16 Word64 # 

Methods

convert :: Word16 -> Word64 #

Conversion Word32 Int64 # 

Methods

convert :: Word32 -> Int64 #

Conversion Word32 Integer # 

Methods

convert :: Word32 -> Integer #

Conversion Word32 Word # 

Methods

convert :: Word32 -> Word #

Conversion Word32 Word64 # 

Methods

convert :: Word32 -> Word64 #

Conversion Word64 Integer # 

Methods

convert :: Word64 -> Integer #

Conversion a a #

Equivalent to id.

Methods

convert :: a -> a #

Alternative f => Conversion Int (f Word64) # 

Methods

convert :: Int -> f Word64 #

Alternative f => Conversion Int (f Word32) # 

Methods

convert :: Int -> f Word32 #

Alternative f => Conversion Int (f Word16) # 

Methods

convert :: Int -> f Word16 #

Alternative f => Conversion Int (f Word8) # 

Methods

convert :: Int -> f Word8 #

Alternative f => Conversion Int (f Word) # 

Methods

convert :: Int -> f Word #

Alternative f => Conversion Int (f Int32) # 

Methods

convert :: Int -> f Int32 #

Alternative f => Conversion Int (f Int16) # 

Methods

convert :: Int -> f Int16 #

Alternative f => Conversion Int (f Int8) # 

Methods

convert :: Int -> f Int8 #

Alternative f => Conversion Int8 (f Word64) # 

Methods

convert :: Int8 -> f Word64 #

Alternative f => Conversion Int8 (f Word32) # 

Methods

convert :: Int8 -> f Word32 #

Alternative f => Conversion Int8 (f Word16) # 

Methods

convert :: Int8 -> f Word16 #

Alternative f => Conversion Int8 (f Word8) # 

Methods

convert :: Int8 -> f Word8 #

Alternative f => Conversion Int8 (f Word) # 

Methods

convert :: Int8 -> f Word #

Alternative f => Conversion Int16 (f Word64) # 

Methods

convert :: Int16 -> f Word64 #

Alternative f => Conversion Int16 (f Word32) # 

Methods

convert :: Int16 -> f Word32 #

Alternative f => Conversion Int16 (f Word16) # 

Methods

convert :: Int16 -> f Word16 #

Alternative f => Conversion Int16 (f Word8) # 

Methods

convert :: Int16 -> f Word8 #

Alternative f => Conversion Int16 (f Word) # 

Methods

convert :: Int16 -> f Word #

Alternative f => Conversion Int16 (f Int8) # 

Methods

convert :: Int16 -> f Int8 #

Alternative f => Conversion Int32 (f Word64) # 

Methods

convert :: Int32 -> f Word64 #

Alternative f => Conversion Int32 (f Word32) # 

Methods

convert :: Int32 -> f Word32 #

Alternative f => Conversion Int32 (f Word16) # 

Methods

convert :: Int32 -> f Word16 #

Alternative f => Conversion Int32 (f Word8) # 

Methods

convert :: Int32 -> f Word8 #

Alternative f => Conversion Int32 (f Word) # 

Methods

convert :: Int32 -> f Word #

Alternative f => Conversion Int32 (f Int16) # 

Methods

convert :: Int32 -> f Int16 #

Alternative f => Conversion Int32 (f Int8) # 

Methods

convert :: Int32 -> f Int8 #

Alternative f => Conversion Int64 (f Word64) # 

Methods

convert :: Int64 -> f Word64 #

Alternative f => Conversion Int64 (f Word32) # 

Methods

convert :: Int64 -> f Word32 #

Alternative f => Conversion Int64 (f Word16) # 

Methods

convert :: Int64 -> f Word16 #

Alternative f => Conversion Int64 (f Word8) # 

Methods

convert :: Int64 -> f Word8 #

Alternative f => Conversion Int64 (f Word) # 

Methods

convert :: Int64 -> f Word #

Alternative f => Conversion Int64 (f Int32) # 

Methods

convert :: Int64 -> f Int32 #

Alternative f => Conversion Int64 (f Int16) # 

Methods

convert :: Int64 -> f Int16 #

Alternative f => Conversion Int64 (f Int8) # 

Methods

convert :: Int64 -> f Int8 #

Alternative f => Conversion Int64 (f Int) # 

Methods

convert :: Int64 -> f Int #

Alternative f => Conversion Integer (f Word64) # 

Methods

convert :: Integer -> f Word64 #

Alternative f => Conversion Integer (f Word32) # 

Methods

convert :: Integer -> f Word32 #

Alternative f => Conversion Integer (f Word16) # 

Methods

convert :: Integer -> f Word16 #

Alternative f => Conversion Integer (f Word8) # 

Methods

convert :: Integer -> f Word8 #

Alternative f => Conversion Integer (f Word) # 

Methods

convert :: Integer -> f Word #

Alternative f => Conversion Integer (f Int64) # 

Methods

convert :: Integer -> f Int64 #

Alternative f => Conversion Integer (f Int32) # 

Methods

convert :: Integer -> f Int32 #

Alternative f => Conversion Integer (f Int16) # 

Methods

convert :: Integer -> f Int16 #

Alternative f => Conversion Integer (f Int8) # 

Methods

convert :: Integer -> f Int8 #

Alternative f => Conversion Integer (f Int) # 

Methods

convert :: Integer -> f Int #

Alternative f => Conversion Word (f Word32) # 

Methods

convert :: Word -> f Word32 #

Alternative f => Conversion Word (f Word16) # 

Methods

convert :: Word -> f Word16 #

Alternative f => Conversion Word (f Word8) # 

Methods

convert :: Word -> f Word8 #

Alternative f => Conversion Word (f Int64) # 

Methods

convert :: Word -> f Int64 #

Alternative f => Conversion Word (f Int32) # 

Methods

convert :: Word -> f Int32 #

Alternative f => Conversion Word (f Int16) # 

Methods

convert :: Word -> f Int16 #

Alternative f => Conversion Word (f Int8) # 

Methods

convert :: Word -> f Int8 #

Alternative f => Conversion Word (f Int) # 

Methods

convert :: Word -> f Int #

Alternative f => Conversion Word8 (f Int8) # 

Methods

convert :: Word8 -> f Int8 #

Alternative f => Conversion Word16 (f Word8) # 

Methods

convert :: Word16 -> f Word8 #

Alternative f => Conversion Word16 (f Word) # 

Methods

convert :: Word16 -> f Word #

Alternative f => Conversion Word16 (f Int16) # 

Methods

convert :: Word16 -> f Int16 #

Alternative f => Conversion Word16 (f Int8) # 

Methods

convert :: Word16 -> f Int8 #

Alternative f => Conversion Word32 (f Word16) # 

Methods

convert :: Word32 -> f Word16 #

Alternative f => Conversion Word32 (f Word8) # 

Methods

convert :: Word32 -> f Word8 #

Alternative f => Conversion Word32 (f Int32) # 

Methods

convert :: Word32 -> f Int32 #

Alternative f => Conversion Word32 (f Int16) # 

Methods

convert :: Word32 -> f Int16 #

Alternative f => Conversion Word32 (f Int8) # 

Methods

convert :: Word32 -> f Int8 #

Alternative f => Conversion Word32 (f Int) # 

Methods

convert :: Word32 -> f Int #

Alternative f => Conversion Word64 (f Word32) # 

Methods

convert :: Word64 -> f Word32 #

Alternative f => Conversion Word64 (f Word16) # 

Methods

convert :: Word64 -> f Word16 #

Alternative f => Conversion Word64 (f Word8) # 

Methods

convert :: Word64 -> f Word8 #

Alternative f => Conversion Word64 (f Word) # 

Methods

convert :: Word64 -> f Word #

Alternative f => Conversion Word64 (f Int64) # 

Methods

convert :: Word64 -> f Int64 #

Alternative f => Conversion Word64 (f Int32) # 

Methods

convert :: Word64 -> f Int32 #

Alternative f => Conversion Word64 (f Int16) # 

Methods

convert :: Word64 -> f Int16 #

Alternative f => Conversion Word64 (f Int8) # 

Methods

convert :: Word64 -> f Int8 #

Alternative f => Conversion Word64 (f Int) # 

Methods

convert :: Word64 -> f Int #

Conversion [a] Bool #

Checks whether the list is not empty.

Methods

convert :: [a] -> Bool #

Conversion (Maybe a) Bool #

Checks whether the value is Just.

Methods

convert :: Maybe a -> Bool #

Conversion [Maybe a] [a] #

Equivalent to catMaybes.

Methods

convert :: [Maybe a] -> [a] #

Alternative f => Conversion [a] (f a) #

Gets the head of a list.

Methods

convert :: [a] -> f a #

Alternative f => Conversion (Maybe a) (f a) #

Converts to any Alternative type (Either, list).

Methods

convert :: Maybe a -> f a #

Conversion (STM a) (IO a) #

Equivalent to atomically.

Methods

convert :: STM a -> IO a #

Conversion (Maybe a) (a -> a) #

Converts into a function, which extracts the value, given a default value in the Nothing case.

Equivalent to fromMaybe.

Methods

convert :: Maybe a -> a -> a #

Conversion (Either a b) Bool #

Checks whether the value is Right.

Methods

convert :: Either a b -> Bool #

Alternative f => Conversion (Either a b) (f b) #

Converts to any Alternative type (Maybe, list).

Methods

convert :: Either a b -> f b #

convert1 :: Conversion (a x) (b x) => a x -> b x #

A utility, which helps the compiler resolve the type in case of conversion of types of kind * -> *.

convert2 :: Conversion (a x1 x2) (b x1 x2) => a x1 x2 -> b x1 x2 #

A utility, which helps the compiler resolve the type in case of conversion of types of kind * -> * -> *.