Home

Repa

Repa is a Haskell library for high-performance, regular, shape-polymorphic parallel arrays. It is designed to express computations on large multi-dimensional arrays in a pure functional style while exploiting modern multi-core CPUs. Repa emphasizes data parallelism and fusion to minimize intermediate allocations and maximize throughput.

In Repa, an array is parameterized by its representation and its shape. The representation tags distinguish

A central goal of Repa is fusion: combining successive array operations into a single pass over the

Typical usage involves constructing arrays, applying a sequence of transformations such as mapping, zipping, or reductions,

The library is part of the Haskell ecosystem of array processing tools and has influenced subsequent work

how
and
where
data
is
stored
or
computed,
such
as
a
delayed
representation
in
which
operations
are
chained
without
materialization,
and
one
or
more
manifest
representations
in
which
concrete
memory
layouts
are
used
for
efficient
access.
Repa
supports
unboxed
representations
for
primitive
element
types,
enabling
efficient
memory
layout
and
vectorized
access.
The
shape
parameter
makes
the
same
code
applicable
to
one-,
two-,
and
higher-dimensional
arrays.
data.
This
avoids
creating
intermediate
arrays
and
improves
cache
locality.
Repa
also
provides
facilities
to
execute
computations
in
parallel
on
multi-core
processors,
while
preserving
referential
transparency.
and
then
forcing
evaluation
to
a
concrete
representation
for
output
or
further
processing.
Repa
is
often
applied
to
domains
such
as
image
processing,
numerical
simulations,
and
data
analysis
where
large,
regular
arrays
arise.
in
the
field.
See
also
related
projects
such
as
Accelerate
and
the
broader
array
libraries
in
Haskell.