aboutsummaryrefslogtreecommitdiff
path: root/src/Data/Array/Nested.hs
blob: 3e4e1a0dc73ec7a25baf65f76f3247513e4a886b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
{-# LANGUAGE ExplicitNamespaces #-}
{-# LANGUAGE PatternSynonyms #-}
module Data.Array.Nested (
  -- * Ranked arrays
  Ranked(Ranked),
  ListR(ZR, (:::)),
  IxR(.., ZIR, (:.:)), IIxR,
  ShR(.., ZSR, (:$:)), IShR,
  rshape, rrank, rindex, rindexPartial, rgenerate, rsumOuter1,
  rtranspose, rappend, rconcat, rscalar, rfromVector, rtoVector, runScalar,
  rrerank,
  rreplicate, rreplicateScal, rfromListOuter, rfromList1, rfromList1Prim, rtoListOuter, rtoList1,
  rslice, rrev1, rreshape, riota,
  rnest, runNest,
  -- ** Lifting orthotope operations to 'Ranked' arrays
  rlift, rlift2,
  -- ** Conversions
  rtoXArrayPrim, rfromXArrayPrim,
  rcastToShaped,
  rfromOrthotope, rtoOrthotope,

  -- * Shaped arrays
  Shaped(Shaped),
  ListS(ZS, (::$)),
  IxS(.., ZIS, (:.$)), IIxS,
  ShS(.., ZSS, (:$$)), KnownShS(..),
  sshape, sindex, sindexPartial, sgenerate, ssumOuter1,
  stranspose, sappend, sscalar, sfromVector, stoVector, sunScalar,
  -- TODO: sconcat? What should its type be?
  srerank,
  sreplicate, sreplicateScal, sfromListOuter, sfromList1, sfromList1Prim, stoListOuter, stoList1,
  sslice, srev1, sreshape, siota,
  snest, sunNest,
  -- ** Lifting orthotope operations to 'Shaped' arrays
  slift, slift2,
  -- ** Conversions
  stoXArrayPrim, sfromXArrayPrim,
  stoRanked,

  -- * Mixed arrays
  Mixed,
  IxX(..), IIxX,
  KnownShX(..), StaticShX(..),
  mshape, mindex, mindexPartial, mgenerate, msumOuter1,
  mtranspose, mappend, mconcat, mscalar, mfromVector, mtoVector, munScalar,
  mrerank,
  mreplicate, mreplicateScal, mfromListOuter, mfromList1, mfromList1Prim, mtoListOuter, mtoList1,
  mslice, mrev1, mreshape, miota,
  mnest, munNest,
  -- ** Lifting orthotope operations to 'Mixed' arrays
  mlift, mlift2,
  -- ** Conversions
  mtoXArrayPrim, mfromXArrayPrim,
  mtoRanked, mcastToShaped,

  -- * Array elements
  Elt,
  PrimElt,
  Primitive(..),
  KnownElt,

  -- * Further utilities / re-exports
  type (++),
  Storable,
  SNat, pattern SNat,
  pattern SZ, pattern SS,
  Perm(..),
  IsPermutation,
  KnownPerm(..),
  NumElt, FloatElt,
) where

import Prelude hiding (mappend, mconcat)

import Data.Array.Mixed.Internal.Arith
import Data.Array.Mixed.Permutation
import Data.Array.Mixed.Shape
import Data.Array.Mixed.Types
import Data.Array.Nested.Internal.Convert
import Data.Array.Nested.Internal.Mixed
import Data.Array.Nested.Internal.Ranked
import Data.Array.Nested.Internal.Shape
import Data.Array.Nested.Internal.Shaped
import Foreign.Storable
import GHC.TypeLits