On 14 Dec 2007, at 1:21 AM, Jules Bean wrote:
Evan Laforge wrote:
it seems that script may be not terminated if its output isn't
read, so
better code should be
(_, h, g, _) - runInteractiveCommand script params
result - hGetLine h
hGetContents h = evaluate.length
hGetContents g =
keep in mind that Haskell composition (.)
is not really composition in the category-theoretic
sense, because it adds extra laziness. Use this
Do you have a counter-example of (.) not being function composition in
the categorical sense?
___
On 16 Dec 2007, at 2:23 AM, Dominic Steinitz wrote:
keep in mind that Haskell composition (.)
is not really composition in the category-theoretic
sense, because it adds extra laziness. Use this
Do you have a counter-example of (.) not being function composition in
the categorical sense?
Let
Do you have a counter-example of (.) not being function composition in
the categorical sense?
Let bot be the function defined by
bot :: alpha - beta
bot = bot
By definition,
(.) = \ f - \ g - \ x - f (g x)
Then
bot . id
= ((\ f - \ g - \ x - f (g x)) bot) id
= (\ g - \ x
On 16 Dec 2007, at 3:21 AM, Dominic Steinitz wrote:
Do you have a counter-example of (.) not being function
composition in
the categorical sense?
Let bot be the function defined by
bot :: alpha - beta
bot = bot
By definition,
(.) = \ f - \ g - \ x - f (g x)
Then
bot . id
= ((\ f - \
Yitzchak Gale wrote:
When using seq and _|_ in the context of categories,
keep in mind that Haskell composition (.)
is not really composition in the category-theoretic
sense, because it adds extra laziness. Use this
instead:
(.!) f g x = f `seq` g `seq` f (g x)
id .! undefined
== \x -
Dominic Steinitz wrote:
This would give
= \x - bot x
and by eta reduction
This is the point: eta does not hold if seq exists.
undefined `seq` 1 == undefined
(\x - undefined x) `seq` 1 == 1
The (.) does not form a category argument should be something like:
id . undefined == (\x -
Dan Weston wrote:
newtype O f g a = O (f (g a)) -- Functor composition: f `O` g
instance (Functor f, Functor g) = Functor (O f g) where ...
instance Adjunction f g = Monad (O g f) where ...
instance Adjunction f g = Comonad (O f g) where ...
class (Functor f, Functor g)
I wrote:
(.!) f g x = f `seq` g `seq` f (g x)
Roberto Zunino wrote:
id .! undefined
== \x - undefined
/= undefined
Probably you meant
(.!) f g = f `seq` g `seq` (f . g)
Yes, thank you.
-Yitz
___
Haskell-Cafe mailing list
Roberto Zunino writes:
without seq, there is no way to distinguish between undefined and (const
undefined),
no way to distinguish is perhaps too strong. They have slightly
different types.
Jerzy Karczmarczuk
___
Haskell-Cafe mailing list
Jack Kelly wrote:
struct room{
...
struct player * players;
...
};
struct player{
...
struct room * room;
...
};
From what I can see, I'd use a record type for players and rooms, but
I'm not sure how to replicate the pointer effects:
Essentially you have to choose some form of
[EMAIL PROTECTED] wrote:
Roberto Zunino writes:
without seq, there is no way to distinguish between undefined and (const
undefined),
no way to distinguish is perhaps too strong. They have slightly
different types.
At a particular type which they both inhabit, such as (a-b) or, to be
Jules Bean wrote:
Jack Kelly wrote: -snip-
Essentially you have to choose some form of identity (relational DB fans
might call it a key) for your players and rooms. My gut feeling is
that String will do fine; it's nice for debugging, gives rise to a
natural way to write your admin commands
Roberto Zunino wrote:
Dominic Steinitz wrote:
This would give
= \x - bot x
and by eta reduction
This is the point: eta does not hold if seq exists.
undefined `seq` 1 == undefined
(\x - undefined x) `seq` 1 == 1
Ok I've never used seq and I've never used unsavePerformIO.
Jonathan Cast wrote:
On 16 Dec 2007, at 3:21 AM, Dominic Steinitz wrote:
Do you have a counter-example of (.) not being function composition in
the categorical sense?
Let bot be the function defined by
bot :: alpha - beta
bot = bot
By definition,
(.) = \ f - \ g - \ x - f (g x)
Am I correct in assuming that if my program doesn't contain seq then I
can reason using eta reduction?
You may be well aware of this, but the wiki page on the correctness
of short cut fusion (http://haskell.org/haskellwiki/
Correctness_of_short_cut_fusion) really helped me to get at least a
On Dec 16, 2007 1:45 PM, Jules Bean [EMAIL PROTECTED] wrote:
This needs to stand up to concurrent modification of a shared world
structure, but I think I'll set up the concurrency controls after I get
my head around this.t
The simplest way to do this is to bundle all your big shared mutable
On 16 Dec 2007, at 9:47 AM, Dominic Steinitz wrote:
Jonathan Cast wrote:
On 16 Dec 2007, at 3:21 AM, Dominic Steinitz wrote:
Do you have a counter-example of (.) not being function
composition in
the categorical sense?
Let bot be the function defined by
bot :: alpha - beta
bot = bot
By
I am pleased to announce the availability of the second prerelease of darcs
two, darcs 2.0.0pre2. This release fixes several severe performance bugs
that were present in the first prerelease. These issues were identified
and fixed thanks to the helpful testing of Simon Marlow and Peter Rockai.
Don Stewart wrote:
cnt:: B.ByteString - Int64
cnt bs = B.length (B.filter (== ' ') bs)
[...]
Now, this memory result is suspicious, I wonder if the now obsolete 'array fusion'
is messing things up. In Data.ByteString.Lazy, we have:
Are you sure you have a fusible length? I think I
rl:
Don Stewart wrote:
cnt:: B.ByteString - Int64
cnt bs = B.length (B.filter (== ' ') bs)
[...]
Now, this memory result is suspicious, I wonder if the now obsolete 'array
fusion'
is messing things up. In Data.ByteString.Lazy, we have:
Are you sure you have a fusible
I've had a look at how some of the code was being compiled for
strict and lazy bytestrings, and also which rules weren't firing.
With some small tweaks the code seems back in good shape.
An updated bytestring library is at :
On Sun, 2007-12-16 at 13:49 +0100, apfelmus wrote:
Dan Weston wrote:
newtype O f g a = O (f (g a)) -- Functor composition: f `O` g
instance (Functor f, Functor g) = Functor (O f g) where ...
instance Adjunction f g = Monad (O g f) where ...
instance Adjunction f g =
Hi all,
I assume the following behavior has a trivial explanation.
When I write:
case name of
a - ...
b - ...
everything works fine.
But when I extract a and b to constants:
c_a = a :: String
c_b = b :: String
case name of
c_a - ...
c_b - ...
I get Patterns
On Dec 16, 2007, at 23:35 , Adam Smyczek wrote:
case name of
c_a - ...
c_b - ...
I get Patterns match(es) are overlapped.
You can't use arbitrary expressions in patterns; any name (not a data
constructor) used in one creates a new lambda binding (shadowing any
existing
25 matches
Mail list logo