<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Feb 5, 2016 at 2:16 PM, Takenobu Tani <span dir="ltr"><<a href="mailto:takenobu.hs@gmail.com" target="_blank">takenobu.hs@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div>Hi,</div><div><br></div><div>I'll worry about the learning curve of beginners.</div><div>Maybe, beginners will try following session in their 1st week.</div><div><br></div><div>  ghci> :t foldr</div><div>  ghci> :t ($)</div><div><br></div><div>They'll get following result.</div><div><br></div><div><br></div><div>Before ghc7.8:</div><div><br></div><div>  Prelude> :t foldr</div><div>  foldr :: (a -> b -> b) -> b -> [a] -> b</div><div><br></div><div>  Prelude> :t ($)</div><span class=""><div>  ($) :: (a -> b) -> a -> b</div><div><br></div></span><div>  Beginners should only understand about following:</div><div><br></div><div>    * type variable (polymorphism)</div><div><br></div><div><br></div><div>After ghc8.0:</div><div><br></div><div>  Prelude> :t foldr</div><div>  foldr :: Foldable t => (a -> b -> b) -> b -> t a -> b</div><div><br></div></div></blockquote><div><br><div>If the output was the following it would be more understandable (and more encouraging!)<br><br>"""<br></div>Prelude> :t foldr<br><div>foldr :: Foldable t => (a -> b -> b) -> b -> t a -> b<br></div><div>For example:<br></div><div>foldr :: (a -> b -> b) -> b -> [a] -> b<br></div><div>foldr :: (a -> b -> b) -> b -> Maybe a -> b<br></div><div>foldr :: (a -> b -> b) -> b -> Identity a -> b<br></div><div>foldr :: (a -> b -> b) -> b -> (c, a) -> b<br></div>and more<br>"""<br><br></div><div>It is easy to see a pattern here.  The order of the instances used could be the load order, so the ones from Prelude would come first.<br></div><div><br> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div></div><div>  Prelude> :t ($)</div><div>  ($)</div><div>    :: forall (w :: GHC.Types.Levity) a (b :: TYPE w).</div><span class=""><div>       (a -> b) -> a -> b</div><div><br></div></span></div></blockquote><div><br></div><div>I'm not sure how this would work here, but when Levity is *, this should collapse into the old syntax, so:<br><br>"""<br></div><div>Prelude> :t ($)<br>($) :: <"unreadable blurb"><br></div><div>For example:<br>($) :: (a -> b) -> a -> b<br></div><div>($) :: forall a (b :: #). (a -> b) -> a -> b</div><div>"""<br><br></div><div>At least one of those lines should be understandable.<br></div><div><br></div><div>Alexander<br></div><br></div></div></div>