<div dir="ltr"><div><div>Thanks, that makes sense.<br><br></div>And the existing behaviour is in the compiler, so the surrounding parens are optional and can/should be stripped (except for Api Annotations)<br><br></div>Alan<br></div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, May 18, 2015 at 10:11 AM, Roman Cheplyaka <span dir="ltr"><<a href="mailto:roma@ro-che.info" target="_blank">roma@ro-che.info</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="HOEnZb"><div class="h5">On 18/05/15 10:57, Alan & Kim Zimmerman wrote:<br>
> Hi all<br>
><br>
> I am working on D836 and have the following test case<br>
><br>
>     data MaybeDefault v where<br>
>         SetTo4 :: forall v a. (( Eq v, Show v ) => v -> MaybeDefault v<br>
> -> a -> MaybeDefault [a])<br>
><br>
> GHC 7.10.1 regards the return type of SetTo4 as `MaybeDefault [a]`<br>
><br>
> The question is, due to the parens, is the return type not the whole RHS?<br>
><br>
> i.e. Similar to how in the signature<br>
><br>
>     map :: (a -> b) -> [a] -> [b]<br>
><br>
> the first paramater is a single function.<br>
><br>
> I am sure I am just confused here.<br>
<br>
</div></div>This is the wrong analogy, since (a -> b) in map's type is in the<br>
negative position.<br>
<br>
The correct analogy would be the return type of<br>
<br>
  map :: (a -> b) -> ([a] -> [b])<br>
<br>
You could argue it both ways. (But only one of them leads to the above<br>
declaration being correct, since the function type is not an instance of<br>
MaybeDefault.)<br>
<span class="HOEnZb"><font color="#888888"><br>
Roman<br>
<br>
</font></span></blockquote></div><br></div>