<div dir="ltr"><div><div><div>Or<br><br></div>When t is []: find :: (a -> Bool) -> [a] -> Maybe a<br><br></div>if this really is for the newcomer!<br><br></div>Doug<br></div><br><div class="gmail_quote"><div dir="ltr">On Mon, Oct 19, 2015 at 3:11 PM Richard Eisenberg <<a href="mailto:eir@cis.upenn.edu">eir@cis.upenn.edu</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">I would avoid the `(t ~ []) =>` prefix -- it might be confusing to the newcomers this feature is meant to serve. How about<br>
<br>
With t := []: find :: (a -> Bool) -> [a] -> Maybe a<br>
<br>
?<br>
<br>
Richard<br>
<br>
On Oct 19, 2015, at 12:47 PM, David Kraeutmann <<a href="mailto:kane@kane.cx" target="_blank">kane@kane.cx</a>> wrote:<br>
<br>
> Hi,<br>
><br>
> I'm working on a GHC feature [1] that allows users to view<br>
> specializations of functions like in (name subject to change)<br>
><br>
> ----<br>
>> :binfo find<br>
> find :: Foldable t => (a -> Bool) -> t a -> Maybe a<br>
> Specialisations:<br>
> t ~ [] => find :: (a -> Bool) -> [a] -> Maybe a<br>
><br>
>> :binfo first<br>
> first :: Arrow a => a b c -> a (b, d) (c, d)<br>
> Specialisations:<br>
> a ~ (->) => first :: (b -> c) -> (b, d) -> (c, d)<br>
> ----<br>
><br>
> Now there are two things left to decide on:<br>
> * What command should the specializations be visible under? We can<br>
> either put it under :info or make a special command :sinfo or :binfo<br>
> that displays only the expression's type and specialisations like in the<br>
> example above?<br>
><br>
> * What specializations do we want to display? goldfire suggested using<br>
> the default list, which has the added benefit of being customizable by<br>
> e.g. instructors, so adding a default Maybe (in conjunction with [2])<br>
> gives the desired behavior and not too many specializations.<br>
><br>
><br>
> Thanks for your time!<br>
> David<br>
><br>
><br>
> ----<br>
> Links:<br>
> [1] : <a href="https://ghc.haskell.org/trac/ghc/ticket/10972" rel="noreferrer" target="_blank">https://ghc.haskell.org/trac/ghc/ticket/10972</a><br>
> [2] : <a href="https://ghc.haskell.org/trac/ghc/ticket/10971" rel="noreferrer" target="_blank">https://ghc.haskell.org/trac/ghc/ticket/10971</a><br>
><br>
> _______________________________________________<br>
> Haskell-Cafe mailing list<br>
> <a href="mailto:Haskell-Cafe@haskell.org" target="_blank">Haskell-Cafe@haskell.org</a><br>
> <a href="http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe" rel="noreferrer" target="_blank">http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe</a><br>
<br>
_______________________________________________<br>
Haskell-Cafe mailing list<br>
<a href="mailto:Haskell-Cafe@haskell.org" target="_blank">Haskell-Cafe@haskell.org</a><br>
<a href="http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe" rel="noreferrer" target="_blank">http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe</a><br>
</blockquote></div>