Wanted: local data, class, instance declarations
john at repetae.net
Thu Feb 2 09:25:39 EST 2006
On Thu, Feb 02, 2006 at 03:34:57PM +0300, Bulat Ziganshin wrote:
> JM> Also, the need for it is questionable if we were to allow polymorphic
> JM> components and newtype deriving. if your data acts differently then it
> JM> should be a different type with a newtype and derive all the properties
> JM> where it acts the same. if you want to do different things to the same
> JM> data then packaging them up as values in a record with polymorphic
> JM> components makes perfect sense and is more functional in nature. That
> JM> class instances are global is a great feature of them, not a weakness.
> John, local definitions used in Generic Haskell (which you may don't
> know) and even in the SYB. are you really think that if we need two
> different algorithms of processing Identifier inside folds, then we
> should define two different Identifier types?
hmm? no. that is why I said if you want to do different related things
to the same data then higher order functions packaged with polymorphic
components is the way to go.
In any case, the gist wasn't so much don't implement something as much
as please don't break the current class global scope invarients in the
John Meacham - ⑆repetae.net⑆john⑈
More information about the Haskell-prime