diff options
author | Sylvain Henry <sylvain@haskus.fr> | 2022-03-11 16:24:20 +0100 |
---|---|---|
committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2022-03-12 07:04:36 -0500 |
commit | 2509d676a77507833fe86d11ec4f41f463faffe4 (patch) | |
tree | 7900b2953352e5df593f925a37f90f8e5247be77 /hadrian/src | |
parent | 88a945410fe613d41fa3778b71fc187c6ec90155 (diff) | |
download | haskell-2509d676a77507833fe86d11ec4f41f463faffe4.tar.gz |
Hadrian: avoid allocating in stageString (#19209)
Diffstat (limited to 'hadrian/src')
-rw-r--r-- | hadrian/src/Stage.hs | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/hadrian/src/Stage.hs b/hadrian/src/Stage.hs index 7c9405c2b8..8f243ff8d7 100644 --- a/hadrian/src/Stage.hs +++ b/hadrian/src/Stage.hs @@ -1,3 +1,4 @@ +{-# LANGUAGE LambdaCase #-} module Stage (Stage (..), stageString) where import Development.Shake.Classes @@ -28,4 +29,8 @@ instance NFData Stage -- | Prettyprint a 'Stage'. stageString :: Stage -> String -stageString stage = "stage" ++ show (fromEnum stage) +stageString = \case + Stage0 -> "stage0" + Stage1 -> "stage1" + Stage2 -> "stage2" + Stage3 -> "stage3" |