Hello Bulat,
Sunday, May 28, 2006, 2:44:37 PM, you wrote:
type PtrLen a = (Ptr a, Int)
encodePtrLen :: (Binary a) = a - (PtrLen a - IO b) - IO b
decodePtr :: (Binary a) = Ptr a - IO a
Finally i've implemented the following (you then would use
'withForeignPtr' to work with contents of
[See comments at bottom]
Bulat Ziganshin wrote:
Finally i've implemented the following (you then would use
'withForeignPtr' to work with contents of ForeignPtr):
-- -
-- Encode/decode contents of memory buffer
You would need to define a type class
(Binary a) = EncodedPtr a b
where the 'a' is as you have it currently, and the b would be an
enumerated type which tracks the memory representation.
I agree they are different concepts - that is why an EncodedPtr would
require 2 type parameters. Of
Hello Jacques,
Wednesday, May 31, 2006, 5:33:39 PM, you wrote:
encodePtr :: (Binary a, Integral size) = a - IO (ForeignPtr
x, size)
encodePtrLE :: (Binary a, Integral size) = a - IO (ForeignPtr
x, size)
encodePtrBitAligned :: (Binary a, Integral size) = a - IO
(moved to haskell-cafe)
Hello Jean-Philippe,
Tuesday, May 30, 2006, 2:58:01 PM, you wrote:
you should also see to the Collections package:
darcs get --partial http://darcs.haskell.org/packages/collections/
although it contains only _immutable_ datastructures at this
moment. may be, you can
Am I the only one who finds this encoding-of-types in the _name_ of a
function quite distateful? There is no type safety being enforced here, no
ensuring one will not be encoding a Ptr one way and decoding it another. Why
not use Haskell's type system to help you there?
When marshalling
I have no problems with marshalling/unmarshalling (and even with the
implicit casting going on). What I dislike is having a bunch of
functions which are the same but with different names, where the
difference boils down to enumerated types that end up being encoded in
the function name.
Bulat Ziganshin wrote:
i'm not against your idea, you absolutely right that this will be more
Haskell way, but can this be implemented without additional
complications for library users?
C is a language which pushes the boundaries of no complications (ie
convenience) quite far (and yet
A while back there was a long thread about Sudoku solvers (some of which ended
up on http://haskell.org/haskellwiki/Sudoku ). I contributed my brute-force
dancing links solver at the time, and mentioned that I had a by-logic solver
that, while a bit slow, was as good as most of those being
Doaitse Swierstra wrote:
On 2006 mei 30, at 17:33, Brian Hulley wrote:
But the buffer will nearly always be incomplete as you're editing it.
I was kind of hoping that the syntax of Haskell could be changed so
that for
any sequence of characters there would be a unique parse that had a
minimum
Hello Jacques,
Wednesday, May 31, 2006, 8:07:29 PM, you wrote:
I am completely biased in this regard: I have spent several years
maintaining ~800Kloc of legacy dynamically typed [commercial] code. A
lot of this code has a life-span of roughly 20 years [ie once written,
it takes an average
On Wednesday 31 May 2006 17:12, Bulat Ziganshin wrote:
6. There is no class framework for container types other than this
Data.Collections module,
Edison?
Ben
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
Lately, in my quest to get a better understanding of the typeclass
system, I've been writing my typeclass instance declarations in Prolog
first, then when I've debugged them, I port them over back over to
Haskell. The porting process involves a lot trial and error on my part
trying to decide
On Wednesday 31 May 2006 08:22 pm, Greg Buchholz wrote:
Lately, in my quest to get a better understanding of the typeclass
system, I've been writing my typeclass instance declarations in Prolog
first, then when I've debugged them, I port them over back over to
Haskell. The porting process
Dear,
After having read Bulat's mail regarding TH when I had mentioned my wish
for Pretty, I decided to use TH for a much smaller project. That's why
today I have created an automated derivation for data constructor
filtering. As I started coding someone mentioned that something similar
can
15 matches
Mail list logo