module Data.Array.Repa.Repr.Undefined
( X, Array (..))
where
import Data.Array.Repa.Base
import Data.Array.Repa.Shape
import Data.Array.Repa.Eval
data X
instance Source X e where
data Array X sh e
= AUndefined !sh
deepSeqArray _ x
= x
{-# INLINE deepSeqArray #-}
extent (AUndefined sh)
= sh
{-# INLINE extent #-}
index (AUndefined _) _
= error $ "Repa: array element is undefined."
{-# INLINE index #-}
linearIndex (AUndefined _) ix
= error $ "Repa: array element at " ++ show ix ++ " is undefined."
{-# INLINE linearIndex #-}
deriving instance Show sh
=> Show (Array X sh e)
deriving instance Read sh
=> Read (Array X sh e)
instance Shape sh => Load X sh e where
loadS _ _ = return ()
loadP _ _ = return ()