tensor-0.1.1: A completely type-safe library for linear algebra

Safe HaskellSafe-Infered

Data.TypeList

Description

The Module Data.TypeList is a collection of classes to manipulate lists of types, a.k.a. heterogeneous lists. Check the module Data.TypeList.MultiIndex for a concrete implementation of TypeList.

Synopsis

Documentation

class TypeList l whereSource

Every TypeList has a Length. The Length is actually a type, and should be a Cardinal (see Data.Cardinal).

Associated Types

type Length l Source

Methods

length :: l -> Length lSource

Instances

class (TypeList l, TypeList l') => AppendList l l' whereSource

A class for appending two TypeLists. The result of appending l and l' has type l :++: l'.

Associated Types

type l :++: l' Source

Methods

(<++>) :: l -> l' -> l :++: l'Source

Instances

TypeList l => AppendList Nil l 
AppendList l l' => AppendList (:|: e l) l' 

class (Cardinal n, TypeList l) => TakeList n l whereSource

This is does for TakeList what take does for ordinary lists.

Associated Types

type Take n l Source

Methods

take :: n -> l -> Take n lSource

Instances

class (Cardinal n, TypeList l) => DropList n l whereSource

This is does for TakeList what drop does for ordinary lists.

Associated Types

type Drop n l Source

Methods

drop :: n -> l -> Drop n lSource

Instances

class (TypeList l, TypeList l') => TailRevList l l' whereSource

Reverse l and append it in front of l'.

Associated Types

type TailRev l l' Source

Methods

rev :: l -> l' -> TailRev l l'Source

Instances

TypeList l => TailRevList Nil l 
(TailRevList l (:|: e l'), TypeList l') => TailRevList (:|: e l) l' 

class TypeList l => ReverseList l whereSource

Reverse the TypeList l, and get Reverse l.

Associated Types

type Reverse l Source

Methods

reverse :: l -> Reverse lSource

Instances

class JoinList n l l' whereSource

Join together TypeLists l and l' where the last n types of l coincide with the first n types of l'. The result has a the common n types eliminated.

Associated Types

type Join n l l' Source

Methods

join :: n -> l -> l' -> Join n l l'Source

Instances

(ReverseList (Drop n (Reverse l)), DropList n (Reverse l), ReverseList l, AppendList (Reverse (Drop n (Reverse l))) (Drop n l'), DropList n l', ~ * (Reverse (Take n (Reverse l))) (Take n l')) => JoinList n l l'