Hey there,
i was just thinking about types in Haskell and I asked myself,
Is there a mechanism, that allows me to define a new type out of an existing
one with some restrictions?
So that the new type is a subset of the existing one.
Lets imagine I want a type for a point like:
type Point =
If there is someone interested in playing around with the logo Don posted,
I made a gimp-version out of it.
http://frosch03.de/haskell/Haskell.xcf
http://frosch03.de/haskell/Haskell.png
-- Matthias
___
Haskell-Cafe mailing list
Hey There,
I am trying to write a hash-algorithm that in fact is working, but as you might
have guessed the problem is the performance :) At the moment I am 40 times
worse than the same implementation in C.
My problem is, I need mutable arrays which are the heart of that hash.
The algorithm
Thx for your hints, I played around with them and the performance gets slightly
better.
But the major boost is still missing :)
I noticed, that one real bottleneck seems to be the conversion of the array
back into a list.
The interesting part is, if I use the elems function (Data.Array.Base)
To make a long story short, here is the library code:
elems arr = case bounds arr of
(_l, _u) - [unsafeAt arr i | i - [0 .. numElements arr - 1]
And my version:
boundedElems arr = case bounds arr of
(_l, _u) - [unsafeAt arr i | i - [1737 .. 1752]]
Is there a reason,