Re: RFC: Add HasCallStack constraint to partial Data.List functions.

Tom Ellis <[email protected]>
Newsgroups gmane.comp.lang.haskell.libraries
Message-ID <20210609161051.GC14589@cloudinit-builder>
I wonder if we can keep our nice separation of types being declarative
and terms being operational by augmenting Richard's proposed

    partialityIsOK :: String -> (Partial => r) -> r

with

    partialityIsOKWithCallStack :: String -> (Partial => r) -> r

Then it would become the call site's choice whether to ask for a call
stack rather than just unilaterally providing one whether the caller
wants it or not (which I believe is the current situation -- I admit I
don't understand HasCallStack).

Tom


On Wed, Jun 09, 2021 at 11:51:12AM -0400, Carter Schonwald wrote:
> The sad part is seemingly it discards having an informative stack trace?
> 
> On Wed, Jun 9, 2021 at 10:16 AM Simon Peyton Jones via Libraries <
> [email protected]> wrote:
> 
> > |  If we indeed had something like
> > |
> > |      head :: Partial => [a] -> a
> > |
> > |  that would be both informative and fairly straightforward to
> > |  explain to students, for example. (Even if it is not clear to
> > |  me that a type class really is the right way to express
> > |  partiality of functions: I always thought information about
> > |  partiality ought to be tied to the function arrow.)
> >
> > OK -- that sounds promising.  It's what Richard suggested earlier, and
> > sounds pretty good to me.
_______________________________________________
Libraries mailing list
[email protected]
http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.