Improve Data.Functor documentation

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Improve Data.Functor documentation

chessai .
A beginner learning about parametricity and the relationship between Functorial composition and Functor identity brought up a good point to me: the documentation for Bifunctor[1] and Profunctor[2] both explain the relationship between parametricity and their laws, particularly what constitutes a minimum "burden" of proof. I don't have an exact wording yet, but I think it would be a good idea to update the Functor documentation accordingly. 

A separate point of issue: The line "The instances of Functor for lists, Maybe and IO satisfy these laws." This statement is redundant at best when you consider that Haskellers aim for instances of Functor to be lawful. At worst it could leave beginners confused and with more questions. I could imagine someone interpreting this statement as saying there might exist some unlawful instances. I think this line should just be removed.

Let me know what you think.

Thanks



_______________________________________________
Libraries mailing list
[hidden email]
http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries
Reply | Threaded
Open this post in threaded view
|

Re: Improve Data.Functor documentation

chessai .

On Mon, Nov 11, 2019, 7:30 AM chessai . <[hidden email]> wrote:
A beginner learning about parametricity and the relationship between Functorial composition and Functor identity brought up a good point to me: the documentation for Bifunctor[1] and Profunctor[2] both explain the relationship between parametricity and their laws, particularly what constitutes a minimum "burden" of proof. I don't have an exact wording yet, but I think it would be a good idea to update the Functor documentation accordingly. 

A separate point of issue: The line "The instances of Functor for lists, Maybe and IO satisfy these laws." This statement is redundant at best when you consider that Haskellers aim for instances of Functor to be lawful. At worst it could leave beginners confused and with more questions. I could imagine someone interpreting this statement as saying there might exist some unlawful instances. I think this line should just be removed.

Let me know what you think.

Thanks



_______________________________________________
Libraries mailing list
[hidden email]
http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries
Reply | Threaded
Open this post in threaded view
|

Re: Improve Data.Functor documentation

Tony Morris-4
In reply to this post by chessai .

+1 on both points and especially the second one.

On 11/11/19 10:30 pm, chessai . wrote:
A beginner learning about parametricity and the relationship between Functorial composition and Functor identity brought up a good point to me: the documentation for Bifunctor[1] and Profunctor[2] both explain the relationship between parametricity and their laws, particularly what constitutes a minimum "burden" of proof. I don't have an exact wording yet, but I think it would be a good idea to update the Functor documentation accordingly. 

A separate point of issue: The line "The instances of Functor for lists, Maybe and IO satisfy these laws." This statement is redundant at best when you consider that Haskellers aim for instances of Functor to be lawful. At worst it could leave beginners confused and with more questions. I could imagine someone interpreting this statement as saying there might exist some unlawful instances. I think this line should just be removed.

Let me know what you think.

Thanks



_______________________________________________
Libraries mailing list
[hidden email]
http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries

_______________________________________________
Libraries mailing list
[hidden email]
http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries

signature.asc (499 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Improve Data.Functor documentation

George Wilson
I agree with both points.

Cheers,
George

On Fri, 15 Nov 2019 at 03:05, Tony Morris <[hidden email]> wrote:

>
> +1 on both points and especially the second one.
>
> On 11/11/19 10:30 pm, chessai . wrote:
>
> A beginner learning about parametricity and the relationship between Functorial composition and Functor identity brought up a good point to me: the documentation for Bifunctor[1] and Profunctor[2] both explain the relationship between parametricity and their laws, particularly what constitutes a minimum "burden" of proof. I don't have an exact wording yet, but I think it would be a good idea to update the Functor documentation accordingly.
>
> A separate point of issue: The line "The instances of Functor for lists, Maybe and IO satisfy these laws." This statement is redundant at best when you consider that Haskellers aim for instances of Functor to be lawful. At worst it could leave beginners confused and with more questions. I could imagine someone interpreting this statement as saying there might exist some unlawful instances. I think this line should just be removed.
>
> Let me know what you think.
>
> Thanks
>
>
>
> _______________________________________________
> Libraries mailing list
> [hidden email]
> http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries
>
> _______________________________________________
> Libraries mailing list
> [hidden email]
> http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries
_______________________________________________
Libraries mailing list
[hidden email]
http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries