Skip to content

Commit 12fa79a

Browse files
committed
bit of cleanup
1 parent b974e62 commit 12fa79a

6 files changed

Lines changed: 4 additions & 465 deletions

File tree

src/Data/Array/Accelerate/Pattern/Matchable.hs

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
{-# OPTIONS_GHC -fplugin GHC.TypeLits.KnownNat.Solver #-}
1717

1818

19-
module Data.Array.Accelerate.Pattern.Matchable where
19+
module Data.Array.Accelerate.Pattern.Matchable (Matchable(..)) where
2020

2121
import Data.Array.Accelerate.Smart as Smart
2222
import GHC.TypeLits
@@ -118,9 +118,6 @@ instance Matchable Bool where
118118
makeTag :: TAG -> SmartExp TAG
119119
makeTag x = SmartExp (Const (SingleScalarType (NumSingleType (IntegralNumType TypeTAG))) x)
120120

121-
tagType :: TupR ScalarType TAG
122-
tagType = TupRsingle (SingleScalarType (NumSingleType (IntegralNumType TypeTAG)))
123-
124121
instance (POSable (Maybe a), POSable a) => Matchable (Maybe a) where
125122
build n fs = case sameNat (Proxy @(Choices a)) (Proxy @0) of
126123
-- a has 0 valid choices (which means we cannot create a Just of this type)
@@ -292,14 +289,6 @@ instance (POSable (Either a b), POSable a, POSable b) => Matchable (Either a b)
292289
Nothing ->
293290
error "Impossible type encountered"
294291

295-
undefPairs :: forall xs . ProductType xs -> SmartExp (FlattenProduct (Merge '[] (xs ++ '[])))
296-
undefPairs PTNil = SmartExp Smart.Nil
297-
undefPairs (PTCons x xs) = SmartExp (Pair (SmartExp (Union (SmartExp (LiftUnion (unExp $ constant POS.Undef))))) (undefPairs xs))
298-
299-
mergePairs :: forall xs . ProductType xs -> SmartExp (FlattenProduct xs) -> SmartExp (FlattenProduct (Merge '[] (xs ++ '[])))
300-
mergePairs PTNil _ = SmartExp Smart.Nil
301-
mergePairs (PTCons x xs) y = SmartExp (Pair (SmartExp (Union (SmartExp (Prj PairIdxLeft y)))) (mergePairs xs (SmartExp (Prj PairIdxRight y))))
302-
303292
-- like combineProducts, but lifted to the AST
304293
buildTAG :: (All POSable xs) => NP Exp xs -> Exp TAG
305294
buildTAG SOP.Nil = Exp $ makeTag 0

0 commit comments

Comments
 (0)