Makefiles need real tab chars, ffs.
[packages/dph.git] / dph-lifted-copy / Data / Array / Parallel / PArray / ScalarInstances.hs
1 {-# LANGUAGE TemplateHaskell #-}
2 {-# LANGUAGE CPP #-}
3 #include "fusion-phases.h"
4
5 -- | Instances for the Scalar class.
6 -- These let us coerce scalar U.Arrays to PData arrays.
7 module Data.Array.Parallel.PArray.ScalarInstances where
8 import Data.Array.Parallel.Lifted.TH.Repr
9 import Data.Array.Parallel.PArray.Scalar
10 import Data.Array.Parallel.PArray.PData
11 import GHC.Word ( Word8 )
12
13
14 $(scalarInstances [''Int, ''Float, ''Double, ''Word8])
15
16 {- Generated code:
17 newtype instance PData Int = PInt (U.Array Int)
18
19 instance Scalar Int where
20 fromScalarPData (PInt xs) = xs
21 toScalarPData = PInt
22
23 instance PR Int where
24 <forward to *PRScalar methods>
25 -}