From 2eecc653b83fb480c38cfae371667e219571c2c5 Mon Sep 17 00:00:00 2001 From: George Thomas Date: Tue, 6 Jan 2026 22:47:41 +0000 Subject: [PATCH] Remove colours from test times The implementation is slightly awkward, and will be much more so when we'll want to count characters for nicer terminal layout. It's maybe not the best UX anyway. We'll think about alternatives. --- haskell/Pre.hs | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/haskell/Pre.hs b/haskell/Pre.hs index d0406c7..64fe062 100644 --- a/haskell/Pre.hs +++ b/haskell/Pre.hs @@ -315,9 +315,7 @@ displayTestResultsConsole testResult = T.show res <> T.singleton '.' <> T.take (if isNothing unit then 3 else 2) (T.show frac <> "000") - <> case unit of - Nothing -> setColour Dull Red - Just (u, h) -> setColour Dull h <> T.singleton u + <> foldMap T.singleton unit <> T.singleton 's' where (frac, res, unit) = case duration of @@ -331,10 +329,10 @@ displayTestResultsConsole testResult = ( carried , r , Just case iterations of - 3 -> ('m', Yellow) - 2 -> ('μ', Green) - 1 -> ('n', Green) - _ -> ('p', Green) + 3 -> 'm' + 2 -> 'μ' + 1 -> 'n' + _ -> 'p' ) (d, r) -> go (succ iterations) r d sgr = T.pack . setSGRCode