Mark partial functions as such

Andrew Butterfield Andrew.Butterfield at scss.tcd.ie
Fri Aug 31 08:34:31 UTC 2018


+1 from me too.

How about also adding in (to the documentation) the pre-condition - i.e. an identification of the inputs for which it will terminate and produce a result
(where this is possible to state, of course).


> On 31 Aug 2018, at 03:05, Daniel Díaz Casanueva <dhelta.diaz at gmail.com> wrote:
> 
> +1 from me too. The partiality of a function seems to me like something that should be documented.
> 
> Best,
> Daniel
> 
> Am Fr., 31. Aug. 2018 um 02:10 Uhr schrieb Richard Eisenberg <rae at cs.brynmawr.edu <mailto:rae at cs.brynmawr.edu>>:
> Proposal: Mark partial functions in `base` as partial
> 
> Motivation: I'm about to teach Haskell to a classful of beginners. In my experience, they will soon reach for functions like `head` and `tail`, because pattern-matching is foreign to them. I would love just to be able to say "Don't use partial functions", but many students will not easily be able to tell partial functions from total ones.
> 
> I do expect this problem to work itself out rather quickly, and then students will be able to identify partial functions, but loudly marking partial functions as partial seems like a small service to everyone and a bigger one to newbies. I don't see any downsides.
> 
> Thoughts?
> 
> Thanks,
> Richard
> _______________________________________________
> Libraries mailing list
> Libraries at haskell.org <mailto:Libraries at haskell.org>
> http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries <http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries>
> _______________________________________________
> Libraries mailing list
> Libraries at haskell.org
> http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries

--------------------------------------------------------------------
Andrew Butterfield     Tel: +353-1-896-2517     Fax: +353-1-677-2204
Lero at TCD, Head of Foundations & Methods Research Group
School of Computer Science and Statistics,
Room G.39, O'Reilly Institute, Trinity College, University of Dublin
                         http://www.scss.tcd.ie/Andrew.Butterfield/
--------------------------------------------------------------------

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/libraries/attachments/20180831/ed8dedc1/attachment.html>


More information about the Libraries mailing list