yarr-1.4.0.2: Yet another array library

Safe HaskellNone
LanguageHaskell98

Data.Yarr.Flow

Contents

Description

Dataflow (fusion operations)

Synopsis

Basic fusion

class Fusion r fr l sh => DefaultFusion r fr l sh | r -> fr where Source #

This class abstracts pair of array types, which could be (preferably should be) mapped (fused) one to another. Injective version of Fusion class.

Parameters:

  • r - source array representation. It determines result representation.
  • fr (fused repr) - result (fused) array representation. Result array isn't indeed presented in memory, finally it should be computed or Loaded to Manifest representation.
  • l - load type, common for source and fused arrays
  • sh - shape of arrays

All functions are already defined, using non-injective versions from Fusion class.

The class doesn't have vector counterpart, it's role play top-level functions from Data.Yarr.Repr.Separate module.

Methods

dmap :: (USource r l sh a, USource fr l sh b) => (a -> b) -> UArray r l sh a -> UArray fr l sh b Source #

O(1) Pure element mapping.

Main basic "map" in Yarr.

dmapM :: (USource r l sh a, USource fr l sh b) => (a -> IO b) -> UArray r l sh a -> UArray fr l sh b Source #

O(1) Monadic element mapping.

dzip2 :: (USource r l sh a, USource r l sh b, USource fr l sh c) => (a -> b -> c) -> UArray r l sh a -> UArray r l sh b -> UArray fr l sh c Source #

O(1) Zipping 2 arrays of the same type indexes and shapes.

Example:

let productArr = dzip2 (*) arr1 arr2

dzip2M :: (USource r l sh a, USource r l sh b, USource fr l sh c) => (a -> b -> IO c) -> UArray r l sh a -> UArray r l sh b -> UArray fr l sh c Source #

O(1) Monadic version of dzip2 function.

dzip3 :: (USource r l sh a, USource r l sh b, USource r l sh c, USource fr l sh d) => (a -> b -> c -> d) -> UArray r l sh a -> UArray r l sh b -> UArray r l sh c -> UArray fr l sh d Source #

O(1) Zipping 3 arrays of the same type indexes and shapes.

dzip3M :: (USource r l sh a, USource r l sh b, USource r l sh c, USource fr l sh d) => (a -> b -> c -> IO d) -> UArray r l sh a -> UArray r l sh b -> UArray r l sh c -> UArray fr l sh d Source #

O(1) Monadic version of dzip3 function.

dzip :: (USource r l sh a, USource fr l sh b, Arity n, n ~ S n0) => Fun n a b -> VecList n (UArray r l sh a) -> UArray fr l sh b Source #

O(1) Generalized element zipping with pure function. Zipper function is wrapped in Fun for injectivity.

dzipM :: (USource r l sh a, USource fr l sh b, Arity n, n ~ S n0) => Fun n a (IO b) -> VecList n (UArray r l sh a) -> UArray fr l sh b Source #

O(1) Monadic version of dzip function.

Instances

Shape sh => DefaultFusion D D SH sh Source # 

Methods

dmap :: (USource D SH sh a, USource D SH sh b) => (a -> b) -> UArray D SH sh a -> UArray D SH sh b Source #

dmapM :: (USource D SH sh a, USource D SH sh b) => (a -> IO b) -> UArray D SH sh a -> UArray D SH sh b Source #

dzip2 :: (USource D SH sh a, USource D SH sh b, USource D SH sh c) => (a -> b -> c) -> UArray D SH sh a -> UArray D SH sh b -> UArray D SH sh c Source #

dzip2M :: (USource D SH sh a, USource D SH sh b, USource D SH sh c) => (a -> b -> IO c) -> UArray D SH sh a -> UArray D SH sh b -> UArray D SH sh c Source #

dzip3 :: (USource D SH sh a, USource D SH sh b, USource D SH sh c, USource D SH sh d) => (a -> b -> c -> d) -> UArray D SH sh a -> UArray D SH sh b -> UArray D SH sh c -> UArray D SH sh d Source #

dzip3M :: (USource D SH sh a, USource D SH sh b, USource D SH sh c, USource D SH sh d) => (a -> b -> c -> IO d) -> UArray D SH sh a -> UArray D SH sh b -> UArray D SH sh c -> UArray D SH sh d Source #

dzip :: (USource D SH sh a, USource D SH sh b, Arity n, (* ~ n) (S n0)) => Fun n a b -> VecList n (UArray D SH sh a) -> UArray D SH sh b Source #

dzipM :: (USource D SH sh a, USource D SH sh b, Arity n, (* ~ n) (S n0)) => Fun n a (IO b) -> VecList n (UArray D SH sh a) -> UArray D SH sh b Source #

DefaultFusion D D L sh Source # 

Methods

dmap :: (USource D L sh a, USource D L sh b) => (a -> b) -> UArray D L sh a -> UArray D L sh b Source #

dmapM :: (USource D L sh a, USource D L sh b) => (a -> IO b) -> UArray D L sh a -> UArray D L sh b Source #

dzip2 :: (USource D L sh a, USource D L sh b, USource D L sh c) => (a -> b -> c) -> UArray D L sh a -> UArray D L sh b -> UArray D L sh c Source #

dzip2M :: (USource D L sh a, USource D L sh b, USource D L sh c) => (a -> b -> IO c) -> UArray D L sh a -> UArray D L sh b -> UArray D L sh c Source #

dzip3 :: (USource D L sh a, USource D L sh b, USource D L sh c, USource D L sh d) => (a -> b -> c -> d) -> UArray D L sh a -> UArray D L sh b -> UArray D L sh c -> UArray D L sh d Source #

dzip3M :: (USource D L sh a, USource D L sh b, USource D L sh c, USource D L sh d) => (a -> b -> c -> IO d) -> UArray D L sh a -> UArray D L sh b -> UArray D L sh c -> UArray D L sh d Source #

dzip :: (USource D L sh a, USource D L sh b, Arity n, (* ~ n) (S n0)) => Fun n a b -> VecList n (UArray D L sh a) -> UArray D L sh b Source #

dzipM :: (USource D L sh a, USource D L sh b, Arity n, (* ~ n) (S n0)) => Fun n a (IO b) -> VecList n (UArray D L sh a) -> UArray D L sh b Source #

DefaultFusion FS D L sh Source # 

Methods

dmap :: (USource FS L sh a, USource D L sh b) => (a -> b) -> UArray FS L sh a -> UArray D L sh b Source #

dmapM :: (USource FS L sh a, USource D L sh b) => (a -> IO b) -> UArray FS L sh a -> UArray D L sh b Source #

dzip2 :: (USource FS L sh a, USource FS L sh b, USource D L sh c) => (a -> b -> c) -> UArray FS L sh a -> UArray FS L sh b -> UArray D L sh c Source #

dzip2M :: (USource FS L sh a, USource FS L sh b, USource D L sh c) => (a -> b -> IO c) -> UArray FS L sh a -> UArray FS L sh b -> UArray D L sh c Source #

dzip3 :: (USource FS L sh a, USource FS L sh b, USource FS L sh c, USource D L sh d) => (a -> b -> c -> d) -> UArray FS L sh a -> UArray FS L sh b -> UArray FS L sh c -> UArray D L sh d Source #

dzip3M :: (USource FS L sh a, USource FS L sh b, USource FS L sh c, USource D L sh d) => (a -> b -> c -> IO d) -> UArray FS L sh a -> UArray FS L sh b -> UArray FS L sh c -> UArray D L sh d Source #

dzip :: (USource FS L sh a, USource D L sh b, Arity n, (* ~ n) (S n0)) => Fun n a b -> VecList n (UArray FS L sh a) -> UArray D L sh b Source #

dzipM :: (USource FS L sh a, USource D L sh b, Arity n, (* ~ n) (S n0)) => Fun n a (IO b) -> VecList n (UArray FS L sh a) -> UArray D L sh b Source #

DefaultFusion F D L sh Source # 

Methods

dmap :: (USource F L sh a, USource D L sh b) => (a -> b) -> UArray F L sh a -> UArray D L sh b Source #

dmapM :: (USource F L sh a, USource D L sh b) => (a -> IO b) -> UArray F L sh a -> UArray D L sh b Source #

dzip2 :: (USource F L sh a, USource F L sh b, USource D L sh c) => (a -> b -> c) -> UArray F L sh a -> UArray F L sh b -> UArray D L sh c Source #

dzip2M :: (USource F L sh a, USource F L sh b, USource D L sh c) => (a -> b -> IO c) -> UArray F L sh a -> UArray F L sh b -> UArray D L sh c Source #

dzip3 :: (USource F L sh a, USource F L sh b, USource F L sh c, USource D L sh d) => (a -> b -> c -> d) -> UArray F L sh a -> UArray F L sh b -> UArray F L sh c -> UArray D L sh d Source #

dzip3M :: (USource F L sh a, USource F L sh b, USource F L sh c, USource D L sh d) => (a -> b -> c -> IO d) -> UArray F L sh a -> UArray F L sh b -> UArray F L sh c -> UArray D L sh d Source #

dzip :: (USource F L sh a, USource D L sh b, Arity n, (* ~ n) (S n0)) => Fun n a b -> VecList n (UArray F L sh a) -> UArray D L sh b Source #

dzipM :: (USource F L sh a, USource D L sh b, Arity n, (* ~ n) (S n0)) => Fun n a (IO b) -> VecList n (UArray F L sh a) -> UArray D L sh b Source #

DefaultFusion MB D L sh Source # 

Methods

dmap :: (USource MB L sh a, USource D L sh b) => (a -> b) -> UArray MB L sh a -> UArray D L sh b Source #

dmapM :: (USource MB L sh a, USource D L sh b) => (a -> IO b) -> UArray MB L sh a -> UArray D L sh b Source #

dzip2 :: (USource MB L sh a, USource MB L sh b, USource D L sh c) => (a -> b -> c) -> UArray MB L sh a -> UArray MB L sh b -> UArray D L sh c Source #

dzip2M :: (USource MB L sh a, USource MB L sh b, USource D L sh c) => (a -> b -> IO c) -> UArray MB L sh a -> UArray MB L sh b -> UArray D L sh c Source #

dzip3 :: (USource MB L sh a, USource MB L sh b, USource MB L sh c, USource D L sh d) => (a -> b -> c -> d) -> UArray MB L sh a -> UArray MB L sh b -> UArray MB L sh c -> UArray D L sh d Source #

dzip3M :: (USource MB L sh a, USource MB L sh b, USource MB L sh c, USource D L sh d) => (a -> b -> c -> IO d) -> UArray MB L sh a -> UArray MB L sh b -> UArray MB L sh c -> UArray D L sh d Source #

dzip :: (USource MB L sh a, USource D L sh b, Arity n, (* ~ n) (S n0)) => Fun n a b -> VecList n (UArray MB L sh a) -> UArray D L sh b Source #

dzipM :: (USource MB L sh a, USource D L sh b, Arity n, (* ~ n) (S n0)) => Fun n a (IO b) -> VecList n (UArray MB L sh a) -> UArray D L sh b Source #

DefaultFusion B D L sh Source # 

Methods

dmap :: (USource B L sh a, USource D L sh b) => (a -> b) -> UArray B L sh a -> UArray D L sh b Source #

dmapM :: (USource B L sh a, USource D L sh b) => (a -> IO b) -> UArray B L sh a -> UArray D L sh b Source #

dzip2 :: (USource B L sh a, USource B L sh b, USource D L sh c) => (a -> b -> c) -> UArray B L sh a -> UArray B L sh b -> UArray D L sh c Source #

dzip2M :: (USource B L sh a, USource B L sh b, USource D L sh c) => (a -> b -> IO c) -> UArray B L sh a -> UArray B L sh b -> UArray D L sh c Source #

dzip3 :: (USource B L sh a, USource B L sh b, USource B L sh c, USource D L sh d) => (a -> b -> c -> d) -> UArray B L sh a -> UArray B L sh b -> UArray B L sh c -> UArray D L sh d Source #

dzip3M :: (USource B L sh a, USource B L sh b, USource B L sh c, USource D L sh d) => (a -> b -> c -> IO d) -> UArray B L sh a -> UArray B L sh b -> UArray B L sh c -> UArray D L sh d Source #

dzip :: (USource B L sh a, USource D L sh b, Arity n, (* ~ n) (S n0)) => Fun n a b -> VecList n (UArray B L sh a) -> UArray D L sh b Source #

dzipM :: (USource B L sh a, USource D L sh b, Arity n, (* ~ n) (S n0)) => Fun n a (IO b) -> VecList n (UArray B L sh a) -> UArray D L sh b Source #

Shape sh => DefaultFusion CV CV CVL sh Source # 

Methods

dmap :: (USource CV CVL sh a, USource CV CVL sh b) => (a -> b) -> UArray CV CVL sh a -> UArray CV CVL sh b Source #

dmapM :: (USource CV CVL sh a, USource CV CVL sh b) => (a -> IO b) -> UArray CV CVL sh a -> UArray CV CVL sh b Source #

dzip2 :: (USource CV CVL sh a, USource CV CVL sh b, USource CV CVL sh c) => (a -> b -> c) -> UArray CV CVL sh a -> UArray CV CVL sh b -> UArray CV CVL sh c Source #

dzip2M :: (USource CV CVL sh a, USource CV CVL sh b, USource CV CVL sh c) => (a -> b -> IO c) -> UArray CV CVL sh a -> UArray CV CVL sh b -> UArray CV CVL sh c Source #

dzip3 :: (USource CV CVL sh a, USource CV CVL sh b, USource CV CVL sh c, USource CV CVL sh d) => (a -> b -> c -> d) -> UArray CV CVL sh a -> UArray CV CVL sh b -> UArray CV CVL sh c -> UArray CV CVL sh d Source #

dzip3M :: (USource CV CVL sh a, USource CV CVL sh b, USource CV CVL sh c, USource CV CVL sh d) => (a -> b -> c -> IO d) -> UArray CV CVL sh a -> UArray CV CVL sh b -> UArray CV CVL sh c -> UArray CV CVL sh d Source #

dzip :: (USource CV CVL sh a, USource CV CVL sh b, Arity n, (* ~ n) (S n0)) => Fun n a b -> VecList n (UArray CV CVL sh a) -> UArray CV CVL sh b Source #

dzipM :: (USource CV CVL sh a, USource CV CVL sh b, Arity n, (* ~ n) (S n0)) => Fun n a (IO b) -> VecList n (UArray CV CVL sh a) -> UArray CV CVL sh b Source #

(DefaultFusion r D l sh, Fusion (SE r) D l sh) => DefaultFusion (SE r) D l sh Source # 

Methods

dmap :: (USource (SE r) l sh a, USource D l sh b) => (a -> b) -> UArray (SE r) l sh a -> UArray D l sh b Source #

dmapM :: (USource (SE r) l sh a, USource D l sh b) => (a -> IO b) -> UArray (SE r) l sh a -> UArray D l sh b Source #

dzip2 :: (USource (SE r) l sh a, USource (SE r) l sh b, USource D l sh c) => (a -> b -> c) -> UArray (SE r) l sh a -> UArray (SE r) l sh b -> UArray D l sh c Source #

dzip2M :: (USource (SE r) l sh a, USource (SE r) l sh b, USource D l sh c) => (a -> b -> IO c) -> UArray (SE r) l sh a -> UArray (SE r) l sh b -> UArray D l sh c Source #

dzip3 :: (USource (SE r) l sh a, USource (SE r) l sh b, USource (SE r) l sh c, USource D l sh d) => (a -> b -> c -> d) -> UArray (SE r) l sh a -> UArray (SE r) l sh b -> UArray (SE r) l sh c -> UArray D l sh d Source #

dzip3M :: (USource (SE r) l sh a, USource (SE r) l sh b, USource (SE r) l sh c, USource D l sh d) => (a -> b -> c -> IO d) -> UArray (SE r) l sh a -> UArray (SE r) l sh b -> UArray (SE r) l sh c -> UArray D l sh d Source #

dzip :: (USource (SE r) l sh a, USource D l sh b, Arity n, (* ~ n) (S n0)) => Fun n a b -> VecList n (UArray (SE r) l sh a) -> UArray D l sh b Source #

dzipM :: (USource (SE r) l sh a, USource D l sh b, Arity n, (* ~ n) (S n0)) => Fun n a (IO b) -> VecList n (UArray (SE r) l sh a) -> UArray D l sh b Source #

class IFusion r l fr fl sh => DefaultIFusion r l fr fl sh | r l -> fr where Source #

Like DefaultFusion, this class abstracts the pair array types, which should be fused one to another on maps and zips which accept index of element (several elements for zips) in array (arrays).

Parameters:

  • r - source array representation. Determines result representation.
  • l - source load type
  • fr (fused repr) - result (fused) array representation. Result array isn't indeed presented in memory, finally it should be computed or Loaded to Manifest representation.
  • fl - result, "shaped" load type
  • sh - shape of arrays

All functions are already defined, using non-injective versions from IFusion class.

The class doesn't have vector counterpart.

Methods

imap :: (USource r l sh a, USource fr fl sh b) => (sh -> a -> b) -> UArray r l sh a -> UArray fr fl sh b Source #

O(1) Pure element mapping with array index.

imapM :: (USource r l sh a, USource fr fl sh b) => (sh -> a -> IO b) -> UArray r l sh a -> UArray fr fl sh b Source #

O(1) Monadic element mapping with index.

izip2 :: (USource r l sh a, USource r l sh b, USource fr fl sh c) => (sh -> a -> b -> c) -> UArray r l sh a -> UArray r l sh b -> UArray fr fl sh c Source #

O(1) Pure zipping of 2 arrays with index.

izip2M :: (USource r l sh a, USource r l sh b, USource fr fl sh c) => (sh -> a -> b -> IO c) -> UArray r l sh a -> UArray r l sh b -> UArray fr fl sh c Source #

O(1) Monadic zipping of 2 arrays with index.

izip3 :: (USource r l sh a, USource r l sh b, USource r l sh c, USource fr fl sh d) => (sh -> a -> b -> c -> d) -> UArray r l sh a -> UArray r l sh b -> UArray r l sh c -> UArray fr fl sh d Source #

O(1) Pure zipping of 3 arrays with index.

izip3M :: (USource r l sh a, USource r l sh b, USource r l sh c, USource fr fl sh d) => (sh -> a -> b -> c -> IO d) -> UArray r l sh a -> UArray r l sh b -> UArray r l sh c -> UArray fr fl sh d Source #

O(1) Monadic zipping of 3 arrays with index.

izip :: (USource r l sh a, USource fr fl sh b, Arity n, n ~ S n0) => (sh -> Fun n a b) -> VecList n (UArray r l sh a) -> UArray fr fl sh b Source #

O(1) Generalized pure element zipping with index in arrays. Zipper function is wrapped in Fun for injectivity.

izipM :: (USource r l sh a, USource fr fl sh b, Arity n, n ~ S n0) => (sh -> Fun n a (IO b)) -> VecList n (UArray r l sh a) -> UArray fr fl sh b Source #

O(1) Monadic version of izip function.

Instances

Shape sh => DefaultIFusion D SH D SH sh Source # 

Methods

imap :: (USource D SH sh a, USource D SH sh b) => (sh -> a -> b) -> UArray D SH sh a -> UArray D SH sh b Source #

imapM :: (USource D SH sh a, USource D SH sh b) => (sh -> a -> IO b) -> UArray D SH sh a -> UArray D SH sh b Source #

izip2 :: (USource D SH sh a, USource D SH sh b, USource D SH sh c) => (sh -> a -> b -> c) -> UArray D SH sh a -> UArray D SH sh b -> UArray D SH sh c Source #

izip2M :: (USource D SH sh a, USource D SH sh b, USource D SH sh c) => (sh -> a -> b -> IO c) -> UArray D SH sh a -> UArray D SH sh b -> UArray D SH sh c Source #

izip3 :: (USource D SH sh a, USource D SH sh b, USource D SH sh c, USource D SH sh d) => (sh -> a -> b -> c -> d) -> UArray D SH sh a -> UArray D SH sh b -> UArray D SH sh c -> UArray D SH sh d Source #

izip3M :: (USource D SH sh a, USource D SH sh b, USource D SH sh c, USource D SH sh d) => (sh -> a -> b -> c -> IO d) -> UArray D SH sh a -> UArray D SH sh b -> UArray D SH sh c -> UArray D SH sh d Source #

izip :: (USource D SH sh a, USource D SH sh b, Arity n, (* ~ n) (S n0)) => (sh -> Fun n a b) -> VecList n (UArray D SH sh a) -> UArray D SH sh b Source #

izipM :: (USource D SH sh a, USource D SH sh b, Arity n, (* ~ n) (S n0)) => (sh -> Fun n a (IO b)) -> VecList n (UArray D SH sh a) -> UArray D SH sh b Source #

Shape sh => DefaultIFusion D L D SH sh Source # 

Methods

imap :: (USource D L sh a, USource D SH sh b) => (sh -> a -> b) -> UArray D L sh a -> UArray D SH sh b Source #

imapM :: (USource D L sh a, USource D SH sh b) => (sh -> a -> IO b) -> UArray D L sh a -> UArray D SH sh b Source #

izip2 :: (USource D L sh a, USource D L sh b, USource D SH sh c) => (sh -> a -> b -> c) -> UArray D L sh a -> UArray D L sh b -> UArray D SH sh c Source #

izip2M :: (USource D L sh a, USource D L sh b, USource D SH sh c) => (sh -> a -> b -> IO c) -> UArray D L sh a -> UArray D L sh b -> UArray D SH sh c Source #

izip3 :: (USource D L sh a, USource D L sh b, USource D L sh c, USource D SH sh d) => (sh -> a -> b -> c -> d) -> UArray D L sh a -> UArray D L sh b -> UArray D L sh c -> UArray D SH sh d Source #

izip3M :: (USource D L sh a, USource D L sh b, USource D L sh c, USource D SH sh d) => (sh -> a -> b -> c -> IO d) -> UArray D L sh a -> UArray D L sh b -> UArray D L sh c -> UArray D SH sh d Source #

izip :: (USource D L sh a, USource D SH sh b, Arity n, (* ~ n) (S n0)) => (sh -> Fun n a b) -> VecList n (UArray D L sh a) -> UArray D SH sh b Source #

izipM :: (USource D L sh a, USource D SH sh b, Arity n, (* ~ n) (S n0)) => (sh -> Fun n a (IO b)) -> VecList n (UArray D L sh a) -> UArray D SH sh b Source #

Shape sh => DefaultIFusion FS L D SH sh Source # 

Methods

imap :: (USource FS L sh a, USource D SH sh b) => (sh -> a -> b) -> UArray FS L sh a -> UArray D SH sh b Source #

imapM :: (USource FS L sh a, USource D SH sh b) => (sh -> a -> IO b) -> UArray FS L sh a -> UArray D SH sh b Source #

izip2 :: (USource FS L sh a, USource FS L sh b, USource D SH sh c) => (sh -> a -> b -> c) -> UArray FS L sh a -> UArray FS L sh b -> UArray D SH sh c Source #

izip2M :: (USource FS L sh a, USource FS L sh b, USource D SH sh c) => (sh -> a -> b -> IO c) -> UArray FS L sh a -> UArray FS L sh b -> UArray D SH sh c Source #

izip3 :: (USource FS L sh a, USource FS L sh b, USource FS L sh c, USource D SH sh d) => (sh -> a -> b -> c -> d) -> UArray FS L sh a -> UArray FS L sh b -> UArray FS L sh c -> UArray D SH sh d Source #

izip3M :: (USource FS L sh a, USource FS L sh b, USource FS L sh c, USource D SH sh d) => (sh -> a -> b -> c -> IO d) -> UArray FS L sh a -> UArray FS L sh b -> UArray FS L sh c -> UArray D SH sh d Source #

izip :: (USource FS L sh a, USource D SH sh b, Arity n, (* ~ n) (S n0)) => (sh -> Fun n a b) -> VecList n (UArray FS L sh a) -> UArray D SH sh b Source #

izipM :: (USource FS L sh a, USource D SH sh b, Arity n, (* ~ n) (S n0)) => (sh -> Fun n a (IO b)) -> VecList n (UArray FS L sh a) -> UArray D SH sh b Source #

Shape sh => DefaultIFusion F L D SH sh Source # 

Methods

imap :: (USource F L sh a, USource D SH sh b) => (sh -> a -> b) -> UArray F L sh a -> UArray D SH sh b Source #

imapM :: (USource F L sh a, USource D SH sh b) => (sh -> a -> IO b) -> UArray F L sh a -> UArray D SH sh b Source #

izip2 :: (USource F L sh a, USource F L sh b, USource D SH sh c) => (sh -> a -> b -> c) -> UArray F L sh a -> UArray F L sh b -> UArray D SH sh c Source #

izip2M :: (USource F L sh a, USource F L sh b, USource D SH sh c) => (sh -> a -> b -> IO c) -> UArray F L sh a -> UArray F L sh b -> UArray D SH sh c Source #

izip3 :: (USource F L sh a, USource F L sh b, USource F L sh c, USource D SH sh d) => (sh -> a -> b -> c -> d) -> UArray F L sh a -> UArray F L sh b -> UArray F L sh c -> UArray D SH sh d Source #

izip3M :: (USource F L sh a, USource F L sh b, USource F L sh c, USource D SH sh d) => (sh -> a -> b -> c -> IO d) -> UArray F L sh a -> UArray F L sh b -> UArray F L sh c -> UArray D SH sh d Source #

izip :: (USource F L sh a, USource D SH sh b, Arity n, (* ~ n) (S n0)) => (sh -> Fun n a b) -> VecList n (UArray F L sh a) -> UArray D SH sh b Source #

izipM :: (USource F L sh a, USource D SH sh b, Arity n, (* ~ n) (S n0)) => (sh -> Fun n a (IO b)) -> VecList n (UArray F L sh a) -> UArray D SH sh b Source #

Shape sh => DefaultIFusion MB L D SH sh Source # 

Methods

imap :: (USource MB L sh a, USource D SH sh b) => (sh -> a -> b) -> UArray MB L sh a -> UArray D SH sh b Source #

imapM :: (USource MB L sh a, USource D SH sh b) => (sh -> a -> IO b) -> UArray MB L sh a -> UArray D SH sh b Source #

izip2 :: (USource MB L sh a, USource MB L sh b, USource D SH sh c) => (sh -> a -> b -> c) -> UArray MB L sh a -> UArray MB L sh b -> UArray D SH sh c Source #

izip2M :: (USource MB L sh a, USource MB L sh b, USource D SH sh c) => (sh -> a -> b -> IO c) -> UArray MB L sh a -> UArray MB L sh b -> UArray D SH sh c Source #

izip3 :: (USource MB L sh a, USource MB L sh b, USource MB L sh c, USource D SH sh d) => (sh -> a -> b -> c -> d) -> UArray MB L sh a -> UArray MB L sh b -> UArray MB L sh c -> UArray D SH sh d Source #

izip3M :: (USource MB L sh a, USource MB L sh b, USource MB L sh c, USource D SH sh d) => (sh -> a -> b -> c -> IO d) -> UArray MB L sh a -> UArray MB L sh b -> UArray MB L sh c -> UArray D SH sh d Source #

izip :: (USource MB L sh a, USource D SH sh b, Arity n, (* ~ n) (S n0)) => (sh -> Fun n a b) -> VecList n (UArray MB L sh a) -> UArray D SH sh b Source #

izipM :: (USource MB L sh a, USource D SH sh b, Arity n, (* ~ n) (S n0)) => (sh -> Fun n a (IO b)) -> VecList n (UArray MB L sh a) -> UArray D SH sh b Source #

Shape sh => DefaultIFusion B L D SH sh Source # 

Methods

imap :: (USource B L sh a, USource D SH sh b) => (sh -> a -> b) -> UArray B L sh a -> UArray D SH sh b Source #

imapM :: (USource B L sh a, USource D SH sh b) => (sh -> a -> IO b) -> UArray B L sh a -> UArray D SH sh b Source #

izip2 :: (USource B L sh a, USource B L sh b, USource D SH sh c) => (sh -> a -> b -> c) -> UArray B L sh a -> UArray B L sh b -> UArray D SH sh c Source #

izip2M :: (USource B L sh a, USource B L sh b, USource D SH sh c) => (sh -> a -> b -> IO c) -> UArray B L sh a -> UArray B L sh b -> UArray D SH sh c Source #

izip3 :: (USource B L sh a, USource B L sh b, USource B L sh c, USource D SH sh d) => (sh -> a -> b -> c -> d) -> UArray B L sh a -> UArray B L sh b -> UArray B L sh c -> UArray D SH sh d Source #

izip3M :: (USource B L sh a, USource B L sh b, USource B L sh c, USource D SH sh d) => (sh -> a -> b -> c -> IO d) -> UArray B L sh a -> UArray B L sh b -> UArray B L sh c -> UArray D SH sh d Source #

izip :: (USource B L sh a, USource D SH sh b, Arity n, (* ~ n) (S n0)) => (sh -> Fun n a b) -> VecList n (UArray B L sh a) -> UArray D SH sh b Source #

izipM :: (USource B L sh a, USource D SH sh b, Arity n, (* ~ n) (S n0)) => (sh -> Fun n a (IO b)) -> VecList n (UArray B L sh a) -> UArray D SH sh b Source #

Shape sh => DefaultIFusion CV CVL CV CVL sh Source # 

Methods

imap :: (USource CV CVL sh a, USource CV CVL sh b) => (sh -> a -> b) -> UArray CV CVL sh a -> UArray CV CVL sh b Source #

imapM :: (USource CV CVL sh a, USource CV CVL sh b) => (sh -> a -> IO b) -> UArray CV CVL sh a -> UArray CV CVL sh b Source #

izip2 :: (USource CV CVL sh a, USource CV CVL sh b, USource CV CVL sh c) => (sh -> a -> b -> c) -> UArray CV CVL sh a -> UArray CV CVL sh b -> UArray CV CVL sh c Source #

izip2M :: (USource CV CVL sh a, USource CV CVL sh b, USource CV CVL sh c) => (sh -> a -> b -> IO c) -> UArray CV CVL sh a -> UArray CV CVL sh b -> UArray CV CVL sh c Source #

izip3 :: (USource CV CVL sh a, USource CV CVL sh b, USource CV CVL sh c, USource CV CVL sh d) => (sh -> a -> b -> c -> d) -> UArray CV CVL sh a -> UArray CV CVL sh b -> UArray CV CVL sh c -> UArray CV CVL sh d Source #

izip3M :: (USource CV CVL sh a, USource CV CVL sh b, USource CV CVL sh c, USource CV CVL sh d) => (sh -> a -> b -> c -> IO d) -> UArray CV CVL sh a -> UArray CV CVL sh b -> UArray CV CVL sh c -> UArray CV CVL sh d Source #

izip :: (USource CV CVL sh a, USource CV CVL sh b, Arity n, (* ~ n) (S n0)) => (sh -> Fun n a b) -> VecList n (UArray CV CVL sh a) -> UArray CV CVL sh b Source #

izipM :: (USource CV CVL sh a, USource CV CVL sh b, Arity n, (* ~ n) (S n0)) => (sh -> Fun n a (IO b)) -> VecList n (UArray CV CVL sh a) -> UArray CV CVL sh b Source #

(DefaultIFusion r l D SH sh, IFusion (SE r) l D SH sh) => DefaultIFusion (SE r) l D SH sh Source # 

Methods

imap :: (USource (SE r) l sh a, USource D SH sh b) => (sh -> a -> b) -> UArray (SE r) l sh a -> UArray D SH sh b Source #

imapM :: (USource (SE r) l sh a, USource D SH sh b) => (sh -> a -> IO b) -> UArray (SE r) l sh a -> UArray D SH sh b Source #

izip2 :: (USource (SE r) l sh a, USource (SE r) l sh b, USource D SH sh c) => (sh -> a -> b -> c) -> UArray (SE r) l sh a -> UArray (SE r) l sh b -> UArray D SH sh c Source #

izip2M :: (USource (SE r) l sh a, USource (SE r) l sh b, USource D SH sh c) => (sh -> a -> b -> IO c) -> UArray (SE r) l sh a -> UArray (SE r) l sh b -> UArray D SH sh c Source #

izip3 :: (USource (SE r) l sh a, USource (SE r) l sh b, USource (SE r) l sh c, USource D SH sh d) => (sh -> a -> b -> c -> d) -> UArray (SE r) l sh a -> UArray (SE r) l sh b -> UArray (SE r) l sh c -> UArray D SH sh d Source #

izip3M :: (USource (SE r) l sh a, USource (SE r) l sh b, USource (SE r) l sh c, USource D SH sh d) => (sh -> a -> b -> c -> IO d) -> UArray (SE r) l sh a -> UArray (SE r) l sh b -> UArray (SE r) l sh c -> UArray D SH sh d Source #

izip :: (USource (SE r) l sh a, USource D SH sh b, Arity n, (* ~ n) (S n0)) => (sh -> Fun n a b) -> VecList n (UArray (SE r) l sh a) -> UArray D SH sh b Source #

izipM :: (USource (SE r) l sh a, USource D SH sh b, Arity n, (* ~ n) (S n0)) => (sh -> Fun n a (IO b)) -> VecList n (UArray (SE r) l sh a) -> UArray D SH sh b Source #

Delayed flow and zipping shortcuts

dzipWith Source #

Arguments

:: (USource r1 l sh a, DefaultFusion r1 D l sh, USource D l sh a, USource r2 l sh b, DefaultFusion r2 D l sh, USource D l sh b, USource D l sh c, DefaultFusion D D l sh) 
=> (a -> b -> c)

Pure zipping function

-> UArray r1 l sh a

1st source array

-> UArray r2 l sh b

2nd source array

-> UArray D l sh c

Fused result array

O(1) Generalized zipping of 2 arrays.

Main basic "zipWith" in Yarr.

Although sighature of this function has extremely big predicate, it is more permissible than dzip2 counterpart, because source arrays shouldn't be of the same type.

Implemented by means of delay function (source arrays are simply delayed before zipping).

dzipWith3 Source #

Arguments

:: (USource r1 l sh a, DefaultFusion r1 D l sh, USource D l sh a, USource r2 l sh b, DefaultFusion r2 D l sh, USource D l sh b, USource r3 l sh c, DefaultFusion r3 D l sh, USource D l sh c, USource D l sh d, DefaultFusion D D l sh) 
=> (a -> b -> c -> d)

Pure zipping function

-> UArray r1 l sh a

1st source array

-> UArray r2 l sh b

2nd source array

-> UArray r3 l sh c

3rd source array

-> UArray D l sh d

Result array

O(1) Generalized zipping of 3 arrays, which shouldn't be of the same representation type.

data D Source #

Delayed representation is a wrapper for arbitrary indexing function.

UArray D L sh a instance holds linear getter ((Int -> IO a)), and UArray D SH sh a - shaped, "true" (sh -> IO a) index, respectively.

Delayed arrays are most common recipients for fusion operations.

Instances

Shape sh => USource D SH sh a Source # 

Methods

index :: UArray D SH sh a -> sh -> IO a Source #

linearIndex :: UArray D SH sh a -> Int -> IO a Source #

Shape sh => USource D L sh a Source # 

Methods

index :: UArray D L sh a -> sh -> IO a Source #

linearIndex :: UArray D L sh a -> Int -> IO a Source #

Shape sh => Regular D SH sh a Source # 

Associated Types

data UArray D SH sh a :: * Source #

Methods

extent :: UArray D SH sh a -> sh Source #

touchArray :: UArray D SH sh a -> IO () Source #

force :: UArray D SH sh a -> IO () Source #

Shape sh => Regular D L sh a Source # 

Associated Types

data UArray D L sh a :: * Source #

Methods

extent :: UArray D L sh a -> sh Source #

touchArray :: UArray D L sh a -> IO () Source #

force :: UArray D L sh a -> IO () Source #

Shape sh => DefaultFusion D D SH sh Source # 

Methods

dmap :: (USource D SH sh a, USource D SH sh b) => (a -> b) -> UArray D SH sh a -> UArray D SH sh b Source #

dmapM :: (USource D SH sh a, USource D SH sh b) => (a -> IO b) -> UArray D SH sh a -> UArray D SH sh b Source #

dzip2 :: (USource D SH sh a, USource D SH sh b, USource D SH sh c) => (a -> b -> c) -> UArray D SH sh a -> UArray D SH sh b -> UArray D SH sh c Source #

dzip2M :: (USource D SH sh a, USource D SH sh b, USource D SH sh c) => (a -> b -> IO c) -> UArray D SH sh a -> UArray D SH sh b -> UArray D SH sh c Source #

dzip3 :: (USource D SH sh a, USource D SH sh b, USource D SH sh c, USource D SH sh d) => (a -> b -> c -> d) -> UArray D SH sh a -> UArray D SH sh b -> UArray D SH sh c -> UArray D SH sh d Source #

dzip3M :: (USource D SH sh a, USource D SH sh b, USource D SH sh c, USource D SH sh d) => (a -> b -> c -> IO d) -> UArray D SH sh a -> UArray D SH sh b -> UArray D SH sh c -> UArray D SH sh d Source #

dzip :: (USource D SH sh a, USource D SH sh b, Arity n, (* ~ n) (S n0)) => Fun n a b -> VecList n (UArray D SH sh a) -> UArray D SH sh b Source #

dzipM :: (USource D SH sh a, USource D SH sh b, Arity n, (* ~ n) (S n0)) => Fun n a (IO b) -> VecList n (UArray D SH sh a) -> UArray D SH sh b Source #

DefaultFusion D D L sh Source # 

Methods

dmap :: (USource D L sh a, USource D L sh b) => (a -> b) -> UArray D L sh a -> UArray D L sh b Source #

dmapM :: (USource D L sh a, USource D L sh b) => (a -> IO b) -> UArray D L sh a -> UArray D L sh b Source #

dzip2 :: (USource D L sh a, USource D L sh b, USource D L sh c) => (a -> b -> c) -> UArray D L sh a -> UArray D L sh b -> UArray D L sh c Source #

dzip2M :: (USource D L sh a, USource D L sh b, USource D L sh c) => (a -> b -> IO c) -> UArray D L sh a -> UArray D L sh b -> UArray D L sh c Source #

dzip3 :: (USource D L sh a, USource D L sh b, USource D L sh c, USource D L sh d) => (a -> b -> c -> d) -> UArray D L sh a -> UArray D L sh b -> UArray D L sh c -> UArray D L sh d Source #

dzip3M :: (USource D L sh a, USource D L sh b, USource D L sh c, USource D L sh d) => (a -> b -> c -> IO d) -> UArray D L sh a -> UArray D L sh b -> UArray D L sh c -> UArray D L sh d Source #

dzip :: (USource D L sh a, USource D L sh b, Arity n, (* ~ n) (S n0)) => Fun n a b -> VecList n (UArray D L sh a) -> UArray D L sh b Source #

dzipM :: (USource D L sh a, USource D L sh b, Arity n, (* ~ n) (S n0)) => Fun n a (IO b) -> VecList n (UArray D L sh a) -> UArray D L sh b Source #

DefaultFusion FS D L sh Source # 

Methods

dmap :: (USource FS L sh a, USource D L sh b) => (a -> b) -> UArray FS L sh a -> UArray D L sh b Source #

dmapM :: (USource FS L sh a, USource D L sh b) => (a -> IO b) -> UArray FS L sh a -> UArray D L sh b Source #

dzip2 :: (USource FS L sh a, USource FS L sh b, USource D L sh c) => (a -> b -> c) -> UArray FS L sh a -> UArray FS L sh b -> UArray D L sh c Source #

dzip2M :: (USource FS L sh a, USource FS L sh b, USource D L sh c) => (a -> b -> IO c) -> UArray FS L sh a -> UArray FS L sh b -> UArray D L sh c Source #

dzip3 :: (USource FS L sh a, USource FS L sh b, USource FS L sh c, USource D L sh d) => (a -> b -> c -> d) -> UArray FS L sh a -> UArray FS L sh b -> UArray FS L sh c -> UArray D L sh d Source #

dzip3M :: (USource FS L sh a, USource FS L sh b, USource FS L sh c, USource D L sh d) => (a -> b -> c -> IO d) -> UArray FS L sh a -> UArray FS L sh b -> UArray FS L sh c -> UArray D L sh d Source #

dzip :: (USource FS L sh a, USource D L sh b, Arity n, (* ~ n) (S n0)) => Fun n a b -> VecList n (UArray FS L sh a) -> UArray D L sh b Source #

dzipM :: (USource FS L sh a, USource D L sh b, Arity n, (* ~ n) (S n0)) => Fun n a (IO b) -> VecList n (UArray FS L sh a) -> UArray D L sh b Source #

DefaultFusion F D L sh Source # 

Methods

dmap :: (USource F L sh a, USource D L sh b) => (a -> b) -> UArray F L sh a -> UArray D L sh b Source #

dmapM :: (USource F L sh a, USource D L sh b) => (a -> IO b) -> UArray F L sh a -> UArray D L sh b Source #

dzip2 :: (USource F L sh a, USource F L sh b, USource D L sh c) => (a -> b -> c) -> UArray F L sh a -> UArray F L sh b -> UArray D L sh c Source #

dzip2M :: (USource F L sh a, USource F L sh b, USource D L sh c) => (a -> b -> IO c) -> UArray F L sh a -> UArray F L sh b -> UArray D L sh c Source #

dzip3 :: (USource F L sh a, USource F L sh b, USource F L sh c, USource D L sh d) => (a -> b -> c -> d) -> UArray F L sh a -> UArray F L sh b -> UArray F L sh c -> UArray D L sh d Source #

dzip3M :: (USource F L sh a, USource F L sh b, USource F L sh c, USource D L sh d) => (a -> b -> c -> IO d) -> UArray F L sh a -> UArray F L sh b -> UArray F L sh c -> UArray D L sh d Source #

dzip :: (USource F L sh a, USource D L sh b, Arity n, (* ~ n) (S n0)) => Fun n a b -> VecList n (UArray F L sh a) -> UArray D L sh b Source #

dzipM :: (USource F L sh a, USource D L sh b, Arity n, (* ~ n) (S n0)) => Fun n a (IO b) -> VecList n (UArray F L sh a) -> UArray D L sh b Source #

DefaultFusion MB D L sh Source # 

Methods

dmap :: (USource MB L sh a, USource D L sh b) => (a -> b) -> UArray MB L sh a -> UArray D L sh b Source #

dmapM :: (USource MB L sh a, USource D L sh b) => (a -> IO b) -> UArray MB L sh a -> UArray D L sh b Source #

dzip2 :: (USource MB L sh a, USource MB L sh b, USource D L sh c) => (a -> b -> c) -> UArray MB L sh a -> UArray MB L sh b -> UArray D L sh c Source #

dzip2M :: (USource MB L sh a, USource MB L sh b, USource D L sh c) => (a -> b -> IO c) -> UArray MB L sh a -> UArray MB L sh b -> UArray D L sh c Source #

dzip3 :: (USource MB L sh a, USource MB L sh b, USource MB L sh c, USource D L sh d) => (a -> b -> c -> d) -> UArray MB L sh a -> UArray MB L sh b -> UArray MB L sh c -> UArray D L sh d Source #

dzip3M :: (USource MB L sh a, USource MB L sh b, USource MB L sh c, USource D L sh d) => (a -> b -> c -> IO d) -> UArray MB L sh a -> UArray MB L sh b -> UArray MB L sh c -> UArray D L sh d Source #

dzip :: (USource MB L sh a, USource D L sh b, Arity n, (* ~ n) (S n0)) => Fun n a b -> VecList n (UArray MB L sh a) -> UArray D L sh b Source #

dzipM :: (USource MB L sh a, USource D L sh b, Arity n, (* ~ n) (S n0)) => Fun n a (IO b) -> VecList n (UArray MB L sh a) -> UArray D L sh b Source #

DefaultFusion B D L sh Source # 

Methods

dmap :: (USource B L sh a, USource D L sh b) => (a -> b) -> UArray B L sh a -> UArray D L sh b Source #

dmapM :: (USource B L sh a, USource D L sh b) => (a -> IO b) -> UArray B L sh a -> UArray D L sh b Source #

dzip2 :: (USource B L sh a, USource B L sh b, USource D L sh c) => (a -> b -> c) -> UArray B L sh a -> UArray B L sh b -> UArray D L sh c Source #

dzip2M :: (USource B L sh a, USource B L sh b, USource D L sh c) => (a -> b -> IO c) -> UArray B L sh a -> UArray B L sh b -> UArray D L sh c Source #

dzip3 :: (USource B L sh a, USource B L sh b, USource B L sh c, USource D L sh d) => (a -> b -> c -> d) -> UArray B L sh a -> UArray B L sh b -> UArray B L sh c -> UArray D L sh d Source #

dzip3M :: (USource B L sh a, USource B L sh b, USource B L sh c, USource D L sh d) => (a -> b -> c -> IO d) -> UArray B L sh a -> UArray B L sh b -> UArray B L sh c -> UArray D L sh d Source #

dzip :: (USource B L sh a, USource D L sh b, Arity n, (* ~ n) (S n0)) => Fun n a b -> VecList n (UArray B L sh a) -> UArray D L sh b Source #

dzipM :: (USource B L sh a, USource D L sh b, Arity n, (* ~ n) (S n0)) => Fun n a (IO b) -> VecList n (UArray B L sh a) -> UArray D L sh b Source #

Fusion r D L sh Source # 

Methods

fmap :: (USource r L sh a, USource D L sh b) => (a -> b) -> UArray r L sh a -> UArray D L sh b Source #

fmapM :: (USource r L sh a, USource D L sh b) => (a -> IO b) -> UArray r L sh a -> UArray D L sh b Source #

fzip2 :: (USource r L sh a, USource r L sh b, USource D L sh c) => (a -> b -> c) -> UArray r L sh a -> UArray r L sh b -> UArray D L sh c Source #

fzip2M :: (USource r L sh a, USource r L sh b, USource D L sh c) => (a -> b -> IO c) -> UArray r L sh a -> UArray r L sh b -> UArray D L sh c Source #

fzip3 :: (USource r L sh a, USource r L sh b, USource r L sh c, USource D L sh d) => (a -> b -> c -> d) -> UArray r L sh a -> UArray r L sh b -> UArray r L sh c -> UArray D L sh d Source #

fzip3M :: (USource r L sh a, USource r L sh b, USource r L sh c, USource D L sh d) => (a -> b -> c -> IO d) -> UArray r L sh a -> UArray r L sh b -> UArray r L sh c -> UArray D L sh d Source #

fzip :: (USource r L sh a, USource D L sh b, Arity n, (* ~ n) (S n0)) => Fun n a b -> VecList n (UArray r L sh a) -> UArray D L sh b Source #

fzipM :: (USource r L sh a, USource D L sh b, Arity n, (* ~ n) (S n0)) => Fun n a (IO b) -> VecList n (UArray r L sh a) -> UArray D L sh b Source #

Shape sh => DefaultIFusion D SH D SH sh Source # 

Methods

imap :: (USource D SH sh a, USource D SH sh b) => (sh -> a -> b) -> UArray D SH sh a -> UArray D SH sh b Source #

imapM :: (USource D SH sh a, USource D SH sh b) => (sh -> a -> IO b) -> UArray D SH sh a -> UArray D SH sh b Source #

izip2 :: (USource D SH sh a, USource D SH sh b, USource D SH sh c) => (sh -> a -> b -> c) -> UArray D SH sh a -> UArray D SH sh b -> UArray D SH sh c Source #

izip2M :: (USource D SH sh a, USource D SH sh b, USource D SH sh c) => (sh -> a -> b -> IO c) -> UArray D SH sh a -> UArray D SH sh b -> UArray D SH sh c Source #

izip3 :: (USource D SH sh a, USource D SH sh b, USource D SH sh c, USource D SH sh d) => (sh -> a -> b -> c -> d) -> UArray D SH sh a -> UArray D SH sh b -> UArray D SH sh c -> UArray D SH sh d Source #

izip3M :: (USource D SH sh a, USource D SH sh b, USource D SH sh c, USource D SH sh d) => (sh -> a -> b -> c -> IO d) -> UArray D SH sh a -> UArray D SH sh b -> UArray D SH sh c -> UArray D SH sh d Source #

izip :: (USource D SH sh a, USource D SH sh b, Arity n, (* ~ n) (S n0)) => (sh -> Fun n a b) -> VecList n (UArray D SH sh a) -> UArray D SH sh b Source #

izipM :: (USource D SH sh a, USource D SH sh b, Arity n, (* ~ n) (S n0)) => (sh -> Fun n a (IO b)) -> VecList n (UArray D SH sh a) -> UArray D SH sh b Source #

Shape sh => DefaultIFusion D L D SH sh Source # 

Methods

imap :: (USource D L sh a, USource D SH sh b) => (sh -> a -> b) -> UArray D L sh a -> UArray D SH sh b Source #

imapM :: (USource D L sh a, USource D SH sh b) => (sh -> a -> IO b) -> UArray D L sh a -> UArray D SH sh b Source #

izip2 :: (USource D L sh a, USource D L sh b, USource D SH sh c) => (sh -> a -> b -> c) -> UArray D L sh a -> UArray D L sh b -> UArray D SH sh c Source #

izip2M :: (USource D L sh a, USource D L sh b, USource D SH sh c) => (sh -> a -> b -> IO c) -> UArray D L sh a -> UArray D L sh b -> UArray D SH sh c Source #

izip3 :: (USource D L sh a, USource D L sh b, USource D L sh c, USource D SH sh d) => (sh -> a -> b -> c -> d) -> UArray D L sh a -> UArray D L sh b -> UArray D L sh c -> UArray D SH sh d Source #

izip3M :: (USource D L sh a, USource D L sh b, USource D L sh c, USource D SH sh d) => (sh -> a -> b -> c -> IO d) -> UArray D L sh a -> UArray D L sh b -> UArray D L sh c -> UArray D SH sh d Source #

izip :: (USource D L sh a, USource D SH sh b, Arity n, (* ~ n) (S n0)) => (sh -> Fun n a b) -> VecList n (UArray D L sh a) -> UArray D SH sh b Source #

izipM :: (USource D L sh a, USource D SH sh b, Arity n, (* ~ n) (S n0)) => (sh -> Fun n a (IO b)) -> VecList n (UArray D L sh a) -> UArray D SH sh b Source #

Shape sh => DefaultIFusion FS L D SH sh Source # 

Methods

imap :: (USource FS L sh a, USource D SH sh b) => (sh -> a -> b) -> UArray FS L sh a -> UArray D SH sh b Source #

imapM :: (USource FS L sh a, USource D SH sh b) => (sh -> a -> IO b) -> UArray FS L sh a -> UArray D SH sh b Source #

izip2 :: (USource FS L sh a, USource FS L sh b, USource D SH sh c) => (sh -> a -> b -> c) -> UArray FS L sh a -> UArray FS L sh b -> UArray D SH sh c Source #

izip2M :: (USource FS L sh a, USource FS L sh b, USource D SH sh c) => (sh -> a -> b -> IO c) -> UArray FS L sh a -> UArray FS L sh b -> UArray D SH sh c Source #

izip3 :: (USource FS L sh a, USource FS L sh b, USource FS L sh c, USource D SH sh d) => (sh -> a -> b -> c -> d) -> UArray FS L sh a -> UArray FS L sh b -> UArray FS L sh c -> UArray D SH sh d Source #

izip3M :: (USource FS L sh a, USource FS L sh b, USource FS L sh c, USource D SH sh d) => (sh -> a -> b -> c -> IO d) -> UArray FS L sh a -> UArray FS L sh b -> UArray FS L sh c -> UArray D SH sh d Source #

izip :: (USource FS L sh a, USource D SH sh b, Arity n, (* ~ n) (S n0)) => (sh -> Fun n a b) -> VecList n (UArray FS L sh a) -> UArray D SH sh b Source #

izipM :: (USource FS L sh a, USource D SH sh b, Arity n, (* ~ n) (S n0)) => (sh -> Fun n a (IO b)) -> VecList n (UArray FS L sh a) -> UArray D SH sh b Source #

Shape sh => DefaultIFusion F L D SH sh Source # 

Methods

imap :: (USource F L sh a, USource D SH sh b) => (sh -> a -> b) -> UArray F L sh a -> UArray D SH sh b Source #

imapM :: (USource F L sh a, USource D SH sh b) => (sh -> a -> IO b) -> UArray F L sh a -> UArray D SH sh b Source #

izip2 :: (USource F L sh a, USource F L sh b, USource D SH sh c) => (sh -> a -> b -> c) -> UArray F L sh a -> UArray F L sh b -> UArray D SH sh c Source #

izip2M :: (USource F L sh a, USource F L sh b, USource D SH sh c) => (sh -> a -> b -> IO c) -> UArray F L sh a -> UArray F L sh b -> UArray D SH sh c Source #

izip3 :: (USource F L sh a, USource F L sh b, USource F L sh c, USource D SH sh d) => (sh -> a -> b -> c -> d) -> UArray F L sh a -> UArray F L sh b -> UArray F L sh c -> UArray D SH sh d Source #

izip3M :: (USource F L sh a, USource F L sh b, USource F L sh c, USource D SH sh d) => (sh -> a -> b -> c -> IO d) -> UArray F L sh a -> UArray F L sh b -> UArray F L sh c -> UArray D SH sh d Source #

izip :: (USource F L sh a, USource D SH sh b, Arity n, (* ~ n) (S n0)) => (sh -> Fun n a b) -> VecList n (UArray F L sh a) -> UArray D SH sh b Source #

izipM :: (USource F L sh a, USource D SH sh b, Arity n, (* ~ n) (S n0)) => (sh -> Fun n a (IO b)) -> VecList n (UArray F L sh a) -> UArray D SH sh b Source #

Shape sh => DefaultIFusion MB L D SH sh Source # 

Methods

imap :: (USource MB L sh a, USource D SH sh b) => (sh -> a -> b) -> UArray MB L sh a -> UArray D SH sh b Source #

imapM :: (USource MB L sh a, USource D SH sh b) => (sh -> a -> IO b) -> UArray MB L sh a -> UArray D SH sh b Source #

izip2 :: (USource MB L sh a, USource MB L sh b, USource D SH sh c) => (sh -> a -> b -> c) -> UArray MB L sh a -> UArray MB L sh b -> UArray D SH sh c Source #

izip2M :: (USource MB L sh a, USource MB L sh b, USource D SH sh c) => (sh -> a -> b -> IO c) -> UArray MB L sh a -> UArray MB L sh b -> UArray D SH sh c Source #

izip3 :: (USource MB L sh a, USource MB L sh b, USource MB L sh c, USource D SH sh d) => (sh -> a -> b -> c -> d) -> UArray MB L sh a -> UArray MB L sh b -> UArray MB L sh c -> UArray D SH sh d Source #

izip3M :: (USource MB L sh a, USource MB L sh b, USource MB L sh c, USource D SH sh d) => (sh -> a -> b -> c -> IO d) -> UArray MB L sh a -> UArray MB L sh b -> UArray MB L sh c -> UArray D SH sh d Source #

izip :: (USource MB L sh a, USource D SH sh b, Arity n, (* ~ n) (S n0)) => (sh -> Fun n a b) -> VecList n (UArray MB L sh a) -> UArray D SH sh b Source #

izipM :: (USource MB L sh a, USource D SH sh b, Arity n, (* ~ n) (S n0)) => (sh -> Fun n a (IO b)) -> VecList n (UArray MB L sh a) -> UArray D SH sh b Source #

Shape sh => DefaultIFusion B L D SH sh Source # 

Methods

imap :: (USource B L sh a, USource D SH sh b) => (sh -> a -> b) -> UArray B L sh a -> UArray D SH sh b Source #

imapM :: (USource B L sh a, USource D SH sh b) => (sh -> a -> IO b) -> UArray B L sh a -> UArray D SH sh b Source #

izip2 :: (USource B L sh a, USource B L sh b, USource D SH sh c) => (sh -> a -> b -> c) -> UArray B L sh a -> UArray B L sh b -> UArray D SH sh c Source #

izip2M :: (USource B L sh a, USource B L sh b, USource D SH sh c) => (sh -> a -> b -> IO c) -> UArray B L sh a -> UArray B L sh b -> UArray D SH sh c Source #

izip3 :: (USource B L sh a, USource B L sh b, USource B L sh c, USource D SH sh d) => (sh -> a -> b -> c -> d) -> UArray B L sh a -> UArray B L sh b -> UArray B L sh c -> UArray D SH sh d Source #

izip3M :: (USource B L sh a, USource B L sh b, USource B L sh c, USource D SH sh d) => (sh -> a -> b -> c -> IO d) -> UArray B L sh a -> UArray B L sh b -> UArray B L sh c -> UArray D SH sh d Source #

izip :: (USource B L sh a, USource D SH sh b, Arity n, (* ~ n) (S n0)) => (sh -> Fun n a b) -> VecList n (UArray B L sh a) -> UArray D SH sh b Source #

izipM :: (USource B L sh a, USource D SH sh b, Arity n, (* ~ n) (S n0)) => (sh -> Fun n a (IO b)) -> VecList n (UArray B L sh a) -> UArray D SH sh b Source #

Shape sh => IFusion r l D SH sh Source # 

Methods

fimap :: (USource r l sh a, USource D SH sh b) => (sh -> a -> b) -> UArray r l sh a -> UArray D SH sh b Source #

fimapM :: (USource r l sh a, USource D SH sh b) => (sh -> a -> IO b) -> UArray r l sh a -> UArray D SH sh b Source #

fizip2 :: (USource r l sh a, USource r l sh b, USource D SH sh c) => (sh -> a -> b -> c) -> UArray r l sh a -> UArray r l sh b -> UArray D SH sh c Source #

fizip2M :: (USource r l sh a, USource r l sh b, USource D SH sh c) => (sh -> a -> b -> IO c) -> UArray r l sh a -> UArray r l sh b -> UArray D SH sh c Source #

fizip3 :: (USource r l sh a, USource r l sh b, USource r l sh c, USource D SH sh d) => (sh -> a -> b -> c -> d) -> UArray r l sh a -> UArray r l sh b -> UArray r l sh c -> UArray D SH sh d Source #

fizip3M :: (USource r l sh a, USource r l sh b, USource r l sh c, USource D SH sh d) => (sh -> a -> b -> c -> IO d) -> UArray r l sh a -> UArray r l sh b -> UArray r l sh c -> UArray D SH sh d Source #

fizip :: (USource r l sh a, USource D SH sh b, Arity n, (* ~ n) (S n0)) => (sh -> Fun n a b) -> VecList n (UArray r l sh a) -> UArray D SH sh b Source #

fizipM :: (USource r l sh a, USource D SH sh b, Arity n, (* ~ n) (S n0)) => (sh -> Fun n a (IO b)) -> VecList n (UArray r l sh a) -> UArray D SH sh b Source #

(Shape sh, Vector v e) => UVecSource D D SH sh v e Source # 
(Shape sh, Vector v e) => UVecSource D D L sh v e Source # 
(Shape sh, Vector v e) => VecRegular D D SH sh v e Source # 

Methods

slices :: UArray D SH sh (v e) -> VecList (Dim v) (UArray D SH sh e) Source #

(Shape sh, Vector v e) => VecRegular D D L sh v e Source # 

Methods

slices :: UArray D L sh (v e) -> VecList (Dim v) (UArray D L sh e) Source #

(DefaultFusion r D l sh, Fusion (SE r) D l sh) => DefaultFusion (SE r) D l sh Source # 

Methods

dmap :: (USource (SE r) l sh a, USource D l sh b) => (a -> b) -> UArray (SE r) l sh a -> UArray D l sh b Source #

dmapM :: (USource (SE r) l sh a, USource D l sh b) => (a -> IO b) -> UArray (SE r) l sh a -> UArray D l sh b Source #

dzip2 :: (USource (SE r) l sh a, USource (SE r) l sh b, USource D l sh c) => (a -> b -> c) -> UArray (SE r) l sh a -> UArray (SE r) l sh b -> UArray D l sh c Source #

dzip2M :: (USource (SE r) l sh a, USource (SE r) l sh b, USource D l sh c) => (a -> b -> IO c) -> UArray (SE r) l sh a -> UArray (SE r) l sh b -> UArray D l sh c Source #

dzip3 :: (USource (SE r) l sh a, USource (SE r) l sh b, USource (SE r) l sh c, USource D l sh d) => (a -> b -> c -> d) -> UArray (SE r) l sh a -> UArray (SE r) l sh b -> UArray (SE r) l sh c -> UArray D l sh d Source #

dzip3M :: (USource (SE r) l sh a, USource (SE r) l sh b, USource (SE r) l sh c, USource D l sh d) => (a -> b -> c -> IO d) -> UArray (SE r) l sh a -> UArray (SE r) l sh b -> UArray (SE r) l sh c -> UArray D l sh d Source #

dzip :: (USource (SE r) l sh a, USource D l sh b, Arity n, (* ~ n) (S n0)) => Fun n a b -> VecList n (UArray (SE r) l sh a) -> UArray D l sh b Source #

dzipM :: (USource (SE r) l sh a, USource D l sh b, Arity n, (* ~ n) (S n0)) => Fun n a (IO b) -> VecList n (UArray (SE r) l sh a) -> UArray D l sh b Source #

(DefaultIFusion r l D SH sh, IFusion (SE r) l D SH sh) => DefaultIFusion (SE r) l D SH sh Source # 

Methods

imap :: (USource (SE r) l sh a, USource D SH sh b) => (sh -> a -> b) -> UArray (SE r) l sh a -> UArray D SH sh b Source #

imapM :: (USource (SE r) l sh a, USource D SH sh b) => (sh -> a -> IO b) -> UArray (SE r) l sh a -> UArray D SH sh b Source #

izip2 :: (USource (SE r) l sh a, USource (SE r) l sh b, USource D SH sh c) => (sh -> a -> b -> c) -> UArray (SE r) l sh a -> UArray (SE r) l sh b -> UArray D SH sh c Source #

izip2M :: (USource (SE r) l sh a, USource (SE r) l sh b, USource D SH sh c) => (sh -> a -> b -> IO c) -> UArray (SE r) l sh a -> UArray (SE r) l sh b -> UArray D SH sh c Source #

izip3 :: (USource (SE r) l sh a, USource (SE r) l sh b, USource (SE r) l sh c, USource D SH sh d) => (sh -> a -> b -> c -> d) -> UArray (SE r) l sh a -> UArray (SE r) l sh b -> UArray (SE r) l sh c -> UArray D SH sh d Source #

izip3M :: (USource (SE r) l sh a, USource (SE r) l sh b, USource (SE r) l sh c, USource D SH sh d) => (sh -> a -> b -> c -> IO d) -> UArray (SE r) l sh a -> UArray (SE r) l sh b -> UArray (SE r) l sh c -> UArray D SH sh d Source #

izip :: (USource (SE r) l sh a, USource D SH sh b, Arity n, (* ~ n) (S n0)) => (sh -> Fun n a b) -> VecList n (UArray (SE r) l sh a) -> UArray D SH sh b Source #

izipM :: (USource (SE r) l sh a, USource D SH sh b, Arity n, (* ~ n) (S n0)) => (sh -> Fun n a (IO b)) -> VecList n (UArray (SE r) l sh a) -> UArray D SH sh b Source #

Shape sh => NFData (UArray D SH sh a) Source # 

Methods

rnf :: UArray D SH sh a -> () #

Shape sh => NFData (UArray D L sh a) Source # 

Methods

rnf :: UArray D L sh a -> () #

data UArray D SH Source # 
data UArray D SH = ShapeDelayed !sh (IO ()) (IO ()) (sh -> IO a)
data UArray D L Source # 
data UArray D L = LinearDelayed !sh (IO ()) (IO ()) (Int -> IO a)

delay :: (USource r l sh a, USource D l sh a, Fusion r D l sh) => UArray r l sh a -> UArray D l sh a Source #

Load type preserving wrapping arbirtary array into Delayed representation.

Vector fusion

data SE r Source #

SEparate meta array representation. Internally SEparate arrays hold vector of it's slices (so, slices is just getter for them).

Mostly useful for:

  • Separate in memory manifest Foreign arrays ("Unboxed" arrays in vector/repa libraries terms).
  • Element-wise vector array fusion (see group of dmapElems functions).

Instances

(DefaultFusion r D l sh, Fusion (SE r) D l sh) => DefaultFusion (SE r) D l sh Source # 

Methods

dmap :: (USource (SE r) l sh a, USource D l sh b) => (a -> b) -> UArray (SE r) l sh a -> UArray D l sh b Source #

dmapM :: (USource (SE r) l sh a, USource D l sh b) => (a -> IO b) -> UArray (SE r) l sh a -> UArray D l sh b Source #

dzip2 :: (USource (SE r) l sh a, USource (SE r) l sh b, USource D l sh c) => (a -> b -> c) -> UArray (SE r) l sh a -> UArray (SE r) l sh b -> UArray D l sh c Source #

dzip2M :: (USource (SE r) l sh a, USource (SE r) l sh b, USource D l sh c) => (a -> b -> IO c) -> UArray (SE r) l sh a -> UArray (SE r) l sh b -> UArray D l sh c Source #

dzip3 :: (USource (SE r) l sh a, USource (SE r) l sh b, USource (SE r) l sh c, USource D l sh d) => (a -> b -> c -> d) -> UArray (SE r) l sh a -> UArray (SE r) l sh b -> UArray (SE r) l sh c -> UArray D l sh d Source #

dzip3M :: (USource (SE r) l sh a, USource (SE r) l sh b, USource (SE r) l sh c, USource D l sh d) => (a -> b -> c -> IO d) -> UArray (SE r) l sh a -> UArray (SE r) l sh b -> UArray (SE r) l sh c -> UArray D l sh d Source #

dzip :: (USource (SE r) l sh a, USource D l sh b, Arity n, (* ~ n) (S n0)) => Fun n a b -> VecList n (UArray (SE r) l sh a) -> UArray D l sh b Source #

dzipM :: (USource (SE r) l sh a, USource D l sh b, Arity n, (* ~ n) (S n0)) => Fun n a (IO b) -> VecList n (UArray (SE r) l sh a) -> UArray D l sh b Source #

(DefaultIFusion r l D SH sh, IFusion (SE r) l D SH sh) => DefaultIFusion (SE r) l D SH sh Source # 

Methods

imap :: (USource (SE r) l sh a, USource D SH sh b) => (sh -> a -> b) -> UArray (SE r) l sh a -> UArray D SH sh b Source #

imapM :: (USource (SE r) l sh a, USource D SH sh b) => (sh -> a -> IO b) -> UArray (SE r) l sh a -> UArray D SH sh b Source #

izip2 :: (USource (SE r) l sh a, USource (SE r) l sh b, USource D SH sh c) => (sh -> a -> b -> c) -> UArray (SE r) l sh a -> UArray (SE r) l sh b -> UArray D SH sh c Source #

izip2M :: (USource (SE r) l sh a, USource (SE r) l sh b, USource D SH sh c) => (sh -> a -> b -> IO c) -> UArray (SE r) l sh a -> UArray (SE r) l sh b -> UArray D SH sh c Source #

izip3 :: (USource (SE r) l sh a, USource (SE r) l sh b, USource (SE r) l sh c, USource D SH sh d) => (sh -> a -> b -> c -> d) -> UArray (SE r) l sh a -> UArray (SE r) l sh b -> UArray (SE r) l sh c -> UArray D SH sh d Source #

izip3M :: (USource (SE r) l sh a, USource (SE r) l sh b, USource (SE r) l sh c, USource D SH sh d) => (sh -> a -> b -> c -> IO d) -> UArray (SE r) l sh a -> UArray (SE r) l sh b -> UArray (SE r) l sh c -> UArray D SH sh d Source #

izip :: (USource (SE r) l sh a, USource D SH sh b, Arity n, (* ~ n) (S n0)) => (sh -> Fun n a b) -> VecList n (UArray (SE r) l sh a) -> UArray D SH sh b Source #

izipM :: (USource (SE r) l sh a, USource D SH sh b, Arity n, (* ~ n) (S n0)) => (sh -> Fun n a (IO b)) -> VecList n (UArray (SE r) l sh a) -> UArray D SH sh b Source #

(UTarget tr tl sh e, Vector v e) => UVecTarget (SE tr) tr tl sh v e Source # 
(USource r l sh e, Vector v e) => UVecSource (SE r) r l sh v e Source # 
(Shape sh, Vector v e, Storable e) => UVecSource (SE F) F L sh v e Source # 
(Shape sh, Vector v e, NFData e) => UVecSource (SE MB) MB L sh v e Source # 
(Shape sh, Vector v e, NFData e) => UVecSource (SE B) B L sh v e Source # 
(Regular r l sh e, Shape sh, Vector v e) => VecRegular (SE r) r l sh v e Source # 

Methods

slices :: UArray (SE r) l sh (v e) -> VecList (Dim v) (UArray r l sh e) Source #

(UTarget tr tl sh e, Vector v e) => UTarget (SE tr) tl sh (v e) Source # 

Methods

write :: UArray (SE tr) tl sh (v e) -> sh -> v e -> IO () Source #

linearWrite :: UArray (SE tr) tl sh (v e) -> Int -> v e -> IO () Source #

(USource r l sh e, Vector v e) => USource (SE r) l sh (v e) Source # 

Methods

index :: UArray (SE r) l sh (v e) -> sh -> IO (v e) Source #

linearIndex :: UArray (SE r) l sh (v e) -> Int -> IO (v e) Source #

(Regular r l sh e, Vector v e) => Regular (SE r) l sh (v e) Source # 

Associated Types

data UArray (SE r) l sh (v e) :: * Source #

Methods

extent :: UArray (SE r) l sh (v e) -> sh Source #

touchArray :: UArray (SE r) l sh (v e) -> IO () Source #

force :: UArray (SE r) l sh (v e) -> IO () Source #

(Manifest r mr l sh e, Vector v e) => Manifest (SE r) (SE mr) l sh (v e) Source # 

Methods

new :: sh -> IO (UArray (SE mr) l sh (v e)) Source #

freeze :: UArray (SE mr) l sh (v e) -> IO (UArray (SE r) l sh (v e)) Source #

thaw :: UArray (SE r) l sh (v e) -> IO (UArray (SE mr) l sh (v e)) Source #

(NFData (UArray r l sh e), Shape sh, Vector v e) => NFData (UArray (SE r) l sh (v e)) Source # 

Methods

rnf :: UArray (SE r) l sh (v e) -> () #

data UArray (SE r) l sh (v e) Source # 
data UArray (SE r) l sh (v e) = Separate !sh (VecList (Dim v) (UArray r l sh e))

dmapElems Source #

Arguments

:: (VecRegular r slr l sh v a, USource slr l sh a, USource fslr l sh b, DefaultFusion slr fslr l sh, Vector v2 b, Dim v ~ Dim v2) 
=> VecList (Dim v) (a -> b)

Vector of mapper functions

-> UArray r l sh (v a)

Source array of vectors

-> UArray (SE fslr) l sh (v2 b)

Fused array

O(1) Injective element-wise fusion (mapping).

Example:

let domainHSVImage =
        dmapElems (vl_3 (* 360) (* 100) (* 100))
                  normedHSVImage

Also, used internally to define mapElems function.

dmapElemsM Source #

Arguments

:: (VecRegular r slr l sh v a, USource slr l sh a, USource fslr l sh b, DefaultFusion slr fslr l sh, Vector v2 b, Dim v ~ Dim v2) 
=> VecList (Dim v) (a -> IO b)

Elemen-wise vector of monadic mappers

-> UArray r l sh (v a)

Source array of vectors

-> UArray (SE fslr) l sh (v2 b)

Result array

O(1) Monadic vesion of dmapElems function.

dzipElems2 Source #

Arguments

:: (VecRegular r slr l sh v a, USource slr l sh a, VecRegular r slr l sh v b, USource slr l sh b, USource fslr l sh c, DefaultFusion slr fslr l sh, Vector v c) 
=> VecList (Dim v) (a -> b -> c)

.

-> UArray r l sh (v a) 
-> UArray r l sh (v b) 
-> UArray (SE fslr) l sh (v c) 

dzipElems2M Source #

Arguments

:: (VecRegular r slr l sh v a, USource slr l sh a, VecRegular r slr l sh v b, USource slr l sh b, USource fslr l sh c, DefaultFusion slr fslr l sh, Vector v c) 
=> VecList (Dim v) (a -> b -> IO c)

.

-> UArray r l sh (v a) 
-> UArray r l sh (v b) 
-> UArray (SE fslr) l sh (v c) 

dzipElems3 Source #

Arguments

:: (VecRegular r slr l sh v a, USource slr l sh a, VecRegular r slr l sh v b, USource slr l sh b, VecRegular r slr l sh v c, USource slr l sh c, USource fslr l sh d, DefaultFusion slr fslr l sh, Vector v d) 
=> VecList (Dim v) (a -> b -> c -> d)

.

-> UArray r l sh (v a) 
-> UArray r l sh (v b) 
-> UArray r l sh (v c) 
-> UArray (SE fslr) l sh (v d) 

dzipElems3M Source #

Arguments

:: (VecRegular r slr l sh v a, USource slr l sh a, VecRegular r slr l sh v b, USource slr l sh b, VecRegular r slr l sh v c, USource slr l sh c, USource fslr l sh d, DefaultFusion slr fslr l sh, Vector v d) 
=> VecList (Dim v) (a -> b -> c -> IO d)

.

-> UArray r l sh (v a) 
-> UArray r l sh (v b) 
-> UArray r l sh (v c) 
-> UArray (SE fslr) l sh (v d) 

dzipElems Source #

Arguments

:: (Vector v2 b, Arity m, m ~ S m0, VecRegular r slr l sh v a, USource slr l sh a, USource fslr l sh b, DefaultFusion slr fslr l sh) 
=> VecList (Dim v2) (Fun m a b)

Vector of wrapped m-ary element-wise zippers

-> VecList m (UArray r l sh (v a))

Vector of source arrays of vectors

-> UArray (SE fslr) l sh (v2 b)

Fused result array

O(1) Generalized element-wise zipping of several arrays of vectors.

dzipElemsM Source #

Arguments

:: (Vector v2 b, Arity m, m ~ S m0, VecRegular r slr l sh v a, USource slr l sh a, USource fslr l sh b, DefaultFusion slr fslr l sh) 
=> VecList (Dim v2) (Fun m a (IO b))

Vector of wrapped m-ary element-wise monadic zippers

-> VecList m (UArray r l sh (v a))

Vector of source arrays of vectors

-> UArray (SE fslr) l sh (v2 b)

Result array

O(1) Generalized monadic element-wise zipping of several arrays of vectors

High level shortcuts

traverse Source #

Arguments

:: (USource r l sh a, Shape sh') 
=> (sh -> sh')

Function to produce result extent from source extent.

-> ((sh -> IO a) -> sh' -> IO b)

Function to produce elements of result array. Passed a lookup function to get elements of the source.

-> UArray r l sh a

Source array itself

-> UArray D SH sh' b

Result array

O(1) Function from repa.

zipElems Source #

Arguments

:: (Vector v a, USource r l sh (v a), USource fr l sh b, DefaultFusion r fr l sh) 
=> Fn (Dim v) a b

Unwrapped n-ary zipper function

-> UArray r l sh (v a)

Source array of vectors

-> UArray fr l sh b

Result array

O(1) Function for in-place zipping vector elements.

Always true:

zipElems f arr == dzip (Fun f) (slices arr)

Example:

let φs = zipElems (flip atan2) coords

mapElems Source #

Arguments

:: (VecRegular r slr l sh v a, USource slr l sh a, USource fslr l sh b, DefaultFusion slr fslr l sh, Vector v b) 
=> (a -> b)

Mapper function for all elements

-> UArray r l sh (v a)

Source array of vectors

-> UArray (SE fslr) l sh (v b)

Fused array of vectors

O(1) Maps elements of vectors in array uniformly. Don't confuse with dmapElems, which accepts a vector of mapper for each slice.

Typical use case -- type conversion:

let floatImage :: UArray F Dim2 Float
    floatImage = mapElems fromIntegral word8Image

mapElemsM Source #

Arguments

:: (VecRegular r slr l sh v a, USource slr l sh a, USource fslr l sh b, DefaultFusion slr fslr l sh, Vector v b) 
=> (a -> IO b)

Monadic mapper for all vector elements

-> UArray r l sh (v a)

Source array of vectors

-> UArray (SE fslr) l sh (v b)

Fused array of vectors

O(1) Monadic version of mapElems function. Don't confuse with dmapElemsM.

Example:

let domained = mapElemsM (clampM 0.0 1.0) floatImage

Cartesian products

cartProduct2 :: (USource r1 l1 Dim1 a, USource r2 l2 Dim1 b) => (a -> b -> c) -> UArray r1 l1 Dim1 a -> UArray r2 l2 Dim1 b -> UArray D SH Dim2 c Source #

icartProduct2 :: (USource r1 l1 Dim1 a, USource r2 l2 Dim1 b) => (Dim2 -> a -> b -> c) -> UArray r1 l1 Dim1 a -> UArray r2 l2 Dim1 b -> UArray D SH Dim2 c Source #

icartProduct2M :: (USource r1 l1 Dim1 a, USource r2 l2 Dim1 b) => (Dim2 -> a -> b -> IO c) -> UArray r1 l1 Dim1 a -> UArray r2 l2 Dim1 b -> UArray D SH Dim2 c Source #

cartProduct3 :: (USource r1 l1 Dim1 a, USource r2 l2 Dim1 b, USource r3 l3 Dim1 c) => (a -> b -> c -> d) -> UArray r1 l1 Dim1 a -> UArray r2 l2 Dim1 b -> UArray r3 l3 Dim1 c -> UArray D SH Dim3 d Source #

icartProduct3 :: (USource r1 l1 Dim1 a, USource r2 l2 Dim1 b, USource r3 l3 Dim1 c) => (Dim3 -> a -> b -> c -> d) -> UArray r1 l1 Dim1 a -> UArray r2 l2 Dim1 b -> UArray r3 l3 Dim1 c -> UArray D SH Dim3 d Source #

icartProduct3M :: (USource r1 l1 Dim1 a, USource r2 l2 Dim1 b, USource r3 l3 Dim1 c) => (Dim3 -> a -> b -> c -> IO d) -> UArray r1 l1 Dim1 a -> UArray r2 l2 Dim1 b -> UArray r3 l3 Dim1 c -> UArray D SH Dim3 d Source #