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
extent (AUndefined sh)
= sh
index (AUndefined _) _
= error $ "Repa: array element is undefined."
linearIndex (AUndefined _) ix
= error $ "Repa: array element at " ++ show ix ++ " is undefined."
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 ()