Johannes Waldmann [EMAIL PROTECTED] wrote:
For reference, in Java, ... there's nice syntactic sugar for looping
over collections: CollectionE c; for (E item : c) { ... }
I'd say this is an example of moving away from a left-biased
representation, or at least freeing the programmer from
Hello John,
Tuesday, February 28, 2006, 4:23:24 AM, you wrote:
i had plans to propose the same and even more:
instance C2 a b | a/=b
JM I was thinking it would be all kinds of useful if we had two predefined
JM classes
JM class Eq a b
JM class NEq a b
JM where Eq has instances exactly
instance C2 a b | a/=b
I was thinking it would be all kinds of useful if we had two predefined
classes
class Eq a b
class NEq a b
where Eq has instances exactly when its two types are equal and NEq has
instances exactly when its two types are not equal.
class Eq a b
instance Eq a a
Malcolm Wallace wrote:
Johannes Waldmann [EMAIL PROTECTED] wrote:
For reference, in Java, ... there's nice syntactic sugar for looping
over collections: CollectionE c; for (E item : c) { ... }
In Haskell, this is called 'fmap'. :-)
OK, then show me an instance Functor Set so that I can
Cale Gibbard wrote:
important point is that the elements and structure of the collection
are being constructed one at a time as you iterate over it, and they
are easily garbage collected as soon as you're done with them.
OK, I kind of buy that argument. Though the very word deforestation
Johannes Waldmann [EMAIL PROTECTED] wrote:
In Haskell, this is called 'fmap'. :-)
OK, then show me an instance Functor Set so that I can use it :-)
instance Function Set where
fmap = Data.Set.mapMonotonic
Ok, so this introduces a precondition on the function being mapped, so
there is
Malcolm Wallace wrote:
But if contexts-on-datatypes worked correctly,
data Set a = Ord a =
then even the real map from Data.Set:
map :: (Ord a, Ord b) = (a - b) - Set a - Set b
could be an instance method of Functor.
I'd love that. But I don't quite understand:
do you
Cale Gibbard wrote:
This change means that Rational is no longer a field. It makes me feel
uneasy at least. Should we really expect realToFrac to propagate those
values? Look at its type:
realToFrac :: (Real a, Fractional b) = a - b
Nothing about the Fractional class would seem to indicate
But if contexts-on-datatypes worked correctly,
data Set a = Ord a =
then even the real map from Data.Set:
map :: (Ord a, Ord b) = (a - b) - Set a - Set b
could be an instance method of Functor.
I'd love that. But I don't quite understand:
do you think this
Hello Claus,
Tuesday, February 28, 2006, 1:54:25 PM, you wrote:
CR class NEq a b
CR instance Fail a = NEq a a
CR instance NEq a b
i think that this definition just use ad-hoc overlapping instances
resolution mechanism that we want to avoid :)))
--
Best regards,
Bulat
On 28 February 2006 13:37, Lennart Augustsson wrote:
John Meacham wrote:
I mean, even a for loop in haskell is done as
mapM action [0..10]
I'd say _most_ uses of lists are deforested away because they are
used to express control and dataflow and arn't actually used as
persistant
Simon Marlow [EMAIL PROTECTED] wrote:
How does ENCODING work for a UTF-16 file, for example?
We don't know the file is UTF-16 until we read the ENCODING pragma,
and we can't read the ENCODING pragma because it's in UTF-16.
Use the same type of heuristic as XML uses (for instance).
* If
Malcolm.Wallace wrote:
(But then, how would you guarantee that the first three characters
in the file must be {-# ?)
In particular, what do you propose for literate source?
(I hardly have any .hs files.)
As far as I can see,
it seems to be possible to get LaTeX to work with UTF8;
the
On 28/02/06, John Meacham [EMAIL PROTECTED] wrote:
On Tue, Feb 28, 2006 at 12:44:04AM -0500, Cale Gibbard wrote:
I'm almost scared to ask: does this mean we need negative zero as well?
good point. probably.
This change means that Rational is no longer a field. It makes me feel
uneasy at
You addressed this to me -- but I'm an advocate for rather conservative
extensions whereas you are calling for extensions that go beyond what
any current implementation can do.
generally, that may be true,-) but in this specific case, I was just asking
for an effort to document the differences
On 2/28/06, Johannes Waldmann [EMAIL PROTECTED] wrote:
Malcolm Wallace wrote:
But if contexts-on-datatypes worked correctly,
data Set a = Ord a =
then even the real map from Data.Set:
map :: (Ord a, Ord b) = (a - b) - Set a - Set b
could be an instance method of
On 2/28/06, Ben Rudiak-Gould [EMAIL PROTECTED] wrote:
Simon Peyton-Jones wrote:
- A program that type checks can have its meaning changed by adding an
instance declaration
- Similarly adding import M() can change the meaning of a program (by
changing which instances are visible
-
Claus Reinke wrote:
most of us would be happy if instance contexts
would be required to uniquely determine the instance to be
chosen, a rather conservative extension of current practice.
I'm not so sure about the most of us, as you note yourself the
defaulting pattern is quite popular (and
18 matches
Mail list logo