Skip to content

Commit 1542031

Browse files
committed
Documentation updates.
1 parent 41022a5 commit 1542031

19 files changed

+182
-1937
lines changed

README.md

+16-6
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55

66
## Table of Contents
77
- [Installation](#Installation)
8+
- [Haskell Installation](#haskell-installation)
89
- [Documentation](#Documentation)
910
- [Hacking](#Hacking)
1011
- [Example](#Example)
@@ -14,6 +15,21 @@
1415
Install `ArraryFire` via the download page.
1516
- https://arrayfire.com/download/
1617

18+
`ArrayFire` can also be fetched from [nixpkgs](https://github.com/nixos/nixpkgs) `master`.
19+
20+
### Haskell Installation
21+
22+
`arrayfire` can be installed w/ `cabal`, `stack` or `nix`.
23+
24+
```
25+
cabal install arrayfire
26+
```
27+
28+
```
29+
stack install arrayfire
30+
```
31+
32+
1733
Also note, if you plan on using ArrayFire's visualization features, you must install `fontconfig` and `glfw` on OSX or Linux.
1834

1935
## Documentation
@@ -48,12 +64,6 @@ To interactively evaluate code in the `repl`
4864
nix-shell --run repl
4965
```
5066

51-
To run the doctests on each file change
52-
53-
```bash
54-
nix-shell --run doctest-runner
55-
```
56-
5767
To produce the haddocks and open them in a browser
5868

5969
```bash

exe/Main.hs

+8
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ module Main where
66

77
import ArrayFire
88
import Control.Concurrent
9+
import Control.Exception
10+
911
import Prelude hiding (sum, product)
1012
-- import GHC.RTS
1113

@@ -15,8 +17,14 @@ foreign import ccall safe "test_bool"
1517
foreign import ccall safe "test_window"
1618
testWindow :: IO ()
1719

20+
main' :: IO ()
21+
main' = print newArray `catch` (\(e :: AFException) -> print e)
22+
where
23+
newArray = matrix @Double (2,2) [ [1..], [1..] ] * matrix @Double (2,2) [ [2..], [2..] ]
24+
1825
main :: IO ()
1926
main = do
27+
main'
2028
-- testWindow
2129
-- ks <- randn @Double [100,100]
2230
-- saveArray "key" ks "array.txt" False

src/ArrayFire/Arith.hs

+1-1
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ addBatched
6666
-> Bool
6767
-- ^ Use batch
6868
-> Array a
69-
v -- ^ Result of add
69+
-- ^ Result of add
7070
addBatched x y (fromIntegral . fromEnum -> batch) =
7171
x `op2` y $ \arr arr1 arr2 ->
7272
af_add arr arr1 arr2 batch

0 commit comments

Comments
 (0)