sdp-0.2: Simple Data Processing
Copyright(c) Andrey Mulik 2020
LicenseBSD-style
Maintainerwork.a.mulik@gmail.com
Portabilitynon-portable (GHC extensions)
Safe HaskellSafe
LanguageHaskell2010

SDP.Shaped

Contents

Description

SDP.Shaped provides advanced operations on Indexed structures, generalized by Index type.

Synopsis

Shaped

class Shaped s e where Source #

Service class for structures with arbitrary bounds. Allows you to extract subsequences corresponding to index subranges.

Minimal complete definition

reshape, (!!), slices, unslice

Methods

defaultRebound :: (Index i, Index j, Bordered2 s i e) => s i e -> s j e Source #

rebound :: Index i => s i e -> (i, i) -> s i e Source #

Set new bounds of same type, may shrink.

reshape :: (Index i, Index j) => s i e -> (j, j) -> s j e Source #

Set new bounds, may shrink.

(!!) :: SubIndex i j => s i e -> (i :|: j) -> s j e Source #

es !! ij returns subshape ij of es.

slices :: SubIndex i j => s i e -> [s j e] Source #

Returns list of es subshapes.

unslice :: (Foldable f, SubIndex i j) => f (s j e) -> s i e Source #

Unslice subshapes.

Instances

Instances details
(Bordered1 rep Int e, Split1 rep e) => Shaped (AnyBorder rep) e Source # 
Instance details

Defined in SDP.Templates.AnyBorder

Methods

defaultRebound :: (Index i, Index j, Bordered2 (AnyBorder rep) i e) => AnyBorder rep i e -> AnyBorder rep j e Source #

rebound :: Index i => AnyBorder rep i e -> (i, i) -> AnyBorder rep i e Source #

reshape :: (Index i, Index j) => AnyBorder rep i e -> (j, j) -> AnyBorder rep j e Source #

(!!) :: SubIndex i j => AnyBorder rep i e -> (i :|: j) -> AnyBorder rep j e Source #

slices :: SubIndex i j => AnyBorder rep i e -> [AnyBorder rep j e] Source #

unslice :: (Foldable f, SubIndex i j) => f (AnyBorder rep j e) -> AnyBorder rep i e Source #