Hello Andrew,
Saturday, June 30, 2007, 11:48:19 AM, you wrote:
me too :) but i never used Haskell for compression itself, only for
managing archives. fast compression routines are written in C++
What, you're telling me that fast software cannot be written in
Haskell? :-P
in my
apfelmus wrote:
Am I missing something or why wouldn't
encode, decode :: String - String
encode = encodeRLE . encodeHuffman
decode = decodeHuffman . decodeRLE
do the job? This is probably what Andrew intends to do in his Java
version. Note that this not only RLE-encodes the Huffman table
Andrew Coppin wrote:
apfelmus wrote:
Am I missing something or why wouldn't
encode, decode :: String - String
encode = encodeRLE . encodeHuffman
decode = decodeHuffman . decodeRLE
do the job? This is probably what Andrew intends to do in his Java
version. Note that this not only
apfelmus wrote:
Andrew Coppin wrote:
It is enough. But given that the whole purpose of compression algorithms
is to squeeze data into the tiniest possible space, I wanted to avoid
having a size field. And mathematically it's perfectly possible to do...
I just can't find a convinient way to
OK, well I don't know the Parsec types and function names off the top of
my head, but suppose I have the following:
runParser :: Parser a b - [a] - Either ParseError b
parseHuffmanTable :: [x] - Parser Word8 (HuffmanTable x)
parseHuffmanPayload :: HuffmanTable x - Parser Word8 [x]
When you pretend you've never heard of monads or arrows, and
write down the types what do you get?
this question made me wonder whether i could still recall how i used
to write parsers before i heard of monads or arrows. it is difficult not
to fall back into the pattern of state transformer
apfelmus wrote:
Andrew Coppin wrote:
OK, I'm stuck now. :-S
1. How do I run the input through parseRLE and *then* through
parseHuffmanTable?
2. How do I get parseHuffmanPayload to continue from where parseRLE left
off? (How do I get parseRLE to not parse the entire input, for that
Hello Anatoly,
Sunday, July 1, 2007, 3:58:24 AM, you wrote:
Anyone have any pointers on how to get hashElem and updateElem to run
faster, or any insight on what exactly they are allocating. To me it
seems that those functions should be able to do everything they need
to without a malloc.
Hello Andrew,
Sunday, July 1, 2007, 1:18:16 PM, you wrote:
encoding is simple - make this traversal one time and store bit
sequence for each symbol. for decoding, you can find length of longest
symbol MaxBits and build table of 2^MaxBits elements which allows to
find next symbol by direct
Bulat Ziganshin wrote:
Hello Andrew,
I see. So build a table of codes and bitmasks and test against that...
decodeSymbol = do
n - returnNextNBits MaxBits -- this operation doesn't forward input pointer!
symbol - table1 ! n
bits - table2 ! symbol
skipNBits bits
return
Hi Claus. I am sympathetic with your comments regarding monads and
continuations. It's interesting to note that the original I/O system in
Haskell was based on streams and continuations. The continuation
version had two continuations in fact -- one for success and one for
failure. For
Stefan O'Rear wrote:
This is *much* easier expressed as a bottom-up traversal.
compile = transform optimize . transform eliminate
eliminate (Lam v e) = transform (abstract v) e
eliminate x = x
abstract v (Var v') | v == v' = I
abstract v (a :@ b) = S :@ a :@ b
abstract v x = x
optimize (S
On Sun, Jul 01, 2007 at 05:06:10PM +0100, Andrew Coppin wrote:
Stefan O'Rear wrote:
This is *much* easier expressed as a bottom-up traversal.
compile = transform optimize . transform eliminate
eliminate (Lam v e) = transform (abstract v) e
eliminate x = x
abstract v (Var v') | v == v'
Andrew Coppin [EMAIL PROTECTED] writes:
While we're on the subject... am I the first person to
notice that Haskell doesn't appear to have much support for
fiddling with streams of bits?
No. Presumably the author of Data.Bits noticed some
lack. (Note that Integer is an instance of Num and
Just an outsider's reaction, and for all I know unsafeRead is actually safe,
but if the point of using Haskell (and I'm still trying to discover what
that is ;-) ) is either to be able to rigorously mathematically prove that
your program will work perfectly (target usage 1), or to carry out
On 6/30/07, Jon Cast [EMAIL PROTECTED] wrote:
On Friday 29 June 2007, Jon Cast wrote:
Here's my solution (drawn from a library I'll be posting Real Soon Now):
snip solution
I forgot to point out that this is 75-90% drawn from a library called
Fudgets[1], which is probably the most extended
On 6/26/07, Udo Stenzel [EMAIL PROTECTED] wrote:
That's another way of saying that the truly powerful features are
missing from C#...
Hi Udo,
Genuine question: please could you tell me what are the truly powerful
features of Haskell?
My own personal interest comes from a presentation by
Jon Fairbairn wrote:
Andrew Coppin [EMAIL PROTECTED] writes:
While we're on the subject... am I the first person to
notice that Haskell doesn't appear to have much support for
fiddling with streams of bits?
No. Presumably the author of Data.Bits noticed some
lack. (Note that Integer
Stefan O'Rear wrote:
On Sun, Jul 01, 2007 at 05:06:10PM +0100, Andrew Coppin wrote:
Um... shouldn't that read
abstract v (a :@ b) = S :@ (transform (abstract v) a) :@: (transform
(abstract v) b)
No, because the whole point of transform is that it handles recursion
for you.
OK.
Hi,
2007/7/1, Bulat Ziganshin [EMAIL PROTECTED]:
aa - unsafeRead a5 0
return $! aa
bb - unsafeRead a5 1
return $! bb
If this is a useful pattern, would it make sense to have a function to
encapsulate it?
mseq :: Monad m = m a - m a
mseq m = m = (return $!)
- Benja
Can somebody check that I've implemented this correctly?
*X*X*X*XX***X*X*XXX*X*X*XX***X*X*X*XX**X*X*XX**X*X*X*XX
***X*X*XXX*X*X*XX**XX*X*XX***X*X*XXX*X*XXX*X*X*XXX*
X*X*XX***X*X*XXX*X*X*XXX*X*X*X*XXXX*X*X*XX***X*
X*XXX*X*X*XXX*X*
A parser for this is given by
Andrew Coppin [EMAIL PROTECTED] writes:
(snip)
(Does anybody else on this list frequently get the feeling their IQ is
just too low for Haskell??)
I do. But then, when I finally understand something, it seems easy and
simple and I'm not sure why it wasn't obvious all along.
-- Mark
On 7/1/07, Andrew Coppin [EMAIL PROTECTED] wrote:
(Does anybody else on this list frequently get the feeling their IQ is
just too low for Haskell??)
That's the best part of learning Haskell. You're always in touch with
the very best people --- directly or indirectly (i.e. using their
libraries
so using mseq didn't seem to make any difference, i still had the same
performance.
On 7/1/07, Benja Fallenstein [EMAIL PROTECTED] wrote:
Hi,
2007/7/1, Bulat Ziganshin [EMAIL PROTECTED]:
aa - unsafeRead a5 0
return $! aa
bb - unsafeRead a5 1
return $! bb
If this is a useful
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
Andrew Coppin wrote:
decode (c:cs) = case c of
'X' - X
'*' - let (e0,cs0) = decode cs; (e1,cs1) = decode cs0 in (e0 `apply`
e1, cs1)
The letter X stands for the following combinator:
X = \x - xSK
K = \xy - x
S = \fgx - fx(gx)
Mark T.B. Carroll wrote:
Andrew Coppin [EMAIL PROTECTED] writes:
(snip)
(Does anybody else on this list frequently get the feeling their IQ is
just too low for Haskell??)
I do. But then, when I finally understand something, it seems easy and
simple and I'm not sure why it wasn't
Felipe Almeida Lessa wrote:
On 7/1/07, Andrew Coppin [EMAIL PROTECTED] wrote:
(Does anybody else on this list frequently get the feeling their IQ is
just too low for Haskell??)
That's the best part of learning Haskell. You're always in touch with
the very best people --- directly or
Hi Andrew!
Seems that you've made a typo or something...
module Term where
import Control.Monad.State
testData = *X*X*X*XX**X*X*XX*X*X*X*XX*X*X*XX***X*X*X*XX ++
***X*X*X*XX**X*X*XX*X*X*X*XX*X*X*XX*XX***X*X*X*X ++
X***X*X*X*XX**X*X*XX*X*X*X*XX*X*X*XX*XX
data Term =
Wait a sec... I found a way. Sort of.
http://ling.ucsd.edu/~barker/Iota/
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe
On Saturday 30 June 2007, Claus Reinke wrote:
The standard, naïve approach to monadic parsing is very nice, but
inefficient. So *please read* some material based on HuttonMeijer
approach, but don't stay there, read something more modern,
since we thereby seem to have left the phase of simple
Big Chris wrote:
http://www.cs.nott.ac.uk/~gmh/bib.html#monparsing
Hey, just to say, the first few pages of this explain monads really well.
Good reference :-)
It's the first introduction to monads I've seen that describes monads
directly, without using analogies, and manages to be both
Hello Hugh,
Sunday, July 1, 2007, 8:56:05 PM, you wrote:
Genuine question: please could you tell me what are the truly powerful
features of Haskell?
Anyway, getting back to my question, there's a whole slew of
articles around saying that no-one uses Haskell because they're too
stupid.
Ok good info :-)
btw, are you read Hoar's book Communicating Sequential Processes? i
think that his model is very FPish and reading his book should allow
to switch your look at concurrency in right direction
No, I'll check it out.
On 7/1/07, Bulat Ziganshin [EMAIL PROTECTED] wrote:
Hello
Well, figured out a solution to parsing xml. It's not really pretty, but it
works.
Basically we just convert the incoming xml into a gread compatible format
then use gread :-D
If someone has a more elegant solution, please let me know.
module ParseXml
where
import IO
import Char
import
On Sun, Jul 01, 2007 at 10:48:11PM +0200, Hugh Perkins wrote:
On 7/1/07, Bulat Ziganshin [EMAIL PROTECTED] wrote:
btw, are you read Hoar's book Communicating Sequential Processes? i
think that his model is very FPish and reading his book should allow
to switch your look at
Clll :-) Thanks for the link.
Er are you the Philip Armstrong I was at college with
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe
On Sunday 01 July 2007 09:34, Gregory Propf wrote:
Thanks, that was helpful. I didn't realize that there were pure functional
monads.
Neither did i; the general impression i'd got after almost a year of trying to
learn Haskell was: Monad Eisley Spaceport. You will never find a more
wretched
37 matches
Mail list logo