<div dir="ltr"><div style="font-size:13px">Hi,</div><div style="font-size:13px"><br></div><div style="font-size:13px">I've recently run into an issue whereby changing textual case comparison</div><div style="font-size:13px">to use the <a href="http://hackage.haskell.org/package/case-insensitive-1.2.0.3/docs/Data-CaseInsensitive.html" target="_blank">Data.CaseInsensitive.mk</a> smart constructor causes substantial</div><div style="font-size:13px">differences to outputted core language and a related compilation speed regression.</div><div style="font-size:13px"><br></div><div style="font-size:13px">The code which seems to cause this is here:</div><div style="font-size:13px"><a href="https://github.com/brendanhay/amazonka/blob/release/0.1.4/core/src/Network/AWS/Data/Internal/Text.hs#L51" target="_blank">https://github.com/brendanhay/amazonka/blob/release/0.1.4/core/src/Network/AWS/Data/Internal/Text.hs#L51</a></div><div style="font-size:13px"><br></div><div style="font-size:13px">With the downstream project having about 68 call sites for the above function starting here:</div><div style="font-size:13px"><a href="https://github.com/brendanhay/amazonka/blob/release/0.1.4/amazonka-ec2/gen/Network/AWS/EC2/Types.hs#L1465" target="_blank">https://github.com/brendanhay/amazonka/blob/release/0.1.4/amazonka-ec2/gen/Network/AWS/EC2/Types.hs#L1465</a></div><div style="font-size:13px"><br></div><div style="font-size:13px">For comparison, the previous version used <a href="http://hackage.haskell.org/package/attoparsec-0.12.1.2/docs/Data-Attoparsec-Text.html">Attoparsec.Text.takeText</a> and Text values.</div><div style="font-size:13px"><br></div><div style="font-size:13px">Here are some hand wavy points of interest:</div><div style="font-size:13px"><br></div><div style="font-size:13px">* Before (Case Sensitive)</div><div style="font-size:13px">Function: takeText = Attoparsec.Text.takeText</div><div style="font-size:13px">Time (real): 2m27.735s</div><div style="font-size:13px">amazonka-ec2/gen/Network/AWS/EC2/Types.hs (simpl): {terms: 242,688, types: 310,463, coercions: 31,215}</div><div style="font-size:13px"><br></div><div style="font-size:13px">* After (Case Insensitive)</div><div style="font-size:13px">Function: takeCI = <a href="http://Data.CaseInsensitive.mk">Data.CaseInsensitive.mk</a> <$> Attoparsec.Text.takeText</div><div style="font-size:13px">Time (real): 11m31.937s</div><div style="font-size:13px">amazonka-ec2/gen/Network/AWS/EC2/Types.hs (simpl): {terms: 1,384,779, types: 465,656, coercions: 33,510}</div><div style="font-size:13px"><br></div><div style="font-size:13px">I'm finding the outputted core rather unwieldy to analyse, but the main</div><div style="font-size:13px">difference seems to be the inclusion of huge swathes of case statements like:</div><div style="font-size:13px"><a href="https://gist.github.com/brendanhay/5a57f073d5a7d196a1ad" target="_blank">https://gist.github.com/brendanhay/5a57f073d5a7d196a1ad</a></div><div style="font-size:13px"><br></div><div style="font-size:13px">It would be appreciated if someone could help me to understand in simple terms why</div><div style="font-size:13px">the use of case-insensitive causes this.</div></div>