<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body>
<p>Hi Richard,</p>
<p>Thanks for answering. I have made a tiny change to GHC in a fork
that lifts the monomorphization restriction but only for implicit
params. See this commit:
<a class="moz-txt-link-freetext" href="https://gitlab.haskell.org/rowanG/ghc/-/merge_requests/1/diffs?commit_id=35fcad2d7f556706dd129a57815abe421a559861">https://gitlab.haskell.org/rowanG/ghc/-/merge_requests/1/diffs?commit_id=35fcad2d7f556706dd129a57815abe421a559861</a></p>
<p>Is there some example I could run to see in action why the
monomorphisation restriction is required? I looked at the Haskell
report and I don't immediately see why the points raised apply to
implicit params. I get a feeling that monomorph(Contains only a
concrete type like Int or Bool) implicit params would never be a
problem and maybe only polymorphic ones are?</p>
<p>Rowan Goemans<br>
</p>
<div class="moz-cite-prefix">On 3/24/22 20:05, Richard Eisenberg
wrote:<br>
</div>
<blockquote type="cite"
cite="mid:010f017fbd52381d-a86b123e-7216-4cd2-b2ae-3169c8717091-000000@us-east-2.amazonses.com">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<br class="">
<div><br class="">
<blockquote type="cite" class="">
<div class="">On Mar 24, 2022, at 9:04 AM, rowan goemans <<a
href="mailto:goemansrowan@gmail.com"
class="moz-txt-link-freetext" moz-do-not-send="true">goemansrowan@gmail.com</a>>
wrote:</div>
<br class="Apple-interchange-newline">
<div class=""><span style="caret-color: rgb(0, 0, 0);
font-family: Helvetica; font-size: 14px; font-style:
normal; font-variant-caps: normal; font-weight: normal;
letter-spacing: normal; text-align: start; text-indent:
0px; text-transform: none; white-space: normal;
word-spacing: 0px; -webkit-text-stroke-width: 0px;
text-decoration: none; float: none; display: inline
!important;" class="">is this by design/expected though?</span></div>
</blockquote>
<div><br class="">
</div>
<div>It is by design, yes. With a sufficiently nuanced
expectation, I would also say it's expected. (Though, to be
fair, if I were not primed to be thinking about the
monomorphism restriction, I can't honestly say I would get it
right if quizzed.)</div>
<br class="">
<blockquote type="cite" class="">
<div class=""><span style="caret-color: rgb(0, 0, 0);
font-family: Helvetica; font-size: 14px; font-style:
normal; font-variant-caps: normal; font-weight: normal;
letter-spacing: normal; text-align: start; text-indent:
0px; text-transform: none; white-space: normal;
word-spacing: 0px; -webkit-text-stroke-width: 0px;
text-decoration: none; float: none; display: inline
!important;" class="">Would there be interest in fixing
this in GHC?</span></div>
</blockquote>
</div>
<br class="">
<div class="">Figuring out when to generalize a local binding is a
hard problem. So, there is definitely interest in finding a
better way to do it, but I don't think anyone knows a design
that meets the most expectations. Language design is hard! :)</div>
<div class=""><br class="">
</div>
<div class="">Richard</div>
</blockquote>
</body>
</html>