On 01/03/2013 09:54 PM, Christian Höner zu Siederdissen wrote:
My preference would be to follow the naming conventions of vector.
Mostly because vector is widely-used and might become the new basis for
bytestring (is this right? I'm not sure).
So, have
slice :: Offset -> Length -> s -> s
maybe Length needs to be a type family? Being Int or Int64?
Why not use type variable instead of a real type, so that we have:
slice :: Integral a => Offset -> a -> s -> s
In this way, it's convenient to use any Integral type without need to
covert the type, also it makes we use Integer as the type possible
without always need to use Integer when we don't need to, since it's
more expensive.
Also, why don't have two functions so it supports both convention, since
both are very hardy in some occasion, and e.g. Ruby support slicing
string with range and also with offset + length, so we have
slice :: Integral a => Offset -> a -> s -> s
slice' :: Offset -> Offset -> a -> s -> s -- inclusive (I suppose
exclusive may not really needed)
Anyway, I havn't dig into Haskell's bio modules yet, so the above is
from the thinking of a person who knows bioinformatics processing, knows
Haskell a bit and knows other programming languages like Perl and Ruby
but still outside biohaskell community. Hope I'll be really in the
community soon, and hope the above suggestions make sense.
Regards!
_______________________________________________
Biohaskell mailing list
Biohaskell@biohaskell.org
http://malde.org/cgi-bin/mailman/listinfo/biohaskell