@@ -98,6 +98,12 @@ import Data.Word
9898-- main = print $ A.matrix @Double (2,2) [[1,2],[3,4]]
9999-- @
100100--
101+ -- @
102+ -- ArrayFire Array
103+ -- [2 2 1 1]
104+ -- 1.0000 2.0000
105+ -- 3.0000 4.0000
106+ -- @
101107
102108-- $modules
103109--
@@ -133,27 +139,29 @@ import Data.Word
133139-- An 'Array' can be constructed using the following smart constructors:
134140--
135141-- @
136- -- >>> scalar @Double 2.0
142+ -- >>> scalar \ @Double 2.0
137143-- ArrayFire Array
138144-- [1 1 1 1]
139145-- 2.0000
140146-- @
141147--
142148-- @
143- -- >>> vector @Double 10 [1..]
149+ -- >>> vector \ @Double 10 [1..]
144150-- ArrayFire Array
145151-- [10 1 1 1]
146152-- 1.0000 2.0000 3.0000 4.0000 5.0000 6.0000 7.0000 8.0000 9.0000 10.0000
153+ -- @
147154--
148- -- >>> matrix @Double (2,2) [[1,2],[3,4]]
155+ -- @
156+ -- >>> matrix \@Double (2,2) [[1,2],[3,4]]
149157-- ArrayFire Array
150158-- [2 2 1 1]
151159-- 1.0000 2.0000
152160-- 3.0000 4.0000
153161-- @
154162--
155163-- @
156- -- >>> cube @Double (2,2,2) [[[2,2],[2,2]],[[2,2],[2,2]]]
164+ -- >>> cube \ @Double (2,2,2) [[[2,2],[2,2]],[[2,2],[2,2]]]
157165-- ArrayFire Array
158166-- [2 2 2 1]
159167-- 2.0000 2.0000
@@ -164,7 +172,7 @@ import Data.Word
164172-- @
165173--
166174-- @
167- -- >>> tensor @Double (2,2,2,2) [[[[2,2],[2,2]],[[2,2],[2,2]]], [[[2,2],[2,2]],[[2,2],[2,2]]]]
175+ -- >>> tensor \ @Double (2,2,2,2) [[[[2,2],[2,2]],[[2,2],[2,2]]], [[[2,2],[2,2]],[[2,2],[2,2]]]]
168176-- ArrayFire Array
169177-- [2 2 2 2]
170178-- 2.0000 2.0000
@@ -183,15 +191,15 @@ import Data.Word
183191--
184192-- Array construction can use Haskell's lazy lists, since 'take' is called on each dimension before sending to the 'C' API.
185193--
186- -- >>> ' mkArray' @Double [2,2] [ [1..], [1..] ]
194+ -- >>> mkArray @Double [2,2] [ [1..], [1..] ]
187195-- ArrayFire Array
188196-- [10 1 1 1]
189197-- 1.0000 2.0000 3.0000 4.0000 5.0000 6.0000 7.0000 8.0000 9.0000 10.0000
190198--
191199-- Specifying up to 4 dimensions is allowed (anything high is ignored).
192200
193201-- $laws
194- -- Every 'Array' is an instance of 'Eq', 'Ord', 'Num', 'Fractional', 'Floating' and 'SemiGroup '
202+ -- Every 'Array' is an instance of 'Eq', 'Ord', 'Num', 'Fractional', 'Floating' and 'Semigroup '
195203--
196204-- 'Num'
197205--
@@ -246,6 +254,14 @@ import Data.Word
246254-- False
247255-- >>> scalar @Double 1 [10] > scalar @Double 1 [10]
248256-- False
257+ --
258+ -- 'Floating'
259+ --
260+ -- >>> pi :: Array Double
261+ -- ArrayFire Array
262+ -- [1 1 1 1]
263+ -- 3.1416
264+ --
249265
250266-- $conversion
251267-- 'Array' can be exported into 'Haskell' using `toVector'. This will create a 'Storable' vector suitable for use in other C programs.
0 commit comments