diff options
Diffstat (limited to 'ghc/lib/prelude/TyArray.hs')
-rw-r--r-- | ghc/lib/prelude/TyArray.hs | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/ghc/lib/prelude/TyArray.hs b/ghc/lib/prelude/TyArray.hs new file mode 100644 index 0000000000..660f90e7e6 --- /dev/null +++ b/ghc/lib/prelude/TyArray.hs @@ -0,0 +1,27 @@ +module PreludeArray ( + Assoc(..), Array(..), _ByteArray(..) + ) where + +import Cls +import Core + +data Assoc a b = a := b deriving () + +-- Report: we do not do this: +-- data {-(Ix a) =>-} Array a b = MkArray (a,a) (a -> b) deriving () +-- context omitted to match builtin version + +-- Our version of a Haskell array: +data Array ix elt = _Array (ix, ix) (Array# elt) + +-- And the companion "byte array" type: +data _ByteArray ix = _ByteArray (ix,ix) ByteArray# + +instance _CCallable (_ByteArray ix) + +{- ToDo: Unboxed arrays: + +{- SPECIALIZE data a{Int#} b :: Assoc a b #-} +{- SPECIALIZE data a{Int#} b :: Array a b #-} + +-} |