convert-1.5.1: Safe and unsafe data conversion utilities with strong type-level operation. checking.

Safe HaskellNone
LanguageHaskell2010

Data.Convert2.Class

Documentation

type IdConversionErr (a :: k) = ((Text "Conversion of the same type (`" :<>: ShowType a) :<>: Text "`)") :<>: Text " is disabled by default. Please use convert' if you want to enable it." Source #

class To tgt src where Source #

Methods

to :: src -> tgt Source #

Instances
(TypeError (IdConversionErr src) :: Constraint) => To src src Source # 
Instance details

Defined in Data.Convert2.Class

Methods

to :: src -> src Source #

To1 tgt src => To tgt (src t) Source # 
Instance details

Defined in Data.Convert2.Class

Methods

to :: src t -> tgt Source #

class To1 tgt src where Source #

Methods

to1 :: forall t1. src t1 -> tgt Source #

Instances
To2 tgt src => To1 tgt (src t :: k2 -> Type) Source # 
Instance details

Defined in Data.Convert2.Class

Methods

to1 :: src t t1 -> tgt Source #

(TypeError (IdConversionErr src) :: Constraint) => To1 (src t1) (src :: k -> Type) Source # 
Instance details

Defined in Data.Convert2.Class

Methods

to1 :: src t10 -> src t1 Source #

class To2 tgt src where Source #

Methods

to2 :: forall t1 t2. src t1 t2 -> tgt Source #

Instances
To3 tgt src => To2 tgt (src t :: k2 -> k3 -> Type) Source # 
Instance details

Defined in Data.Convert2.Class

Methods

to2 :: src t t1 t2 -> tgt Source #

(TypeError (IdConversionErr src) :: Constraint) => To2 (src t1 t2) (src :: k1 -> k2 -> Type) Source # 
Instance details

Defined in Data.Convert2.Class

Methods

to2 :: src t10 t20 -> src t1 t2 Source #

class To3 tgt src where Source #

Methods

to3 :: forall t1 t2 t3. src t1 t2 t3 -> tgt Source #

Instances
To4 tgt src => To3 tgt (src t :: k2 -> k3 -> k4 -> Type) Source # 
Instance details

Defined in Data.Convert2.Class

Methods

to3 :: src t t1 t2 t3 -> tgt Source #

(TypeError (IdConversionErr src) :: Constraint) => To3 (src t1 t2 t3) (src :: k1 -> k2 -> k3 -> Type) Source # 
Instance details

Defined in Data.Convert2.Class

Methods

to3 :: src t10 t20 t30 -> src t1 t2 t3 Source #

class To4 tgt src where Source #

Methods

to4 :: forall t1 t2 t3 t4. src t1 t2 t3 t4 -> tgt Source #

Instances
To5 tgt src => To4 tgt (src t :: k2 -> k3 -> k4 -> k5 -> Type) Source # 
Instance details

Defined in Data.Convert2.Class

Methods

to4 :: src t t1 t2 t3 t4 -> tgt Source #

(TypeError (IdConversionErr src) :: Constraint) => To4 (src t1 t2 t3 t4) (src :: k1 -> k2 -> k3 -> k4 -> Type) Source # 
Instance details

Defined in Data.Convert2.Class

Methods

to4 :: src t10 t20 t30 t40 -> src t1 t2 t3 t4 Source #

class To5 tgt src where Source #

Methods

to5 :: forall t1 t2 t3 t4 t5. src t1 t2 t3 t4 t5 -> tgt Source #

Instances
(TypeError (IdConversionErr src) :: Constraint) => To5 (src t1 t2 t3 t4 t5) (src :: k1 -> k2 -> k3 -> k4 -> k5 -> Type) Source # 
Instance details

Defined in Data.Convert2.Class

Methods

to5 :: src t10 t20 t30 t40 t50 -> src t1 t2 t3 t4 t5 Source #

class To' tgt src where Source #

Methods

to' :: src -> tgt Source #

Instances
To a b => To' a b Source # 
Instance details

Defined in Data.Convert2.Class

Methods

to' :: b -> a Source #

To' a a Source # 
Instance details

Defined in Data.Convert2.Class

Methods

to' :: a -> a Source #

class To1' tgt src where Source #

Methods

to1' :: forall t1. src t1 -> tgt Source #

class To2' tgt src where Source #

Methods

to2' :: forall t1 t2. src t1 t2 -> tgt Source #

class To3' tgt src where Source #

Methods

to3' :: forall t1 t2 t3. src t1 t2 t3 -> tgt Source #

class To4' tgt src where Source #

Methods

to4' :: forall t1 t2 t3 t4. src t1 t2 t3 t4 -> tgt Source #

class To5' tgt src where Source #

Methods

to5' :: forall t1 t2 t3 t4 t5. src t1 t2 t3 t4 t5 -> tgt Source #

class From tgt src where Source #

Methods

from :: tgt -> src Source #

Instances
(TypeError (IdConversionErr src) :: Constraint) => From src src Source # 
Instance details

Defined in Data.Convert2.Class

Methods

from :: src -> src Source #

From1 tgt src => From tgt (src t) Source # 
Instance details

Defined in Data.Convert2.Class

Methods

from :: tgt -> src t Source #

class From1 tgt src where Source #

Methods

from1 :: forall t1. tgt -> src t1 Source #

Instances
From2 tgt src => From1 tgt (src t :: k2 -> Type) Source # 
Instance details

Defined in Data.Convert2.Class

Methods

from1 :: tgt -> src t t1 Source #

(TypeError (IdConversionErr src) :: Constraint) => From1 (src t1) (src :: k -> Type) Source # 
Instance details

Defined in Data.Convert2.Class

Methods

from1 :: src t1 -> src t10 Source #

class From2 tgt src where Source #

Methods

from2 :: forall t1 t2. tgt -> src t1 t2 Source #

Instances
From3 tgt src => From2 tgt (src t :: k2 -> k3 -> Type) Source # 
Instance details

Defined in Data.Convert2.Class

Methods

from2 :: tgt -> src t t1 t2 Source #

(TypeError (IdConversionErr src) :: Constraint) => From2 (src t1 t2) (src :: k1 -> k2 -> Type) Source # 
Instance details

Defined in Data.Convert2.Class

Methods

from2 :: src t1 t2 -> src t10 t20 Source #

class From3 tgt src where Source #

Methods

from3 :: forall t1 t2 t3. tgt -> src t1 t2 t3 Source #

Instances
From4 tgt src => From3 tgt (src t :: k2 -> k3 -> k4 -> Type) Source # 
Instance details

Defined in Data.Convert2.Class

Methods

from3 :: tgt -> src t t1 t2 t3 Source #

(TypeError (IdConversionErr src) :: Constraint) => From3 (src t1 t2 t3) (src :: k1 -> k2 -> k3 -> Type) Source # 
Instance details

Defined in Data.Convert2.Class

Methods

from3 :: src t1 t2 t3 -> src t10 t20 t30 Source #

class From4 tgt src where Source #

Methods

from4 :: forall t1 t2 t3 t4. tgt -> src t1 t2 t3 t4 Source #

Instances
From5 tgt src => From4 tgt (src t :: k2 -> k3 -> k4 -> k5 -> Type) Source # 
Instance details

Defined in Data.Convert2.Class

Methods

from4 :: tgt -> src t t1 t2 t3 t4 Source #

(TypeError (IdConversionErr src) :: Constraint) => From4 (src t1 t2 t3 t4) (src :: k1 -> k2 -> k3 -> k4 -> Type) Source # 
Instance details

Defined in Data.Convert2.Class

Methods

from4 :: src t1 t2 t3 t4 -> src t10 t20 t30 t40 Source #

class From5 tgt src where Source #

Methods

from5 :: forall t1 t2 t3 t4 t5. tgt -> src t1 t2 t3 t4 t5 Source #

Instances
(TypeError (IdConversionErr src) :: Constraint) => From5 (src t1 t2 t3 t4 t5) (src :: k1 -> k2 -> k3 -> k4 -> k5 -> Type) Source # 
Instance details

Defined in Data.Convert2.Class

Methods

from5 :: src t1 t2 t3 t4 t5 -> src t10 t20 t30 t40 t50 Source #

class From' tgt src where Source #

Methods

from' :: tgt -> src Source #

Instances
From a b => From' a b Source # 
Instance details

Defined in Data.Convert2.Class

Methods

from' :: a -> b Source #

From' a a Source # 
Instance details

Defined in Data.Convert2.Class

Methods

from' :: a -> a Source #

class From1' tgt src where Source #

Methods

from1' :: forall t1. tgt -> src t1 Source #

class From2' tgt src where Source #

Methods

from2' :: forall t1 t2. tgt -> src t1 t2 Source #

class From3' tgt src where Source #

Methods

from3' :: forall t1 t2 t3. tgt -> src t1 t2 t3 Source #

class From4' tgt src where Source #

Methods

from4' :: forall t1 t2 t3 t4. tgt -> src t1 t2 t3 t4 Source #

class From5' tgt src where Source #

Methods

from5' :: forall t1 t2 t3 t4 t5. tgt -> src t1 t2 t3 t4 t5 Source #

class UnsafeTo tgt src where Source #

Methods

unsafeTo :: src -> tgt Source #

Instances
(TypeError (IdConversionErr src) :: Constraint) => UnsafeTo src src Source # 
Instance details

Defined in Data.Convert2.Class

Methods

unsafeTo :: src -> src Source #

UnsafeTo1 tgt src => UnsafeTo tgt (src t) Source # 
Instance details

Defined in Data.Convert2.Class

Methods

unsafeTo :: src t -> tgt Source #

class UnsafeTo1 tgt src where Source #

Methods

unsafeTo1 :: forall t1. src t1 -> tgt Source #

Instances
UnsafeTo2 tgt src => UnsafeTo1 tgt (src t :: k2 -> Type) Source # 
Instance details

Defined in Data.Convert2.Class

Methods

unsafeTo1 :: src t t1 -> tgt Source #

(TypeError (IdConversionErr src) :: Constraint) => UnsafeTo1 (src t1) (src :: k -> Type) Source # 
Instance details

Defined in Data.Convert2.Class

Methods

unsafeTo1 :: src t10 -> src t1 Source #

class UnsafeTo2 tgt src where Source #

Methods

unsafeTo2 :: forall t1 t2. src t1 t2 -> tgt Source #

Instances
UnsafeTo3 tgt src => UnsafeTo2 tgt (src t :: k2 -> k3 -> Type) Source # 
Instance details

Defined in Data.Convert2.Class

Methods

unsafeTo2 :: src t t1 t2 -> tgt Source #

(TypeError (IdConversionErr src) :: Constraint) => UnsafeTo2 (src t1 t2) (src :: k1 -> k2 -> Type) Source # 
Instance details

Defined in Data.Convert2.Class

Methods

unsafeTo2 :: src t10 t20 -> src t1 t2 Source #

class UnsafeTo3 tgt src where Source #

Methods

unsafeTo3 :: forall t1 t2 t3. src t1 t2 t3 -> tgt Source #

Instances
UnsafeTo4 tgt src => UnsafeTo3 tgt (src t :: k2 -> k3 -> k4 -> Type) Source # 
Instance details

Defined in Data.Convert2.Class

Methods

unsafeTo3 :: src t t1 t2 t3 -> tgt Source #

(TypeError (IdConversionErr src) :: Constraint) => UnsafeTo3 (src t1 t2 t3) (src :: k1 -> k2 -> k3 -> Type) Source # 
Instance details

Defined in Data.Convert2.Class

Methods

unsafeTo3 :: src t10 t20 t30 -> src t1 t2 t3 Source #

class UnsafeTo4 tgt src where Source #

Methods

unsafeTo4 :: forall t1 t2 t3 t4. src t1 t2 t3 t4 -> tgt Source #

Instances
UnsafeTo5 tgt src => UnsafeTo4 tgt (src t :: k2 -> k3 -> k4 -> k5 -> Type) Source # 
Instance details

Defined in Data.Convert2.Class

Methods

unsafeTo4 :: src t t1 t2 t3 t4 -> tgt Source #

(TypeError (IdConversionErr src) :: Constraint) => UnsafeTo4 (src t1 t2 t3 t4) (src :: k1 -> k2 -> k3 -> k4 -> Type) Source # 
Instance details

Defined in Data.Convert2.Class

Methods

unsafeTo4 :: src t10 t20 t30 t40 -> src t1 t2 t3 t4 Source #

class UnsafeTo5 tgt src where Source #

Methods

unsafeTo5 :: forall t1 t2 t3 t4 t5. src t1 t2 t3 t4 t5 -> tgt Source #

Instances
(TypeError (IdConversionErr src) :: Constraint) => UnsafeTo5 (src t1 t2 t3 t4 t5) (src :: k1 -> k2 -> k3 -> k4 -> k5 -> Type) Source # 
Instance details

Defined in Data.Convert2.Class

Methods

unsafeTo5 :: src t10 t20 t30 t40 t50 -> src t1 t2 t3 t4 t5 Source #

class UnsafeTo' tgt src where Source #

Methods

unsafeTo' :: src -> tgt Source #

class UnsafeTo1' tgt src where Source #

Methods

unsafeTo1' :: forall t1. src t1 -> tgt Source #

class UnsafeTo2' tgt src where Source #

Methods

unsafeTo2' :: forall t1 t2. src t1 t2 -> tgt Source #

class UnsafeTo3' tgt src where Source #

Methods

unsafeTo3' :: forall t1 t2 t3. src t1 t2 t3 -> tgt Source #

class UnsafeTo4' tgt src where Source #

Methods

unsafeTo4' :: forall t1 t2 t3 t4. src t1 t2 t3 t4 -> tgt Source #

class UnsafeTo5' tgt src where Source #

Methods

unsafeTo5' :: forall t1 t2 t3 t4 t5. src t1 t2 t3 t4 t5 -> tgt Source #

class UnsafeFrom tgt src where Source #

Methods

unsafeFrom :: tgt -> src Source #

Instances
(TypeError (IdConversionErr src) :: Constraint) => UnsafeFrom src src Source # 
Instance details

Defined in Data.Convert2.Class

Methods

unsafeFrom :: src -> src Source #

UnsafeFrom1 tgt src => UnsafeFrom tgt (src t) Source # 
Instance details

Defined in Data.Convert2.Class

Methods

unsafeFrom :: tgt -> src t Source #

class UnsafeFrom1 tgt src where Source #

Methods

unsafeFrom1 :: forall t1. tgt -> src t1 Source #

Instances
UnsafeFrom2 tgt src => UnsafeFrom1 tgt (src t :: k2 -> Type) Source # 
Instance details

Defined in Data.Convert2.Class

Methods

unsafeFrom1 :: tgt -> src t t1 Source #

(TypeError (IdConversionErr src) :: Constraint) => UnsafeFrom1 (src t1) (src :: k -> Type) Source # 
Instance details

Defined in Data.Convert2.Class

Methods

unsafeFrom1 :: src t1 -> src t10 Source #

class UnsafeFrom2 tgt src where Source #

Methods

unsafeFrom2 :: forall t1 t2. tgt -> src t1 t2 Source #

Instances
UnsafeFrom3 tgt src => UnsafeFrom2 tgt (src t :: k2 -> k3 -> Type) Source # 
Instance details

Defined in Data.Convert2.Class

Methods

unsafeFrom2 :: tgt -> src t t1 t2 Source #

(TypeError (IdConversionErr src) :: Constraint) => UnsafeFrom2 (src t1 t2) (src :: k1 -> k2 -> Type) Source # 
Instance details

Defined in Data.Convert2.Class

Methods

unsafeFrom2 :: src t1 t2 -> src t10 t20 Source #

class UnsafeFrom3 tgt src where Source #

Methods

unsafeFrom3 :: forall t1 t2 t3. tgt -> src t1 t2 t3 Source #

Instances
UnsafeFrom4 tgt src => UnsafeFrom3 tgt (src t :: k2 -> k3 -> k4 -> Type) Source # 
Instance details

Defined in Data.Convert2.Class

Methods

unsafeFrom3 :: tgt -> src t t1 t2 t3 Source #

(TypeError (IdConversionErr src) :: Constraint) => UnsafeFrom3 (src t1 t2 t3) (src :: k1 -> k2 -> k3 -> Type) Source # 
Instance details

Defined in Data.Convert2.Class

Methods

unsafeFrom3 :: src t1 t2 t3 -> src t10 t20 t30 Source #

class UnsafeFrom4 tgt src where Source #

Methods

unsafeFrom4 :: forall t1 t2 t3 t4. tgt -> src t1 t2 t3 t4 Source #

Instances
UnsafeFrom5 tgt src => UnsafeFrom4 tgt (src t :: k2 -> k3 -> k4 -> k5 -> Type) Source # 
Instance details

Defined in Data.Convert2.Class

Methods

unsafeFrom4 :: tgt -> src t t1 t2 t3 t4 Source #

(TypeError (IdConversionErr src) :: Constraint) => UnsafeFrom4 (src t1 t2 t3 t4) (src :: k1 -> k2 -> k3 -> k4 -> Type) Source # 
Instance details

Defined in Data.Convert2.Class

Methods

unsafeFrom4 :: src t1 t2 t3 t4 -> src t10 t20 t30 t40 Source #

class UnsafeFrom5 tgt src where Source #

Methods

unsafeFrom5 :: forall t1 t2 t3 t4 t5. tgt -> src t1 t2 t3 t4 t5 Source #

Instances
(TypeError (IdConversionErr src) :: Constraint) => UnsafeFrom5 (src t1 t2 t3 t4 t5) (src :: k1 -> k2 -> k3 -> k4 -> k5 -> Type) Source # 
Instance details

Defined in Data.Convert2.Class

Methods

unsafeFrom5 :: src t1 t2 t3 t4 t5 -> src t10 t20 t30 t40 t50 Source #

class UnsafeFrom' tgt src where Source #

Methods

unsafeFrom' :: tgt -> src Source #

class UnsafeFrom1' tgt src where Source #

Methods

unsafeFrom1' :: forall t1. tgt -> src t1 Source #

class UnsafeFrom2' tgt src where Source #

Methods

unsafeFrom2' :: forall t1 t2. tgt -> src t1 t2 Source #

class UnsafeFrom3' tgt src where Source #

Methods

unsafeFrom3' :: forall t1 t2 t3. tgt -> src t1 t2 t3 Source #

class UnsafeFrom4' tgt src where Source #

Methods

unsafeFrom4' :: forall t1 t2 t3 t4. tgt -> src t1 t2 t3 t4 Source #

class UnsafeFrom5' tgt src where Source #

Methods

unsafeFrom5' :: forall t1 t2 t3 t4 t5. tgt -> src t1 t2 t3 t4 t5 Source #

convert :: forall tgt src. To tgt src => src -> tgt Source #

convert1 :: forall tgt src t1. To1 tgt src => src t1 -> tgt Source #

convert2 :: forall tgt src t1 t2. To2 tgt src => src t1 t2 -> tgt Source #

unsafeConvert :: forall tgt src. UnsafeTo tgt src => src -> tgt Source #

unsafeConvert1 :: forall tgt src t1. UnsafeTo1 tgt src => src t1 -> tgt Source #

unsafeConvert2 :: forall tgt src t1 t2. UnsafeTo2 tgt src => src t1 t2 -> tgt Source #

convert' :: forall tgt src. To' tgt src => src -> tgt Source #

convert1' :: forall tgt src t1. To1' tgt src => src t1 -> tgt Source #

convert2' :: forall tgt src t1 t2. To2' tgt src => src t1 t2 -> tgt Source #

unsafeConvert' :: forall tgt src. UnsafeTo' tgt src => src -> tgt Source #

unsafeConvert1' :: forall tgt src t1. UnsafeTo1' tgt src => src t1 -> tgt Source #

unsafeConvert2' :: forall tgt src t1 t2. UnsafeTo2' tgt src => src t1 t2 -> tgt Source #

type Bi tgt src = (To tgt src, From tgt src) Source #

type Bi1 tgt src = (To1 tgt src, From1 tgt src) Source #

type Bi2 tgt src = (To2 tgt src, From2 tgt src) Source #

type Bi3 tgt src = (To3 tgt src, From3 tgt src) Source #

type Bi4 tgt src = (To4 tgt src, From4 tgt src) Source #

type Bi5 tgt src = (To5 tgt src, From5 tgt src) Source #

type Bi' tgt src = (To' tgt src, From' tgt src) Source #

type Bi1' tgt src = (To1' tgt src, From1' tgt src) Source #

type Bi2' tgt src = (To2' tgt src, From2' tgt src) Source #

type Bi3' tgt src = (To3' tgt src, From3' tgt src) Source #

type Bi4' tgt src = (To4' tgt src, From4' tgt src) Source #

type Bi5' tgt src = (To5' tgt src, From5' tgt src) Source #