Hello Peter,
Friday, February 13, 2009, 2:17:52 AM, you wrote:
If so, how would it be possible to make sure that the operation of
reading the current time and writing the pair to the MVar is an
atomic operation, in the sense that no thread switch can happen
between the two? Would this
On Fri, Feb 13, 2009 at 2:05 AM, Chung-chieh Shan
ccs...@post.harvard.edu wrote:
...
It's not unheard of for the scheduler to react in different ways to the
same system call -- I'm thinking of reading from a file, for example.
Sure, I went implementing something slitghtly different to double
Hey,
Thanks for all the suggestions. I was hoping that there was some uniform
pattern that would extend to n arguments (rather than having to use
liftM2, litM3, etc. or have different 'application' operators in between
the different arguments); perhaps not. Oh well :)
Thanks again!
Edsko
On Fri, 2009-02-13 at 08:33 +0100, Krzysztof Skrzętnicki wrote:
On Fri, Feb 13, 2009 at 08:06, Magicloud magicloud.magiclo...@gmail.com
wrote:
Hi,
I am using Text.CSV to read and using gtk2hs to display csv files using
utf-8 encode. Well, it displays broken strings, seems like it cannot
On Thu, 2009-02-12 at 22:58 -0500, David Menendez wrote:
On Thu, Feb 12, 2009 at 6:26 PM, Don Stewart d...@galois.com wrote:
bugfact:
Consider the following code
stamp v x = do
t - getCurrentTime
putMVar v (x,t)
Is it possible - with GHC - that a thread switch happens after
Jonathan Cast wrote:
NB: This example is *precisely* why I will never adopt MathML as an
authoring format. Bowing and scraping at the alter of W3C is not worth
using such a terrible syntax, not ever.
(Indented, that's
math
mrow
msup
mix/mi
mn2/mn
When I came to haskell, I arrived with a small and only evolutionary
background in programming. First monad I met was MonadState StdGen m.
Everything was in someway acceptable, I had no problem in
explicitating the need for the generator.
The lesson was referential transparency. To me referential
class Foobar a b where
foobar :: a - b - Int
instance Foobar String Int where ...
instance Foobar Int String where ...
2009/2/13 Daniel Kraft d...@domob.eu:
Hi,
I just came across a problem like this: Suppose I've got two related
functions that do similar things, and I want to call them
If you have two functions that do two different things, then they
certainly OUGHT to have different names.
You can of course put the two functions in different modules. Then
they do have different (qualified) names.
2009/2/13 Daniel Kraft d...@domob.eu:
Hi,
I just came across a problem like
Colin Adams wrote:
If you have two functions that do two different things, then they
certainly OUGHT to have different names.
Well, they do the same thing but for different arguments; it's like this:
Table is a table of name-value pairs I want to substitute in a tree-like
structure using:
On Fri, 2009-02-13 at 13:25 +0300, Eugene Kirpichov wrote:
class Foobar a b where
foobar :: a - b - Int
instance Foobar String Int where ...
instance Foobar Int String where ...
But we typically do not to this. It's ugly. Classes work nicely when
there is some kind of parametrisation
2009/2/13 Daniel Kraft d...@domob.eu:
Colin Adams wrote:
If you have two functions that do two different things, then they
certainly OUGHT to have different names.
Well, they do the same thing but for different arguments; it's like this:
Table is a table of name-value pairs I want to
Hi
Table is a table of name-value pairs I want to substitute in a tree-like
structure using:
substitute :: Table - Tree - Tree
For substituting a single name-value pair I want to define this utitlity
routine so I don't have to construct a Table all the time in the user code:
substitute
Ah yes, then you're doing a double handshaking in a sense, of course. Not
ideal if you just want to put something in the MVar and resume as quick as
possible. However, in that case one could fork a dummy thread that only does
readMVar I guess.
But does it also work when you want multiple threads
On Fri, 2009-02-13 at 11:40 +0100, Daniel Kraft wrote:
Colin Adams wrote:
If you have two functions that do two different things, then they
certainly OUGHT to have different names.
Well, they do the same thing but for different arguments; it's like this:
Table is a table of name-value
Hi,
I just came across a problem like this: Suppose I've got two related
functions that do similar things, and I want to call them the same...
Like in:
foobar :: String - Int - Int
foobar :: Int - String - Int
(Bad example, but I hope you got the point.)
Is this kind of overloading
Daniel Kraft wrote:
Is this kind of overloading (instead of the polymorphism based
overloading) possible in Haskell? Namely to have two functions with the
same name but different signatures so they could be distinguished by a
call's parameters? I fear not... So I guess I have to name the
Hi folks,
Does anyone have any experience with apache configuration, particularly
mime types and handling browser quirks and would like to help us with an
issue we have on hackage?
http://hackage.haskell.org/trac/hackage/ticket/498
The problem is described in the ticket but basically IE6 gets
On Fri, 2009-02-13 at 10:58 +, Duncan Coutts wrote:
Hi folks,
Does anyone have any experience with apache configuration, particularly
mime types and handling browser quirks and would like to help us with an
issue we have on hackage?
http://hackage.haskell.org/trac/hackage/ticket/498
On Fri, 2009-02-13 at 22:39 +1100, George Pollard wrote:
On Fri, 2009-02-13 at 10:58 +, Duncan Coutts wrote:
Hi folks,
Does anyone have any experience with apache configuration, particularly
mime types and handling browser quirks and would like to help us with an
issue we have on
Yesterday I saw Haskell mentioned for the first time in a magazine, Bits
Chips. It is a magazine for professionals, about hardware and software;
the article was about the domain specific language Cryptol from Galois.
In the same issue of the magazine, there was an article saying that the
On Fri, 13 Feb 2009 15:52:48 +0100
Henk-Jan van Tuyl hjgt...@chello.nl wrote:
Yesterday I saw Haskell mentioned for the first time in a magazine,
Bits Chips. It is a magazine for professionals, about hardware and
software; the article was about the domain specific language Cryptol
from
Corey O'Connor wrote:
I released a new version of data-spacepart that resolved some of the
issues with the previous release. One issue I had was the previous
release used the version numbering scheme I use at work:
[date].[release] Which does not appear to work as well as the
traditional X.Y.Z
Daniel Kraft wrote:
Hi,
I noticed last year Haskell.org was a mentoring organization for
Google's Summer of Code, and I barely noticed some discussion about it
applying again this year :)
I participated for GCC in 2008 and would like to try again this year;
while I'm still active for GCC
Hi Edsko
On 13 Feb 2009, at 09:14, Edsko de Vries wrote:
Hey,
Thanks for all the suggestions. I was hoping that there was some
uniform
pattern that would extend to n arguments (rather than having to use
liftM2, litM3, etc. or have different 'application' operators in
between
the
I think the recent discussion about advanced markup for Haddock
documentation could yield a Summer of code project. I still like my
suggestion to use Haskell code as description for math formulas and I like
Wolfgang's idea to use an existing tool like Template Haskell for
conversion from
Daniel Kraft wrote:
Hi,
I just came across a problem like this: Suppose I've got two related
functions that do similar things, and I want to call them the same...
Like in:
foobar :: String - Int - Int
foobar :: Int - String - Int
(Bad example, but I hope you got the point.)
On Fri, 2009-02-13 at 11:08 +0100, Heinrich Apfelmus wrote:
Jonathan Cast wrote:
NB: This example is *precisely* why I will never adopt MathML as an
authoring format. Bowing and scraping at the alter of W3C is not worth
using such a terrible syntax, not ever.
(Indented, that's
Hi,
I want to run multiple programs and dump the stdout/stderr to a file,
I've tried doing:
h - openFile file WriteMode
let c = CreateProcess (RawCommand file [])
Nothing Nothing
Inherit (UseHandle h) (UseHandle h) False
(_,_,_,pid)
Robin Green wrote:
I think we can fairly safely discount the commercial relevance of any
language ranking which places LOGO so highly.
It may be that a lot of people *know* LOGO (or claim to know it), but
that does not mean that is used a lot for commercial programming.
If we discuss here
Hi,
Henning Thielemann wrote:
Daniel Kraft wrote:
I noticed last year Haskell.org was a mentoring organization for
Google's Summer of Code, and I barely noticed some discussion about it
applying again this year :)
I participated for GCC in 2008 and would like to try again this year;
while
On Fri, 13 Feb 2009, Daniel Kraft wrote:
Henning Thielemann wrote:
DoCon?
hm, I've only read a little on their webpage; what I was thinking of was to
implement a very basic package just to do some symbolic integration or
equation solving to be embedded in some other calculation, and
Could it be considered a bug when a function compiles fine without type
signature, but when you add the type signature that GHCi reports with :type,
it fails to compile?
I am using functional dependencies, and I know these are not the best way to
do it.
Can all functional dependencies be
What about making a SoC out of the problem? A mathematical markup
language that is easily written as well as valid Haskell, executable
within reason, compilable into mathML (think backticks) and would
revolutionise the typeset quality of literate programming?
--
(c) this sig last receiving data
Chances are the program you're using to write your e-mails was written
in C++ (or at least C), so don't knock it. :-)
In any case, no one has really addressed the original poster's
question: No, name overloading is not possible in Haskell, and
surprisingly, there are no blocking
Hey,
Thanks for all the suggestions. I was hoping that there was some
uniform
pattern that would extend to n arguments (rather than having to use
liftM2, litM3, etc. or have different 'application' operators in
between
the different arguments); perhaps not. Oh well :)
Sure you can!
On Fri, 13 Feb 2009, Achim Schneider wrote:
What about making a SoC out of the problem? A mathematical markup
language that is easily written as well as valid Haskell, executable
within reason, compilable into mathML (think backticks) and would
revolutionise the typeset quality of literate
On Fri, 13 Feb 2009, John A. De Goes wrote:
In any case, no one has really addressed the original poster's question: No,
name overloading is not possible in Haskell, and surprisingly, there are no
blocking technical issues why this must be the case.
Prefixing names with module names is good
Hi,
class Processor a where
ready :: (forall b c. a → [b → c])
{-
instance Processor (b → c) where
ready = repeat
instance Processor [b → c] where
ready = id-}
doSth :: (Show p, Processor p) ⇒ p → IO ()
doSth p = print p
---
Why can I not declare the above
The signal-to-noise ratio with fully qualified names/operators goes
way down -- that's the need.
Go take one of your programs and fully qualify every name and every
operator. Doesn't look so pretty then, does it? And it wouldn't be
easy to read, either.
Regards,
John A. De Goes
Peter Verswyvelen wrote:
Could it be considered a bug when a function compiles fine without type
signature, but when you add the type signature that GHCi reports with
:type, it fails to compile?
Can you share with us your function and the compiler error, or a small
test case and the compiler
Hi
Chances are the program you're using to write your e-mails was written in
C++ (or at least C), so don't knock it. :-)
Firefox (Javascript + C++) and Gmail (Python, so I think I read, no
doubt with C underneath somewhere). However, I am sat writing C++ at
the moment - which I think gives me
Peter Verswyvelen wrote:
Could it be considered a bug when a function compiles fine without type
signature, but when you add the type signature that GHCi reports with
:type, it fails to compile?
There are such cases where it is not a bug. For example, given
import Data.Map (fromList)
x
Ouch, how silly of me, I did not make a backup and have been fiddling with
the code and now it works. Next time I make sure I'll make backup, sorry
about that.
On Fri, Feb 13, 2009 at 5:45 PM, Martijn van Steenbergen
mart...@van.steenbergen.nl wrote:
Peter Verswyvelen wrote:
Could it be
Why do you say every name and operator ? Why do you say fully qualified ?
When there is some clash, hiding the offending name or importing
qualified as is
quite satisfying imho.
Thu
2009/2/13 John A. De Goes j...@n-brain.net:
The signal-to-noise ratio with fully qualified names/operators goes
Many thanks to everybody who tried to set me straight on the thread about IO
monad and evaluation semantics. I've begun summarizing the info, and I
believe I've come up with a much better way of explaining IO; just flip the
semantic perspective, and think in terms of interpretations instead of
No the error I got was
Could not deduce (Controller m v c)
from the context (Controller m v c2)
arising from a use of `MVC' at NM8\GUI\PanZoom.hs:126:32-65
Possible fix:
add (Controller m v c) to the context of the constructor `MVC'
In the expression: MVC m v (PZC s z
Hello,
As far as I can tell, createProcess is closing the handle:
createProcess
:: CreateProcess
- IO (Maybe Handle, Maybe Handle, Maybe Handle, ProcessHandle)
createProcess cp = do
r - runGenProcess_ runGenProcess cp Nothing Nothing
maybeCloseStd (std_in cp)
maybeCloseStd (std_out
I come from a mathematical background (in which it is quite common to
overload function names and operators in particular), so from my
point of view, the lack of name overloading is a wart on Haskell. That
such a feature would complicate type inference is more a concern to an
Henk-Jan van Tuyl hjgt...@chello.nl writes:
My own research, using Google:
Search Hits
---
Java programming 20.400.000
LOGO programming 14.600.000
I get about that number of hits googling for logo programming
(without quotes). However,
Cetin Sert schrieb:
Hi,
class Processor a where
ready :: (forall b c. a → [b → c])
instance Processor (b → c) where
ready = repeat
...
---
Why can I not declare the above instances and always get:
Hi Cetin,
in your class declaration you state that a
Ketil Malde ke...@malde.org wrote:
Henk-Jan van Tuyl hjgt...@chello.nl writes:
My own research, using Google:
Search Hits
---
Java programming 20.400.000
LOGO programming 14.600.000
I get about that number of hits googling for logo
On Fri, 2009-02-13 at 11:12 -0700, John A. De Goes wrote:
I come from a mathematical background (in which it is quite common to
overload function names and operators in particular)
Usually `when no ambiguity can arise', no? Plenty of mathematical
practice rests on imprecision and the
On Feb 13, 2009, at 11:23 AM, Jonathan Cast wrote:
Usually `when no ambiguity can arise', no? Plenty of mathematical
practice rests on imprecision and the expectation that the human
reader
will understand what you mean. Haskell has to be understandable by
the
machine (which is less
On Fri, 2009-02-13 at 11:29 -0700, John A. De Goes wrote:
On Feb 13, 2009, at 11:23 AM, Jonathan Cast wrote:
Usually `when no ambiguity can arise', no? Plenty of mathematical
practice rests on imprecision and the expectation that the human
reader
will understand what you mean. Haskell
On Feb 13, 2009, at 11:32 AM, Jonathan Cast wrote:
I believe the last time it was brought up, the proposal was that type
inference should fail on certain typeable terms. That doesn't count.
I'm referring to a rather conservative proposal wherein if there is
one and exactly one definition
On Fri, 2009-02-13 at 11:45 -0700, John A. De Goes wrote:
On Feb 13, 2009, at 11:32 AM, Jonathan Cast wrote:
I believe the last time it was brought up, the proposal was that type
inference should fail on certain typeable terms. That doesn't count.
I'm referring to a rather conservative
module Main where
import Control.Monad
import Control.Concurrent
class Processor p where
ready :: p b c → [b → c]
instance Processor (→) where
ready = repeat
--instance Processor [b → c] where
--ready = id
newtype FunList b c = FunList [b → c]
instance Processor FunList where
ready
Am Freitag, 13. Februar 2009 19:49 schrieb Jonathan Cast:
On Fri, 2009-02-13 at 11:45 -0700, John A. De Goes wrote:
On Feb 13, 2009, at 11:32 AM, Jonathan Cast wrote:
I believe the last time it was brought up, the proposal was that type
inference should fail on certain typeable terms.
On Feb 13, 2009, at 11:49 AM, Jonathan Cast wrote:
It breaks type inference. I explained this at the time. I can
explain
it again:
import Data.List
import Data.Set
import Data.Map
warmFuzzyThingFirstOperation = map
This gives an error currently. Quite properly. But if *any* use of
On Fri, 2009-02-13 at 20:06 +0100, Daniel Fischer wrote:
Am Freitag, 13. Februar 2009 19:49 schrieb Jonathan Cast:
On Fri, 2009-02-13 at 11:45 -0700, John A. De Goes wrote:
On Feb 13, 2009, at 11:32 AM, Jonathan Cast wrote:
I believe the last time it was brought up, the proposal was that
On Fri, 2009-02-13 at 12:06 -0700, John A. De Goes wrote:
On Feb 13, 2009, at 11:49 AM, Jonathan Cast wrote:
It breaks type inference. I explained this at the time. I can
explain
it again:
import Data.List
import Data.Set
import Data.Map
warmFuzzyThingFirstOperation =
Hi Daniel,
A more functional approach might be:
type Substitution = String - Maybe Value
single :: String - Value - Substitution
table :: Table - Substitution
substitute :: Substitution - Tree - Tree
For better performance and a lot more features, you could switch to
type
On Feb 13, 2009, at 12:07 PM, Jonathan Cast wrote:
Exactly! But if it fails, why on earth should any other use of map in
the module succeed?
Because more information is known about other usages of map. Such is
the nature of type inference.
If you wanted to go a step further, then I
Cetin Sert schrieb:
Thank you for your answer!
This comes close to solving the problem but in the last line of the
above I want to be able to say:
either
print $ broadcast id [1..10]
or
print $ broadcast [ (x +) | x ← [1..10] ] [1..10]
both need to be possible*.
So is there
I have been trying to figure out the distinction between value, function and
computation. You raised a few points that I am not sure about.
In Computation considered harmful. Value not so hot either. you said:
I still don't like it; a lambda expression is not a computation, it's a
formal
* Daryoush Mehrtash dmehrt...@gmail.com [2009-02-13 11:31:06-0800]
Isn't the lambda expression a representation of something (potentially with
recursion) that yields a value and not the value itself?
The same terms may refer to different notions.
If you think of values as mathematical
On Fri, 2009-02-13 at 12:15 -0700, John A. De Goes wrote:
On Feb 13, 2009, at 12:07 PM, Jonathan Cast wrote:
Exactly! But if it fails, why on earth should any other use of map in
the module succeed?
Because more information is known about other usages of map. Such is
the nature of type
In your own subjective opinion, which is not shared by many other
Haskellers, myself included.
Regards,
John A. De Goes
N-BRAIN, Inc.
The Evolution of Collaboration
http://www.n-brain.net|877-376-2724 x 101
On Feb 13, 2009, at 1:08 PM, Jonathan Cast wrote:
On Fri, 2009-02-13 at
Am Freitag, 13. Februar 2009 20:06 schrieb Jonathan Cast:
On Fri, 2009-02-13 at 20:06 +0100, Daniel Fischer wrote:
Am Freitag, 13. Februar 2009 19:49 schrieb Jonathan Cast:
It breaks type inference. I explained this at the time. I can explain
it again:
import Data.List
On Fri, Feb 13, 2009 at 1:29 PM, John A. De Goes j...@n-brain.net wrote:
On Feb 13, 2009, at 11:23 AM, Jonathan Cast wrote:
Usually `when no ambiguity can arise', no? Plenty of mathematical
practice rests on imprecision and the expectation that the human reader
will understand what you mean.
On Feb 13, 2009, at 1:38 PM, Daniel Fischer wrote:
? Well, still easy, we must unify with (a - b) - c - [d], only one
possibility, fine. Or is it? What if we have another 'take' in scope?
Say take :: Int - Set a - Set a ? Oops.
So, where draw the line?
You draw the line exactly when you cannot
On Fri, 2009-02-13 at 15:38 +, Neil Mitchell wrote:
What have I done wrong? Did createProcess close the handle, and is
there a way round this?
The docs for runProcess says:
Any Handles passed to runProcess are placed immediately in the
closed state.
but the equivalent
Am Freitag, 13. Februar 2009 21:08 schrieb Jonathan Cast:
On Fri, 2009-02-13 at 12:15 -0700, John A. De Goes wrote:
On Feb 13, 2009, at 12:07 PM, Jonathan Cast wrote:
Exactly! But if it fails, why on earth should any other use of map in
the module succeed?
Because more information is
On Fri, 2009-02-13 at 21:57 +0100, Daniel Fischer wrote:
Am Freitag, 13. Februar 2009 21:08 schrieb Jonathan Cast:
On Fri, 2009-02-13 at 12:15 -0700, John A. De Goes wrote:
On Feb 13, 2009, at 12:07 PM, Jonathan Cast wrote:
Exactly! But if it fails, why on earth should any other use of
On 2009-02-03, Maurício briqueabra...@yahoo.com wrote:
Are there plans to include C99 'complex' type
in Foreign, maybe as CFloatComplex, CDoubleComplex
A separate library for new types to add to Foreign would be the easiest
way forward. Just put the foreign-c99 package on Hackage?
(...) I
On Feb 13, 2009, at 2:11 PM, Jonathan Cast wrote:
The compiler should fail when you tell it two mutually contradictory
things, and only when you tell it two mutually contradictory things.
By definition, it's not a contradiction when the symbol is
unambiguously typeable. Do you think math
Hi Daryoush,
2009/2/13 Daryoush Mehrtash dmehrt...@gmail.com
I have been trying to figure out the distinction between value, function
and computation. You raised a few points that I am not sure about.
In Computation considered harmful. Value not so hot either. you
said:
I still
On Fri, 2009-02-13 at 12:19 +, Duncan Coutts wrote:
Can we do that just for one user agent? I don't think we want to use
non-standard stuff in general. Apparently Content-Disposition is not in
the official HTTP spec, but IE is known to follow it.
It's not in the HTTP spec, but it's about
I also recommend reading
http://www.haskell.org/haskellwiki/IO_Semantics (mostly because I wrote
it). Feel free to improve upon it.
--
Russell O'Connor http://r6.ca/
``All talk about `theft,''' the general counsel of the American Graphophone
Company wrote,
There are good reasons against allowing infinite types by default
(mostly, that a lot of things type check that are normally not what we
want). An old haskell cafe conversation on the topic is here:
http://www.nabble.com/There%27s-nothing-wrong-with-infinite-types!-td7713737.html
However, I think
- Original Message
From: Don Stewart d...@galois.com
To: gregg reynolds d...@mobileink.com
Cc: haskell-cafe@haskell.org
Sent: Saturday, February 7, 2009 2:40:41 PM
Subject: Re: [Haskell-cafe] Semantic web
dev:
Anybody implementing rdf or owl stuff in haskell? Seems like a
On Fri, Feb 13, 2009 at 3:13 PM, Job Vranish jvran...@gmail.com wrote:
There are good reasons against allowing infinite types by default
(mostly, that a lot of things type check that are normally not what we
want). An old haskell cafe conversation on the topic is here:
On Fri, Feb 13, 2009 at 4:04 PM, Luke Palmer lrpal...@gmail.com wrote:
On Fri, Feb 13, 2009 at 3:13 PM, Job Vranish jvran...@gmail.com wrote:
There are good reasons against allowing infinite types by default
(mostly, that a lot of things type check that are normally not what we
want). An old
Are there plans to include C99 'complex' type
in Foreign, maybe as CFloatComplex, CDoubleComplex
A separate library for new types to add to Foreign would be the easiest
way forward. Just put the foreign-c99 package on Hackage?
(...) I could actually have some
arbitrary sized parameter as
On 2009 Feb 12, at 11:55, Cristiano Paris wrote:
import Control.Monad.Trans -- why do I have to import this?
liftIO is defined there, I believe. Many of the monad modules re-
export it with their MonadTrans definitions, but apparently
Control.Monad.CC doesn't so you need to go to the
On Fri, Feb 13, 2009 at 22:37, John A. De Goes j...@n-brain.net wrote:
On Feb 13, 2009, at 2:11 PM, Jonathan Cast wrote:
The compiler should fail when you tell it two mutually contradictory
things, and only when you tell it two mutually contradictory things.
By definition, it's not a
-- John A. De Goes wrote:
Adding information cannot remove a contradiction from the information
set available to the compiler.
But it can and often does, for example, for [] or 4. What's the type of
either expression without more information?
[] :: [a]
4 :: Num a = a
Do I win something?
John A. De Goes j...@n-brain.net writes:
I'm referring to a rather conservative proposal wherein if there is
one and exactly one definition that allows an expression to type, then
name overloading in the same scope is permitted.
Perhaps this was discussed in the context of records and field
89 matches
Mail list logo