Claus Reinke said:
> initQ n = foldr (.) id $ take n $ repeat (Nothing:)
> pushQ front q = tail . q . (front:)
Why doesn't repeated pushing give a space leak? As far as I can see, tail
never gets a "complete" list on which it can act, so repeated pushing will
construct a function with more
Claus Reinke said:
[...]
> something like this?
>
> initQ n = foldr (.) id $ take n $ repeat (Nothing:)
> pushQ front q = tail . q . (front:)
> peekQ q = (head $ q [], q)
Yes, thanks. At least, it looks easy to get what I want from that.
Sigh. It seems so obvious now. When will th
Claus Reinke said:
> You can't really pop from a fixed-length queue. Apart from that,
something like this?
Just to clarify, I want something with a *single* operation that takes one
value, adding it to the front of the queue, and returns a tuple containing
the value that was at the end of the qu
Hi,
I'm trying to write a simple fifo queue of fixed length (containing type
Maybe a - it would be initialised to Nothings) where pushing an item pops
the "last" item "off the end".
data Queue a = QUEUE (Maybe a -> (Queue a, Maybe a))
queue :: Maybe a -> Queue a
queue n1 = QUEUE (\n2 -> (queue
Malcolm W - thanks for your comments. I did reply (nothing important),
but your university has my address blacklisted (dynamic ip). Sorry for
the on-list noise. Andrew
andrew cooke said:
[...]
> Halipeto generates web pages from templates (much like JSP, Zope TAL etc).
> It's
Hi,
Halipeto generates web pages from templates (much like JSP, Zope TAL etc).
It's written in Haskell (with a ghc extension) and is available from
http://www.acooke.org/jara/halipeto
An example site generated using Halipeto, containing some Pancito images,
is at http://www.acooke.org/pancito -
Hi,
There's a new version (2.2) of Pancito (a functional images toolkit)
available at http://www.acooke.org/jara/pancito - it extends 2.1 with
useful output options (a progress meter and the possibility to preview a
small area of an image) and better structured code (points are now a
typeclass, a
wouldn't it be nicer to have
- mainwrapper and call combined
- helper fucntions defined for execp "cat" etc
i haven't downloaded your package, but the syntax as it is looks very
verbose. i know it's a small point, but shells have to support a compact
syntax (or is the idea only to support "shell
HaXml doesn't explicitly handle namespaces, but they appear in the
attribute name. I've used HaXml on Windows (actually, a subset of the
modules) to implement a simple template engine that relies on an XML
namespace to call functions in Haskell.
So, for example
is converted into
output from so
Ah. I just need to drop the context from the data type declaration.
Sorry,
Andrew
andrew cooke said:
>
> Hi,
>
> I'm trying to use type classes and suspect I've got confused somewhere
> down the line, because I've got to an error message that I don't
> und
Hi,
I'm trying to use type classes and suspect I've got confused somewhere
down the line, because I've got to an error message that I don't
understand and can't remove.
I have a class that works like a hash table, mapping from String to some
type. I have two instances, one that is case insensit
Thanks. I should have added that I will only use the array for reading
once it's created. I don't mind whether creating is lazy or eager (it's
currently eager because I was fighting a space leak, but I think that was
down to some other error).
I don't fully understand how either of the suggesti
Hi,
I have some code (http://www.acooke.org/andrew/ReadTest.hs) that reads
data from a file (an image in ppm format; example data (256*256 pixels) at
http://www.acooke.org/andrew/test.ppm) and stores it in an array of Word8
values. The aim is to read a file that contains 5000 * 5000 * 3 Word8
va
hope that's OK, because maybe
someone will find this info via Google one day and find it useful.
Cheers,
Andrew
Malcolm Wallace said:
> "andrew cooke" <[EMAIL PROTECTED]> writes:
>
>> - HaXml looks like it might do what I want, but
>> (1) seems tricky to inst
It appears that the Haskell XML Toolbox may be what I want -
http://www.fh-wedel.de/~si/HXmlToolbox/ - but any other suggestions would
be appreciated. Apologoies for relying on Haskell.org rather than
Googling (I'll mail the web page maintainers).
Cheers,
Andrew
andrew cooke said:
>
&g
What are the options for parsing/lexing (X)HTML? As far as I can see...
- the HTML library in GHC (or from Andy Gill) is for creating documents,
not parsing them
- HaXml looks like it might do what I want, but (1) seems tricky to
install (needs "make", which isn't that cool for Windows); (2) h
Tomasz Zielonka said:
> On Thu, Nov 27, 2003 at 04:09:00PM -0300, andrew cooke wrote:
[...]
>> If I compile and run the code below, the file "foo" contains 10 lines
>> of output (as I would expect), but the file "bar" contains just 9 -
>> the final line
Hi,
If I compile and run the code below, the file "foo" contains 10 lines
of output (as I would expect), but the file "bar" contains just 9 -
the final line is missing. If I add a "join", as in the comment, then
all 10 lines appear.
I don't understand why, completely - my best guess is that it'
Is it possible/easy in any of the compilers/interpreters to see what the
results of rewriting/optimisations are? (I'm sure it is *possible*, I'm
really asking if any produce simple output in a well documented format
that I'm likely to understand).
The reason I ask is because I'm curious whether
[EMAIL PROTECTED] said:
[...]
> If you can wait a day or two, I have some code which needs to be cleaned
> up which does pretty much this.
Thanks to everyone who's replied (including some replies I see in the
inbox that I have not read yet). Yes, I can certainly wait (and would be
interested to
I have a Haskell program that caches data in a tree. Unfortunately, the
tree grows to exceed the available memory over time. In a different
language, where I might be handling the caching myself, rather than
relying on laziness within the language, I might work round this by
keeping track of wh
21 matches
Mail list logo