On Sun, 2008-05-04 at 23:59 -0500, Derek Elkins wrote:
Unfortunately, Daan seems to have disappeared off of the face of the
internet so there isn't anything that can be done about fixing that
documentation (and likely that is in large part why this error is
still
there.)
Factor has a file system notification API that wraps windows, linux
and mac ones. It might be worth taking a look at that to see what it
does.
Mono also has such an API and I've heard very good things about it. It
would also be worth looking at.
___
The libgd bindings can be used to create PNG images. See
http://hackage.haskell.org/cgi-bin/hackage-scripts/package/gd
/Björn
On Mon, May 5, 2008 at 9:05 AM, Bit Connor [EMAIL PROTECTED] wrote:
It would be nice to have haskell bindings to the libpng C library. I
had trouble calling libpng
I've found myself writing code like this several times now. Is there a
better way?
read_args h = do
line - hGetLine h
case line of
. - return []
('#':y) - do
ys - read_args h
return (y:ys)
___
Haskell-Cafe mailing list
Hi
I've found myself writing code like this several times now. Is there a
better way?
hGetContents might be a different way to write a similar thing:
read_args h = do
src - hGetContents h
let (has,rest) = span (# `isPrefixOf`) $ lines src
return (map tail has)
Of course,
Ross Boylan wrote:
First, I'm really impressed with the fast and helpful responses from
several people!
Ask an easy question and you'll get at least a dozen people tripping
over each other in their rush to offer you useful advice. Ask a hard
question, or an uninteresting question, and
Neil Mitchell wrote:
Hi
I've found myself writing code like this several times now. Is there a
better way?
hGetContents might be a different way to write a similar thing:
read_args h = do
src - hGetContents h
let (has,rest) = span (# `isPrefixOf`) $ lines src
return
On Thu, May 1, 2008 at 8:28 AM, Adam Smyczek [EMAIL PROTECTED] wrote:
This package is part of a development tool designed to monitor code changes,
analyze dependencies etc. Actually, we are still in process to develop the
tool
and this binding is the first functional ready package others
Hi Andrew,
I don't know whether it's intentional, but the patterns for case line of
are not exaustive. Are you sure you do not expect anything else apart from a
single . or a line starting with '#'?
More below:
On Mon, May 5, 2008 at 1:45 PM, Andrew Coppin [EMAIL PROTECTED]
wrote:
Neil
Don Stewart wrote:
Yeah, if you're on Debian it would make sense to install GHC -- its much
more active, much faster, and supports more things. [than Hugs]
Except for compile and load time, Hugs is really fast there.
Regards,
apfelmus
___
Abhay Parvate wrote:
Hi Andrew,
I don't know whether it's intentional, but the patterns for case line
of are not exaustive. Are you sure you do not expect anything else
apart from a single . or a line starting with '#'?
It's reading a wire protocol, so if you hit anything else there's been
apfelmus wrote:
Don Stewart wrote:
Yeah, if you're on Debian it would make sense to install GHC -- its much
more active, much faster, and supports more things. [than Hugs]
Except for compile and load time, Hugs is really fast there.
Mmm, possibly. I seem to recall it being instantaneous on
guard True = return ()
guard False = []
-- the textbook example
f = do
x - [1..4]
y - [2..8]
guard (x*y==8)
return (x,y)
-- the translation.
f' = [1..4] = (\x -
[2..8] = (\y -
(if (x*y == 8) then return () else [])
return (x,y)))
-- another one. note that we can
Andrew Coppin [EMAIL PROTECTED] wrote:
Do I get an exception or just the end of the
string?) I might possibly be able to just use hGetContents and run a
parser lazily over the result, we'll see.
You get an exception. I used this scheme for a toy http server using
lazy Bytestrings, and it
New to Haskell, with a mental block about how to represent this
situation efficiently:
I have an unknown function f which is defined on subsets of some
universal set (say integers 1...N). I know the values of f for some
subsets, and using those can infer values on other subsets.
So what
On Sun, 2008-05-04 at 23:57 -0700, Ross Boylan wrote:
On Sun, 2008-05-04 at 23:59 -0500, Derek Elkins wrote:
Unfortunately, Daan seems to have disappeared off of the face of the
internet so there isn't anything that can be done about fixing that
documentation (and likely that is in large
Patrick Surry [EMAIL PROTECTED] wrote:
New to Haskell, with a mental block about how to represent this
situation efficiently:
I have an unknown function f which is defined on subsets of some
universal set (say integers 1...N). I know the values of f for some
subsets, and using those
I have a problem with Cabal: it doesn't seem to pick up the Main-is:
option from the configuration file.
Here's my scc.cabal file. Note the Main-is: line:
Name:scc
Version: 0.1
Cabal-Version: = 1.2
Build-Type: Simple
License: GPL
Hi Mads,
I was wondering if anybody had experimented with using Template
Haskell
(TH) and ordinary SQL to make type-safe database access?
I know HaskellDB, for example, does something quite similar. There's a
preprocessor that generates a Haskell file with a Haskell
representation of
On 1 May 2008, at 16:58, Michael Karcher wrote:
Wouter Swierstra [EMAIL PROTECTED] wrote:
Hi Creighton,
Where could I find a proof that the initial algebras final
coalgebras of CPO coincide? I saw this referenced in the
Bananas.. paper as a fact, but am not sure where this comes from.
I
Hi
isZero :: Int - Bool
isZero 0 = True
isZero n | n /= 0 = False
The order in which the above equations appear makes no difference to
the application of isZero. Does the Haskell interpreter rewrite
patterns into one single definition using some sort of switch or if
construct? Why does an
PR Stanley wrote:
To put it another way, why doesn't the interpreter identify the more
specific cases and put them before the general ones.
I'm guessing because determining which equation is the most general is
equivilent to the Halting Problem in the general case. (Notice that
Mathematica
PR Stanley [EMAIL PROTECTED] wrote:
after the more specific cases?To put it another way, why doesn't the
interpreter identify the more specific cases and put them before the
general ones.
Given the function foo below, which of the first lines is more specific?
No reordering means, that it is
Achim Schneider [EMAIL PROTECTED] wrote:
isZero n = case n of
0 - True
n - if n /= 0
then False
else undefined
You can't exchange the order, here, of course, the semantics of this
and a guard-version would differ.
--
(c) this sig last receiving
Hi,
I declared a multi param type class as below:
*class MyString m c where
zIndex :: m - Int - c
zLength :: m - Int
zPack :: [c] - m
zEquals :: c -c - Bool
zWrap :: [c] - (m,AnExistingDataType)*
In the end I did not needed it for my program, but for those few
Hello Sai,
Monday, May 5, 2008, 7:52:29 PM, you wrote:
class MyString m c where
it should be
class MyString m c | m-c where
so ghc will realize that same m means the same c. read about
functional dependencies in ghc user manual
--
Best regards,
Bulat
Hello,
I wrote a program in haskell that works with lattice finite automata
(the generalization of notion of finite state automata). Let me post
the source code as it is not that long...
The problem is that my algorithm that computes the run (see function
fun) of an automaton on the given word
Peter Hercek wrote:
Achim Schneider wrote:
Haskell wins the wickedness of design contest by using [()] and [] as
truth values.
Maybe you wanted to say: ... by using [()] as True value and [] as
False value ... which does not seem that wicked (at least to me).
Oops sorry, missed you say
Hi Mario,
Is the name of the module within the Shell.hs file Main? If not, that
could be your problem.
--trevor
On Mon, 05 May 2008 09:57:15 -0400
Mario Blazevic [EMAIL PROTECTED] wrote:
I have a problem with Cabal: it doesn't seem to pick up the
Main-is: option from the configuration
Achim Schneider wrote:
Peter Hercek [EMAIL PROTECTED] wrote:
Haskell wins the wickedness of design contest by using [()] and []
as truth values.
Maybe you wanted to say: ... by using [()] as True value and [] as
False value ... which does not seem that wicked (at least to me).
Strangely
Achim Schneider wrote:
-- That's the one I've been looking for. Remember that
-- return e = [e]
f = concatMap
(\x - concatMap
(\y - concatMap
(\_ - [(x,y)])
(if x*y == 8 then [()] else []))
[2..8])
[1..4]
Morale:
Trevor Elliott wrote:
Hi Mario,
Is the name of the module within the Shell.hs file Main? If not, that
could be your problem.
You may be right, the module's name is Shell, not Main. GHC does not
have problem with that when --main-is Shell option is specified on the
command line. Is
On 5/5/08, Brandon S. Allbery KF8NH [EMAIL PROTECTED] wrote:
The functional dependency MyString m c | m - c tells GHC that any
specific m determines a specific c. It doesn't matter what the type is
here, since it's not used in the definition of compareStr; but it must be
possible to know that
On 5/4/08, Iavor Diatchki [EMAIL PROTECTED] wrote:
From the monad law we can conclude only that (= return) is strict,
not (=) in general.
For example, (=) for the reader monad is not strict in its first argument:
m = f = \r - f (m r) r
So, (undefined return 2) = (return 2)
That's not even
Hi Paul!
I'm not sure about the context of Hutton, but maybe unapplying
functions refers to the principle of extensionality.
Leibnitz' rule of the indiscernibility of identicals [1] says that if
two functions are equal, then the respective results of applying each to
*any* value of their
Hi,
Wouter Swierstra wrote:
Hi Mads,
I was wondering if anybody had experimented with using Template
Haskell
(TH) and ordinary SQL to make type-safe database access?
I know HaskellDB, for example, does something quite similar. There's a
preprocessor that generates a Haskell file
This is only a guess, but an educated guess: there is no silver bullet
for memoization in Haskell. There are, however, some somewhat more
general approaches you may be interested in. I think this hasn't been
researched extremely throughly yet, but see
Gwern Branwen wrote:
(If yes, any suggestions for a package name? 'darcs' is out, but
'darcs-cb' and 'darcs-cabalized' strike me as horribly clunky or obscure.)
barcs :-)
Cheers
Ben
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
andrewcoppin:
Ross Boylan wrote:
First, I'm really impressed with the fast and helpful responses from
several people!
Ask an easy question and you'll get at least a dozen people tripping
over each other in their rush to offer you useful advice. Ask a hard
question, or an
On Mon, 2008-05-05 at 13:37 -0400, Mario Blazevic wrote:
Trevor Elliott wrote:
Hi Mario,
Is the name of the module within the Shell.hs file Main? If not, that
could be your problem.
You may be right, the module's name is Shell, not Main. GHC does not
have problem with that
I actually suspect that your supremum and infimum functions are the
problem here -- they look like they might be accumulating thunks and blowing
your stack. But beyond this, they're also o(n) for what could be effectively
an o(log n) operation at the least, if you used ordered sets.
I'd start
41 matches
Mail list logo