Functor, Applicative, Monad, Foldable, Traversable instances for (, , ) a b

amindfv at gmail.com amindfv at gmail.com
Sun Apr 9 20:27:02 UTC 2017


Genuinely curious: can people point to specific examples in their (or others') code where the ((,) a) instance for Foldable is really helpful and difficult to replace?

Tom


> El 9 abr 2017, a las 09:29, Benno Fünfstück <benno.fuenfstueck at gmail.com> escribió:
> 
> Correct me I I'm wrong but I believe Tony Morris is saying the following:
> 
> * not every operation defined for the integers "makes sense" for all integers. Example: '/' does not make sense in the case of 'x / 0'
> * yet, we still include '0' in the integers even though not every operation makes sense for '0'
> * -> not every operation in Foldable makes sense for `(,) a`
> * -> but we also include `0` in the integers, so "not every operation makes sense" is not an argument to exclude `(,) a` from being foldable,
>   just as `0` is not excluded from the integers.
> 
> Kind regards,
> Benno
> 
> Tony Morris <tonymorris at gmail.com> schrieb am So., 9. Apr. 2017 um 14:26 Uhr:
>> These two things are true:
>> 
>> * 0 is in the set of integers
>> * ∀ a. ((,) a) is Foldable, and as one of many consequences, the length
>> of all values in the set ∀ a. ((,) a) is 1.
>> 
>> There are four possible positions to take on these claims:
>> 
>> 1. Both are true.
>> 2. Both are false.
>> 3. The first true and second false.
>> 4. The second true and the first false.
>> 
>> I respect arguments 1 and 2. If I chose 1 and you chose 2, I'd say "well
>> rightio then mate and cheers to that", we'd clink glasses and move on.
>> Same if it were vice versa.
>> 
>> I do not have the same respect for positions 3 and 4.
>> 
>> On 09/04/17 19:48, Jon Fairbairn wrote:
>> > Tony Morris <tonymorris at gmail.com> writes:
>> >
>> >> I don't think it is the "appropriate" set. It's an example. 0 is in the
>> >> set of integers. The value 0 is in many sets.
>> > OK, so I clearly do not understand your argument. The
>> > implication I took from “and 0 is not an integer” is that the
>> > foldable instance for ((,) a) should be present because it is
>> > the zero case of something that has integers as its domain, and
>> > I wanted to know what that something is.  If this was not the
>> > intention of your argument, what was?
>> >
>> 
>> 
>> _______________________________________________
>> Libraries mailing list
>> Libraries at haskell.org
>> 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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/libraries/attachments/20170409/8de1da8a/attachment.html>


More information about the Libraries mailing list