Commit 5cb5b7a5 authored by Ben Gamari's avatar Ben Gamari Committed by Ben Gamari
Browse files

base: Derive Enum, Bounded for VecCount, VecElem


Test Plan: Validate

Reviewers: RyanGlScott, austin, hvr

Reviewed By: RyanGlScott

Subscribers: goldfire, RyanGlScott, thomie

Differential Revision: https://phabricator.haskell.org/D3059
parent d2b681bb
......@@ -1168,7 +1168,7 @@ liftedRepDataConTy, unliftedRepDataConTy,
= map (mkTyConTy . promoteDataCon) runtimeRepSimpleDataCons
vecCountTyCon :: TyCon
vecCountTyCon = pcNonEnumTyCon vecCountTyConName Nothing []
vecCountTyCon = pcTyCon True vecCountTyConName Nothing []
vecCountDataCons
-- See Note [Wiring in RuntimeRep]
......@@ -1187,7 +1187,7 @@ vec2DataConTy, vec4DataConTy, vec8DataConTy, vec16DataConTy, vec32DataConTy,
vec64DataConTy] = map (mkTyConTy . promoteDataCon) vecCountDataCons
vecElemTyCon :: TyCon
vecElemTyCon = pcNonEnumTyCon vecElemTyConName Nothing [] vecElemDataCons
vecElemTyCon = pcTyCon True vecElemTyConName Nothing [] vecElemDataCons
-- See Note [Wiring in RuntimeRep]
vecElemDataCons :: [DataCon]
......
......@@ -876,3 +876,15 @@ dn_list x0 delta lim = go (x0 :: Integer)
where
go x | x < lim = []
| otherwise = x : go (x+delta)
-- Instances from GHC.Types
-- | @since 4.10.0.0
deriving instance Bounded VecCount
-- | @since 4.10.0.0
deriving instance Enum VecCount
-- | @since 4.10.0.0
deriving instance Bounded VecElem
-- | @since 4.10.0.0
deriving instance Enum VecElem
......@@ -199,6 +199,8 @@
* The field `spInfoName` of `GHC.StaticPtr.StaticPtrInfo` has been removed.
The value is no longer available when constructing the `StaticPtr`.
* `VecElem` and `VecCount` now have `Enum` and `Bounded` instances.
### Generalizations
* Generalize `Debug.Trace.{traceM, traceShowM}` from `Monad` to `Applicative`
......
......@@ -395,6 +395,7 @@ data VecCount = Vec2
| Vec16
| Vec32
| Vec64
-- Enum, Bounded instances in GHC.Enum
-- | Element of a SIMD vector type
data VecElem = Int8ElemRep
......@@ -407,6 +408,7 @@ data VecElem = Int8ElemRep
| Word64ElemRep
| FloatElemRep
| DoubleElemRep
-- Enum, Bounded instances in GHC.Enum
{- *********************************************************************
* *
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment