Skip to content
This repository was archived by the owner on Aug 3, 2024. It is now read-only.

Commit e2731b0

Browse files
committed
Also make TyLit deterministic
1 parent 879d1fe commit e2731b0

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

haddock-api/src/Haddock/Interface/AttachInstances.hs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ import Data.Maybe ( maybeToList, mapMaybe, fromMaybe )
2828
import qualified Data.Map as Map
2929
import qualified Data.Set as Set
3030

31+
import GHC.Data.FastString (unpackFS)
3132
import GHC.Core.Class
3233
import GHC.Driver.Session
3334
import GHC.Core (isOrphan)
@@ -194,7 +195,8 @@ instance Ord SName where
194195
-- For the benefit of the user (looks nice and predictable) and the
195196
-- tests (which prefer output to be deterministic).
196197
data SimpleType = SimpleType SName [SimpleType]
197-
| SimpleTyLit TyLit
198+
| SimpleIntTyLit Integer
199+
| SimpleStringTyLit String
198200
deriving (Eq,Ord)
199201

200202

@@ -218,7 +220,8 @@ simplify (AppTy t1 t2) = SimpleType s (ts ++ maybeToList (simplify_maybe t2))
218220
simplify (TyVarTy v) = SimpleType (SName (tyVarName v)) []
219221
simplify (TyConApp tc ts) = SimpleType (SName (tyConName tc))
220222
(mapMaybe simplify_maybe ts)
221-
simplify (LitTy l) = SimpleTyLit l
223+
simplify (LitTy (NumTyLit n)) = SimpleIntTyLit n
224+
simplify (LitTy (StrTyLit s)) = SimpleStringTyLit (unpackFS s)
222225
simplify (CastTy ty _) = simplify ty
223226
simplify (CoercionTy _) = error "simplify:Coercion"
224227

0 commit comments

Comments
 (0)