Re: [Haskell-cafe] Functional Dependencies and multiparametertypeclasses

2009-08-24 Thread Harald ROTTER
09 13:31 | | | | |-+--> >| | | | To: Harald ROTTER | | cc: haskell-ca

[Haskell-cafe] Functional Dependencies and multiparameter typeclasses

2009-08-24 Thread Harald ROTTER
Dear Haskellers, I am using multi parameter typeclasses to represent images consisting of pixels (e.g. bitmap images). {-# OPTIONS_GHC -XMultiParamTypeClasses #-} module Bitmap where -- | a pixel could be a Word8 (e.g. a graysclale image) -- | or a 3-tuple for RGB images class

Re: [Haskell-cafe] number-parameterized types and heterogeneous lists

2008-06-24 Thread Harald ROTTER
Hello Anton, thanks for your enlightening piece of code. "foldD" does exactly what I was hoping for. Now it becomes very obvious to me that the positions of the forall's in the Digit definition are crucial. Thanks a lot to Alfonso, Luke and Ryan as well. Haskell Cafe is a really good place to le

Re: [Haskell-cafe] number-parameterized types and heterogeneous lists

2008-06-22 Thread Harald ROTTER
Hello, sorry for the late answer, I was off for the weekend :-) The paper "Number-parameterized types" by Oleg Kielyov is located at http://okmij.org/ftp/papers/number-parameterized-types.pdf It impressively shows what one can do with Haskell's type system. What I am after is the replacem

[Haskell-cafe] number-parameterized types and heterogeneous lists

2008-06-20 Thread Harald ROTTER
Dear Haskellers, after reading Oleg Kiselyov's paper on number-parameterized types I started to play around with the class Digits that encodes decimal numbers in types. The "typed number" 10 would e.g. be defined as D1 $ D0 $ Sz I wondered if it would be possible replace the expression ab

[Haskell-cafe] advantages of using fix to define rcursive functions

2007-07-26 Thread Harald ROTTER
Hi, I read about the usage of "fix" to define recursive functions. Although I think that I understood how to use "fix", I still wonder what the advantages of "fix" are (as compared to the "conventional" approach to define recursive functions). Any hints are appreciated. Thanks Harald. " Ce

[Haskell-cafe] Using dump in Netwotk.Pcap

2007-05-08 Thread Harald ROTTER
Dear Haskellers, as a Haskell newbie I really enjoyed Austin Seipp's article on writing a packet sniffer in Haskell using the libpcap. I played around with Network.Pcap and tried to dump packets into a pcap file using the dump function: dump :: Ptr PcapDumpTag -> Ptr PktHdr -> Ptr Word8 -> IO ()