On Sun, 2007-08-12 at 23:09 +0100, Jon Harrop wrote:
> Suffix trees are a data structure used to search for a substring of length
> "m"
> in a string of length "n" in O(m) time. Suffix trees can also be used for
> efficient approximate searches. This data structure is of particular
> importance
G'day all.
Quoting Jon Harrop <[EMAIL PROTECTED]>:
> Does anyone have any Haskell code implementing suffix trees? I'm particularly
> interested in high-performance construction.
No, but I have this:
http://citeseer.ist.psu.edu/giegerich95comparison.html
First person to implement them gets
On 11/08/07, Ronald Guida <[EMAIL PROTECTED]> wrote:
>
>
> Here's my interpretation of the table:
>
> --
> Structure | Subject | Action| Verb | Result
> +--+++--
>
Malte Milatz wrote:
Sam Hughes <[EMAIL PROTECTED]>, Sun, 12 Aug 2007 20:12:55 -0400:
[A parser like Parsec, with monad transformers:]
$ darcs get http://samuelhughes.com/darcs/partran/
Is this related in any way to the following GSoC project?
http://code.google.com/soc/2007/haskell/appinfo.ht
Isaac Dupree schrieb:
apfelmus wrote:
Mutable data structures in the sense of ephemeral (= not persistent =
update in-place) data structure indeed do introduce the need to work
in ST since the old version is - by definition - not available anymore.
Not in the quantum/information-theoretic se
Ronald Guida wrote:
>
> Given the question "What is a Monad", I would have to say "A Monad is
> a device for sequencing side-effects."
>
There are side-effects and there are side-effects. If the only
monad you use is Maybe, the only side-effect you get is a slight
warming of the CPU.
Dave Men
Hi All:
I am reading http://www.haskell.org/haskellwiki/Prime_numbers
The code in sector "1 Bitwise prime sieve".
I have 3 questions about it.
1) In function go, what does the number 46340 mean ? Is it sqrt(MAX_LONG) ?
2) We have this type definition :
pureSieve :: Int -> Int
Why there i
Benjamin Franksen wrote:
As has been already mentioned in this thread, in
http://www.soi.city.ac.uk/~ross/papers/Applicative.html Conor McBride and
Ross Paterson invent/explain a new type class that is now part of the base
package (Control.Applicative). They also use/propose syntactic sugar for
i
On Aug 11, 2007, at 12:35 PM, Brian Hurt wrote:
You guys might also want to take a look at the Cilk programming
language, and how it managed threads. If you know C, learning Cilk
is about 2 hours of work, as it's C with half a dozen extra
keywords and a few new concepts. I'd love to se
On Tuesday 14 August 2007 00:22, L.Guo wrote:
> 2) We have this type definition :
> pureSieve :: Int -> Int
>Why there is no error (type mismatch) of this call in func main :
> pureSieve 1000
The Haskell Report says that an Int covers at least the range [- 2^29, 2^29 -
1], which
On Mon, Aug 13, 2007 at 04:35:12PM +0200, apfelmus wrote:
> My assumption is that we have an equivalence
>
> forall a,b . m (a -> m b) ~ (a -> m b)
>
> because any side effect executed by the extra m on the outside can well be
> delayed until we are supplied a value a. Well, at least when all ar
Because 10,000,000 is too large for a Int, it is always in type of Integer or
some higher level data type.
--
L.Guo
2007-08-13
-
From: Alexis Hazell
At: 2007-08-13 22:46:46
Subject: Re: [Ha
On 8/13/07, L.Guo <[EMAIL PROTECTED]> wrote:
> Hi All:
Hello,
>
> I am reading http://www.haskell.org/haskellwiki/Prime_numbers
>
> The code in sector "1 Bitwise prime sieve".
>
> I have 3 questions about it.
>
> 1) In function go, what does the number 46340 mean ? Is it sqrt(MAX_LONG) ?
Yes, it
On Mon, Aug 13, 2007 at 11:23:59PM +0800, L.Guo wrote:
> Because 10,000,000 is too large for a Int, it is always in type of Integer or
> some higher level data type.
In Haskell, Int always supports at least -536,870,912 to 536,870,911.
Also, large numbers don't (this is arguably a bug...) have r
Stefan O'Rear schrieb:
On Mon, Aug 13, 2007 at 04:35:12PM +0200, apfelmus wrote:
My assumption is that we have an equivalence
forall a,b . m (a -> m b) ~ (a -> m b)
because any side effect executed by the extra m on the outside can well be
delayed until we are supplied a value a. Well, at l
L.Guo wrote:
> Because 10,000,000 is too large for a Int
On my pitiful system,
> maxBound::Int
2147483647
is certainly greater than
1000
.
> it is always in type of Integer or some higher level data type.
Haskell doesn't do static checking like that. In GHC on my system (where
10,000,000,000
On Mon, Aug 13, 2007 at 05:39:34PM +0200, apfelmus wrote:
> Stefan O'Rear schrieb:
>> On Mon, Aug 13, 2007 at 04:35:12PM +0200, apfelmus wrote:
>>> My assumption is that we have an equivalence
>>>
>>> forall a,b . m (a -> m b) ~ (a -> m b)
>>>
>>> because any side effect executed by the extra m o
David Roundy wrote:
The only cost is that
this syntax relies on the do notation, and thus makes the desugaring of
that do notation slightly more complicated when used.
If I understand correctly,
do
blah
f (do
foo
bar (<- action)
)
blah
has an ambiguity: which
The SYB papers provide really powerful functions for accessing and
manipulating a values in arbitrary shaped containers.
The cost of this capability appears to be loss of type checking. For
example gfindtype x returns a maybe y.
Given that the type checker actually has to know whether or not
On Mon, Aug 13, 2007 at 01:27:45PM -0300, Isaac Dupree wrote:
> David Roundy wrote:
> >The only cost is that
> >this syntax relies on the do notation, and thus makes the desugaring of
> >that do notation slightly more complicated when used.
>
> If I understand correctly,
>
> do
> blah
> f (d
When I read "side-effects", I understand it as "unwanted effects", like
"aliasing", and "effects depending on the order of execution". I'm not sure
if my understanding here is correct. I hope Haskell does not allow
"side-effects" but only "effects", meaning the monads do not allow you to
write the
Does GHC do dead code elimination?
I observe that if you take a module and edit it so that some function is
now no longer exported or called by any exported function, the size of
the *.o file seems to go down. This suggests that dead code within a
single module is eliminated.
However... how
On 8/11/07, Per Vognsen <[EMAIL PROTECTED]> wrote:
>
> Applicative functors can indeed help:
>
> (,,,) <$> [1,2,3] <*> [-1,0,1] <*> [1,1,1] <*> [0,2,6]
>
> You just use n-1 commas when you want the effect of zipn.
Actually, that's not quite right, since that uses the applicative functor
relat
On Mon, Aug 13, 2007 at 07:05:03PM +0100, Andrew Coppin wrote:
> Does GHC do dead code elimination?
Yes - all unused let-binders are removed.
> I observe that if you take a module and edit it so that some function is
> now no longer exported or called by any exported function, the size of the
>
Stefan O'Rear wrote:
On Mon, Aug 13, 2007 at 07:05:03PM +0100, Andrew Coppin wrote:
Does GHC do dead code elimination?
Yes - all unused let-binders are removed.
Not related to optimisation, but... is there some switch to warn you if
something gets removed? (Presumably this means
On Mon, Aug 13, 2007 at 07:35:31PM +0100, Andrew Coppin wrote:
> Not related to optimisation, but... is there some switch to warn you if
> something gets removed? (Presumably this means you forgot to export
> something, or you haven't coded the bit that calls it yet or something.)
-fwarn-unused-
Stefan O'Rear wrote:
On Mon, Aug 13, 2007 at 07:35:31PM +0100, Andrew Coppin wrote:
(I once compiled a program that used the GHC API. The final binary was
several times larger than ghc.exe...)
GHC is a particularly bad case because what it does is determined by the
settings of a bunch
Hi!
I am thinking about a model where you would have only n threads on a
n-core (or processor) machine. They would be your worker threads and
you would spawn them only once (at the beginning of the program) and
then just delegate work between them.
On 8/13/07, Jan-Willem Maessen <[EMAIL PROTECTED
Stefan O'Rear wrote:
Also, large numbers don't (this is arguably a bug...) have restricted
types:
[EMAIL PROTECTED]:~$ ghc -e '100 :: Int'
-1486618624
So many other programming languages allow weird things to happen with
numeric overflows... it would be nice if Haskell didn
Hello Everyone,
I'm not quite sure if I'm posing this question correctly, but what facilities
currently exist in haskell to nicely deal with datastructures that won't fit
within a given machine's ram?
And if there are no such facilities, what would it take to fix that?
thanks
-Carter
___
On Mon, Aug 13, 2007 at 12:29:25PM -0700, Carter T Schonwald wrote:
> Hello Everyone,
> I'm not quite sure if I'm posing this question correctly, but what
> facilities currently exist in haskell to nicely deal with
> datastructures that won't fit within a given machine's ram? And if
> there are n
Carter T Schonwald wrote:
Hello Everyone,
I'm not quite sure if I'm posing this question correctly, but what
facilities currently exist in haskell to nicely deal with
datastructures that won't fit within a given machine's ram?
And if there are no such facilities, what would it take to fix that
On Aug 13, 2007, at 2:53 PM, Mitar wrote:
Hi!
I am thinking about a model where you would have only n threads on a
n-core (or processor) machine. They would be your worker threads and
you would spawn them only once (at the beginning of the program) and
then just delegate work between them.
On
The main two use cases I have in mind are
1) really really really big abstract syntax trees or proof trees (a la
compilers or theorem provers)
2) random access to numerical data
does that help clarify what i'm asking about? In each case, is there a standard
way of dealing with this?
in the cas
Brian Brunswick wrote:
> One thing that I keep seeing people say (not you), is that
monads /sequence/
> side effects. This is wrong, or at
> least a limited picture.
>
> /All/ of the above structures are about combining compatible things things
> together in a row.
> /None/ of them force any parti
On Aug 13, 2007, at 16:29 , Benjamin Franksen wrote:
Let's take the simplest example: Maybe. The effect in question is the
premature abortion of a computation (when Nothing is returned). And of
course Maybe sequences these effects, that's what you use it for: the
_first_ action to be encountere
Andrea Rossato wrote:
> The task this library should do is simple: given an xml object
> (representing a bibliographic reference), render it with rules stored
> in a different xml object (the citation style). While I think I can
> find solutions for this problem - the rendering -, what I find
> dif
Brian Hulley wrote:
apfelmus wrote:
Brian Hulley schrieb:
main = do
buffer <- createBuffer
edit1 <- createEdit buffer
edit2 <- createEdit buffer
splitter <- createSplitter (wrapWidget edit1) (wrapWidget
edit2)
runMessageLoopWith splitt
In the second case, if your numerical data is just a big array, why not
just mmap it? Unless you're running on a 32 bit machine, or have a
*seriously* large amount of data, that seems like the easiest option.
Although if you're talking about mutable data, that's a whole 'nother can
of worms... but
Andrew Coppin wrote:
Stefan O'Rear wrote:
Also, large numbers don't (this is arguably a bug...) have restricted
types:
[EMAIL PROTECTED]:~$ ghc -e '100 :: Int'
-1486618624
So many other programming languages allow weird things to happen with
numeric overflows... it would b
On Mon, Aug 13, 2007 at 05:13:01PM -0400, Brandon S. Allbery KF8NH wrote:
> On Aug 13, 2007, at 16:29 , Benjamin Franksen wrote:
> >Let's take the simplest example: Maybe. The effect in question is the
> >premature abortion of a computation (when Nothing is returned). And of
> >course Maybe sequenc
Brian Hulley wrote:
Thinking about this a bit more, and just so this thought is recorded for
posterity (!) and for the benefit of anyone now or in a few hundred
years time, trying to solve "Fermat's last GUI", the object oriented
solution allows the buffer object to do anything it wants, so tha
Brian Hulley wrote:
> Brian Hulley wrote:
>> apfelmus wrote:
>>> Brian Hulley schrieb:
main = do
buffer <- createBuffer
edit1 <- createEdit buffer
edit2 <- createEdit buffer
splitter <- createSplitter (wrapWidget edit1) (wrapWi
Brandon S. Allbery KF8NH wrote:
> On Aug 13, 2007, at 16:29 , Benjamin Franksen wrote:
>> Let's take the simplest example: Maybe. The effect in question is the
>> premature abortion of a computation (when Nothing is returned). And of
>> course Maybe sequences these effects, that's what you use it f
David Roundy wrote:
It's the *effect* of a monad, not the *side* effect. The type of >>=
defines this dependency. And when you have a chain of dependencies, that
is sometimes referred to as a sequence. True, it's not mystical, but it's
still sequenced.
How can a Haskell type define a data de
On 13/08/07, David Roundy <[EMAIL PROTECTED]> wrote:
>
> Try executing:
>
> do { x <- return 2; undefined; return (x*x); }
>
> in any monad you like, and you'll find that regardless of the *data*
> dependencies (the return value of this monadic action is unambiguous), the
> undefined is evaluated
On Mon, 2007-08-13 at 22:29 +0200, Benjamin Franksen wrote:
> Brian Brunswick wrote:
> > One thing that I keep seeing people say (not you), is that
> monads /sequence/
> > side effects. This is wrong, or at
> > least a limited picture.
> >
> > /All/ of the above structures are about combining comp
On 13/08/07, Pekka Karjalainen <[EMAIL PROTECTED]> wrote:
> On 8/13/07, L.Guo <[EMAIL PROTECTED]> wrote:
> > Hi All:
>
> Hello,
>
> >
> > I am reading http://www.haskell.org/haskellwiki/Prime_numbers
> >
> > The code in sector "1 Bitwise prime sieve".
> >
> > I have 3 questions about it.
> >
> > 1)
On Mon, 2007-08-13 at 19:31 +0200, peterv wrote:
> When I read "side-effects", I understand it as "unwanted effects", like
> "aliasing", and "effects depending on the order of execution". I'm not sure
> if my understanding here is correct. I hope Haskell does not allow
> "side-effects" but only "ef
Benjamin Franksen wrote:
I'd be careful. Introducing a network connection into the equation makes the
object (its methods) susceptible to a whole new bunch of failure modes;
think indefinite delays, connection loss, network buffer overflow, etc etc.
It may be a mistake to abstract all that away;
On 8/13/07, David Roundy <[EMAIL PROTECTED]> wrote:
> Try executing:
>
> do { x <- return 2; undefined; return (x*x); }
>
> in any monad you like
instance Monad M where
return a = M a
~(M a) >>= f = f a
Or is that cheating?
--
Dan
___
Haskell-
On Tue, 14 Aug 2007, Benjamin Franksen wrote:
...
> I'd be careful. Introducing a network connection into the equation makes the
> object (its methods) susceptible to a whole new bunch of failure modes;
> think indefinite delays, connection loss, network buffer overflow, etc etc.
> It may be a mist
On 8/13/07, David Roundy <[EMAIL PROTECTED]> wrote:
| Try executing:
|
| do { x <- return 2; undefined; return (x*x); }
|
| in any monad you like
It's not just the identity monad:
Prelude> :m +Control.Monad.State
Prelude Control.Monad.State> flip evalState () $ do { x <- return 2;
undefined;
Derek Elkins wrote:
> On Mon, 2007-08-13 at 22:29 +0200, Benjamin Franksen wrote:
>> Brian Brunswick wrote:
>> > One thing that I keep seeing people say (not you), is that
>> monads /sequence/
>> > side effects. This is wrong, or at
>> > least a limited picture.
>> >
>> > /All/ of the above struct
I made this mistake myself at first too. It seems that the Monad = "side
effect machine" error is common to Haskell newbies. Probably to do with the
fact that the first thing every programmer wants to do is write a hello world
program and for that you need the IO Monad which requires some expl
On 8/13/07, Benjamin Franksen <[EMAIL PROTECTED]> wrote:
> Ok, I admit defeat now ;-) Monads in general /allow/ sequencing of (certain)
> effects, but it is not necessary for a monad to do so.
I'm sure I said that 300 or so posts ago :-)
Here's an example that might help make some of this explic
Isaac Dupree wrote:
> Benjamin Franksen wrote:
>> I'd be careful. Introducing a network connection into the equation makes
the
>> object (its methods) susceptible to a whole new bunch of failure modes;
>> think indefinite delays, connection loss, network buffer overflow, etc
etc.
>> It may be a mis
G'day all.
Quoting Andrew Coppin <[EMAIL PROTECTED]>:
So many other programming languages allow weird things to happen with
numeric overflows... it would be nice if Haskell didn't.
It would nice if CPUs supported trapping integer arithmetic.
Cheers,
Andrew Bromage
___
I put together a small intro lesson on proving haskell code using
quickcheck, equational reasoning and Isabelle/HOL. Its very elementary,
but might be of interest to some people here.
http://www.thenewsh.com/%7Enewsham/formal/reverse/
Feedback is appreciated.
Tim Newsham
http://www.thenewsh
Ronald Guida wrote:
> Given the question "What is a Monad", I would have to say "A Monad is
> a device for sequencing side-effects."
peterv <[EMAIL PROTECTED]> wrote:
> "Side-effects" is a piece of linguistic cruft played fast-and-loose
> by too many people in this game. "Sequencing" suffers the
60 matches
Mail list logo