Custom Query (35 matches)

Filters
 
Or
 
  
 
Columns

Show under each result:


Results (25 - 27 of 35)

1 2 3 4 5 6 7 8 9 10 11 12
Ticket Resolution Summary Owner Reporter
#33 fixed Unboxing problems in example from Stack Overflow Ben Lippmeier
Description
import Data.Array.Repa

arr :: Array U DIM2 Int
arr = fromListUnboxed (Z :. 5 :. 5) [1..25]

combined :: Array U DIM2 Int
combined 
  = computeP $ traverse arr (\_ -> Z :. 4 :. 4 :: DIM2) 
  $ \f (Z :. x :. y) -> sumAllS $ extract f (x,y) (2,2)

extract :: (DIM2 -> Int) -> (Int,Int) -> (Int,Int) -> Array D DIM2 Int
extract lookup (x0,y0) (width,height) 
  = fromFunction bounds 
  $ \sh -> offset lookup sh
    where 
    bounds = Z :. width :. height
    offset :: (DIM2 -> Int) -> DIM2 -> Int
    offset f (Z :. x :. y) = f (Z :. x + x0 :. y + y0)

main = print combined
#34 fixed Ambiguous show instance. Ben Lippmeier
Description

Grigory Sarnitskiy reports:

Hello! I'm using repa 2.1.1.5, so maybe this issue is gone already.

Nevertheless, repa's Show instance is a bit ambiguous, e.g. show of Maybe (Array DIM1 Int)

"Just Array (Z :. 1) [...]"

Wouldn't it be better to have

"Just (Array (Z :. 1) [...])"

just like elsewhere in Haskell? For example

show $ Just $ Just 5
"Just (Just 5)"
#35 fixed Fix Read instance Ben Lippmeier
Description

http://stackoverflow.com/questions/8624760/repa-how-to-make-a-read-instance

1 2 3 4 5 6 7 8 9 10 11 12
Note: See TracQuery for help on using queries.