Skip to content

Commit 2588136

Browse files
committed
Link to static-tensor in README
1 parent ce2c3ee commit 2588136

File tree

2 files changed

+33
-8
lines changed

2 files changed

+33
-8
lines changed

README.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,12 @@
22
[![Hackage](https://img.shields.io/hackage/v/matrix-static.svg)](https://hackage.haskell.org/package/matrix-static)
33
[![Hackage Deps](https://img.shields.io/hackage-deps/v/matrix-static.svg)](http://packdeps.haskellers.com/reverse/matrix-static)
44

5-
65
# matrix-static
76

87
A static wrapper around the [matrix](https://hackage.haskell.org/package/matrix) library. It provides a data type `Matrix m n a` derived from `matrix`'s `Matrix a` with additional information about the matix dimension `m n` as type-level Nat's.
98

9+
An alternative to this library is [static-tensor](https://hackage.haskell.org/package/static-tensor-0.2.1.0/docs/Data-Matrix-Static.html) that might better fit your needs. Choose `matrix-static` if you are familiar with `matrix` and want more guarantees at compile time. Choose `static-tensor` for most other use cases.
10+
1011
(Almost) all functions provided by `Data.Matrix` are wrapped. These wrappers guarantee during compile time that the matrix dimension are correct. As such, runtime errors due to mismatching matrix dimensions are minimized. Also, some performance improvements are achieved by not having to do dimension checks during runtime.
1112

1213
Some functions take indices `i` as parameters (e.g. `Matrix.Data.mapCol`).

build-haddock.sh

+31-7
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,35 @@
1-
#!/usr/bin/env sh
2-
1+
#!/bin/bash
32
set -e
43

5-
dir=$(mktemp -d dist-docs.XXXXXX)
6-
#trap 'rm -r "$dir"' EXIT
4+
cabal_file=$(find . -maxdepth 1 -name "*.cabal" -print -quit)
5+
if [ ! -f "$cabal_file" ]; then
6+
echo "Run this script in the top-level package directory"
7+
exit 1
8+
fi
9+
10+
pkg=$(awk -F ":[[:space:]]*" 'tolower($1)=="name" { print $2 }' < "$cabal_file")
11+
ver=$(awk -F ":[[:space:]]*" 'tolower($1)=="version" { print $2 }' < "$cabal_file")
12+
13+
if [ -z "$pkg" ]; then
14+
echo "Unable to determine package name"
15+
exit 1
16+
fi
17+
18+
if [ -z "$ver" ]; then
19+
echo "Unable to determine package version"
20+
exit 1
21+
fi
22+
23+
echo "Detected package: $pkg-$ver"
24+
25+
dir=$(mktemp -d build-docs.XXXXXX)
26+
trap 'rm -r "$dir"' EXIT
27+
28+
#cabal haddock --hoogle --hyperlink-source --html-location='/package/$pkg-$version/docs' --contents-location='/package/$pkg-$version'
29+
stack haddock
30+
31+
#cp -R dist/doc/html/$pkg/ $dir/$pkg-$ver-docs
32+
cp -R $(stack path --local-install-root)/doc/$pkg-$ver/ $dir/$pkg-$ver-docs
733

8-
cabal new-haddock --builddir="$dir" --haddock-for-hackage --haddock-hyperlink-source
9-
# Starting with cabal 2.0, `--publish` is needed for uploading to non-candidate releases
10-
cabal upload --publish -d $dir/*-docs.tar.gz
34+
tar cvz -C $dir --format=ustar -f $pkg-$ver-docs.tar.gz $pkg-$ver-docs
1135

0 commit comments

Comments
 (0)