one thought - (set (seq a-set)) is pure even is (seq a-set) is not - because (set a-seq) throws away the (random) order information that was added.
Dave On Wednesday, 22 April 2015 19:03:23 UTC+10, Mark Derricutt wrote: > > On 22 Apr 2015, at 20:22, Dave Sann wrote: > > for example: seq on a set cannot be pure unless you were to provide an > argument to explicitly specify which order the items should be in. If you > do not do this, the order is defined either by some random interaction of > the of the data and function implementations - that you thought was > irrelevant - or has to be literally picked at random by the implementation. > The former of these will appear to be pure until you hit the special cases. > > This is exactly one of the reasons a bunch of folk ( aka, purests maybe ) > don't like that map/filter etc. in Clojure convert the input collection > into seqs, unlike Haskell or others where the those monad laws keep you in > check that map/filter return the *same* container - so mapping a set > would yield another set - also with no guaranteed order, and also with > uniqueness applied - so technically a map over a set may yield a collection > of an equal or smaller size, but never greater. > > This seems to fuel a lot of debate when entered into - so I guess I'm > asking for trouble in replies here :) > > Mark > > -- > Mark Derricutt > http://www.theoryinpractice.net > http://www.chaliceofblood.net > http://plus.google.com/+MarkDerricutt > http://twitter.com/talios > http://facebook.com/mderricutt > -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en --- You received this message because you are subscribed to the Google Groups "Clojure" group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.