[Haskell-cafe] Re: Implementing fixed-sized vectors (using datatype algebra?)

Wolfgang Jeltsch g9ks157k at acme.softbase.org
Fri Mar 14 16:58:41 EDT 2008


Am Freitag, 14. März 2008 17:46 schrieben Sie:
> […]

> I think that removing aliases completely is not a good idea. How about
> generating much lower aliases for decimals (lets say until 1000),

I don’t think, this is a good idea.  Like nobody will need an alias for 8247, 
nobody will need an alias for 824.  The main point is that it is unnecessary 
to have a continuous range of numbers for which aliases exist.  If you need 
aliases, you need them for “outstanding” values.  Maybe you need aliases for 
all powers of 2 up to a certain number.  Or aliases for all square numbers.

Therefore I think that if we want aliases then we should let the user and only 
the user generate them.  This has also the interesting consequence that the 
type-level package doesn’t need the Template Haskell language extension 
anymore.  After all, using the template-haskell package doesn’t imply that 
you have to have a TH-enabled compiler, as far as I know.

> droping the other bases,

That’s a good idea.

> and exporting a function to extended the alias range at will?

I’d rather propose something like this:

    $(numAliasDecls [2 ^ n | n <- 0..16])

So that numAliasDecls has a type like [Int] -> [Decl].

> (that function could perfectly include the other bases as well).

Maybe.

> […]

> I don't have the time to work on it now, but if you send me a patch
> I'd be happy to apply it. It should be something simple to do. All the
> Template Haskell machinery is already coded.

Okay, I could send you a patch realizing my above ideas but would like to hear 
your opinion first.

> […]

Best wishes,
Wolfgang


More information about the Haskell-Cafe mailing list