Because it is the most utilitarian way to get a bunch of strict ByteStrings
out of a lazy one.
Yes it exposes an implementation detail, but the alternatives involve an
unnatural amount of copying.
-Edward Kmett
On Sat, Apr 17, 2010 at 6:37 PM, Ashley Yakeley ash...@semantic.org wrote:
Ketil
Ashley Yakeley ash...@semantic.org writes:
There's an impedance mismatch between the IEEE notion of equality
(under which -0.0 == 0.0), and the Haskell notion of equality (where
we'd want x == y to imply f x == f y).
Do we also want to modify equality for lazy bytestrings, where equality
is
On Thu, 15 Apr 2010, Maciej Piechotka wrote:
Are
f 0 = 1
f n = f (n - 1) + f (n - 2)
and
g 0 = 1
g n | n 0 = g (n - 1) + g (n - 2)
| n 0 = g (n + 2) - g (n + 1)
The same (morally) function?
Are:
f x = 2*x
and
f x = undefined
The same function
Try using the (x == y) == (f x = g
On 03:53 Thu 15 Apr , rocon...@theorem.ca wrote:
On Wed, 14 Apr 2010, Ashley Yakeley wrote:
On 2010-04-14 14:58, Ashley Yakeley wrote:
On 2010-04-14 13:59, rocon...@theorem.ca wrote:
There is some notion of value, let's call it proper value, such that
bottom is not one.
In
On Apr 15, 2010, at 12:53 AM, rocon...@theorem.ca wrote:
I'd call them disrespectful functions, or maybe nowadays I might
call them
improper functions. The good functions are respectful functions or
proper functions.
There's no need to put these into a different class. The IEEE defined
Your instances of Finite are not quite right:
bottom :: a
bottom = doSomethingToLoopInfinitely.
instance Finite () where
allValues = [(), bottom]
instance Finite Nothing where
allValues = [bottom]
Though at a guess an allValuesExculdingBottom function is also useful, perhaps
the class
On Wed, 2010-04-14 at 08:13 +0100, Thomas Davie wrote:
Your instances of Finite are not quite right:
bottom :: a
bottom = doSomethingToLoopInfinitely.
instance Finite () where
allValues = [(), bottom]
Bottom is not a value, it's failure to evaluate to a value.
But if one did start
But if one did start considering bottom to be a value, one would have to
distinguish different ones. For instance, (error ABC) vs. (error
PQR). Obviously this is not finite.
Nor is it computable, since it must distinguish terminating programs
from nonterminating ones (i.e. the halting
On 14 Apr 2010, at 08:29, Ashley Yakeley wrote:
On Wed, 2010-04-14 at 08:13 +0100, Thomas Davie wrote:
Your instances of Finite are not quite right:
bottom :: a
bottom = doSomethingToLoopInfinitely.
instance Finite () where
allValues = [(), bottom]
Bottom is not a value, it's
On 14 Apr 2010, at 09:01, Jonas Almström Duregård wrote:
But if one did start considering bottom to be a value, one would have to
distinguish different ones. For instance, (error ABC) vs. (error
PQR). Obviously this is not finite.
Nor is it computable, since it must distinguish terminating
f,g :: Bool - Int
f x = 6
g x = 6
We can in Haskell compute that these two functions are equal, without solving
the halting problem.
Of course, this is the nature of generally undecidable problems. They
are decidable in some cases, but not in general.
/Jonas
2010/4/14 Thomas Davie
f,g :: Bool - Int
f x = 6
g x = 6
We can in Haskell compute that these two functions are equal, without solving
the halting problem.
what about these?
f,g :: Bool - Int
f x = 6
g x = x `seq` 6
/Jonas
2010/4/14 Thomas Davie tom.da...@gmail.com:
On 14 Apr 2010, at 09:01, Jonas Almström
On 14 Apr 2010, at 09:08, Jonas Almström Duregård wrote:
f,g :: Bool - Int
f x = 6
g x = 6
We can in Haskell compute that these two functions are equal, without
solving the halting problem.
Of course, this is the nature of generally undecidable problems. They
are decidable in some
On 14 Apr 2010, at 09:12, Jonas Almström Duregård wrote:
f,g :: Bool - Int
f x = 6
g x = 6
We can in Haskell compute that these two functions are equal, without
solving the halting problem.
what about these?
f,g :: Bool - Int
f x = 6
g x = x `seq` 6
As pointed out on #haskell by
what about these?
f,g :: Bool - Int
f x = 6
g x = x `seq` 6
As pointed out on #haskell by roconnor, we apparently don't care, this is a
shame... We only care that x == y = f x == g y, and x == y can't tell if
_|_ == _|_.
So the facts that
(1) f == g
(2) f undefined = 6
(3) g undefined =
On 14 Apr 2010, at 09:35, Jonas Almström Duregård wrote:
what about these?
f,g :: Bool - Int
f x = 6
g x = x `seq` 6
As pointed out on #haskell by roconnor, we apparently don't care, this is a
shame... We only care that x == y = f x == g y, and x == y can't tell if
_|_ == _|_.
So
Ashley Yakeley schrieb:
Joe Fredette wrote:
this is bounded, enumerable, but infinite.
The question is whether there are types like this. If so, we would
need a new class:
I assume that comparing functions is more oftenly a mistake then
actually wanted. Say I have compared
f x == f y
and
On Wed, 14 Apr 2010, Ashley Yakeley wrote:
Joe Fredette wrote:
this is bounded, enumerable, but infinite.
The question is whether there are types like this. If so, we would need a new
class:
class Finite a where
allValues :: [a]
instance (Finite a,Eq b) = Eq (a - b) where
p == q
On Wed, Apr 14, 2010 at 4:41 AM, rocon...@theorem.ca wrote:
As ski noted on #haskell we probably want to extend this to work on Compact
types and not just Finite types
instance (Compact a, Eq b) = Eq (a - b) where ...
For example (Int - Bool) is a perfectly fine Compact set that isn't
On Wed, Apr 14, 2010 at 5:13 AM, Luke Palmer lrpal...@gmail.com wrote:
On Wed, Apr 14, 2010 at 4:41 AM, rocon...@theorem.ca wrote:
As ski noted on #haskell we probably want to extend this to work on Compact
types and not just Finite types
instance (Compact a, Eq b) = Eq (a - b) where ...
On Wed, Apr 14, 2010 at 02:07:52AM -0700, Ashley Yakeley wrote:
So the facts that
(1) f == g
(2) f undefined = 6
(3) g undefined = undefined
is not a problem?
This is not a problem. f and g represent the same moral function, they
are just implemented differently. f is smart enough to
On Wed, Apr 14, 2010 at 2:22 PM, Stefan Monnier
monn...@iro.umontreal.ca wrote:
While we're here, I'd be more interested in a dirtyfast comparison
operation which could look like:
eq :: a - a - IO Bool
where the semantics is if (eq x y) returns True, then x and y are the
same object,
On Apr 14, 2010, at 12:16 PM, Ashley Yakeley wrote:
They are distinct Haskell functions, but they represent the same
moral function.
If you're willing to accept that distinct functions can represent the
same moral function, you should be willing to accept that different
bottoms
On Wed, 14 Apr 2010, Ashley Yakeley wrote:
On 2010-04-14 13:03, Alexander Solla wrote:
If you're willing to accept that distinct functions can represent the
same moral function, you should be willing to accept that different
bottoms represent the same moral value.
Bottoms should not be
On Apr 14, 2010, at 5:10 PM, Ashley Yakeley wrote:
Worse, this rules out values of types that are not Eq.
In principle, every type is an instance of Eq, because every type
satisfies the identity function. Unfortunately, you can't DERIVE
instances in general. As you are finding out...
25 matches
Mail list logo