Closed shayne-fletcher closed 4 years ago
Very nice.
Thanks for the help and suggestions. Think this is about done. Want a last look?
@ndmitchell I think this idea was why you suggested Data.Tuple.Extra
?
implicationsMap = Map.fromListWith (<>)
[(show a, ([c | b], [c | not b]))
| (a, flag, c) <- impliedXFlags, let b = flag == turnOn]
Seems to test out OK (use of <>
-- not sure why/how it's in scope without Data.Tuple.Extra
). Too cryptic?
Ah I see. It comes in via Prelude
(up to 3-tuples).
I was originally doing to do something like both (++)
from Data.Tuple.Extra, but that's not quite right. Using <>
seems fine.
Still super worried about the complexity!
That's much simper. Might require you lifting into your Ext type, or also going via the Show because you don't have Ord, but simpler and very definitely not O(n^2) or O(n^3) (I really worry about a find and a nub in the middle).