[vector] #46: Signature of backpermute is unnessesary restrictive
vector
vector at projects.haskell.org
Sun Oct 24 18:06:01 EDT 2010
#46: Signature of backpermute is unnessesary restrictive
----------------------+-----------------------------------------------------
Reporter: Khudyakov | Owner:
Type: defect | Status: new
Priority: major | Milestone:
Version: | Resolution:
Keywords: |
----------------------+-----------------------------------------------------
Comment (by Khudyakov):
Well this one is nice too. And it's not possible to became more generic.
{{{
backpermute :: (Vector v a, Vector v'' a, Vector v' Int) => v a -> v' Int
-> v'' a
}}}
There is another concert. Function above doesn't fix return type so
additional type annotation may become nessesary. Maybe it should be named
backpermuteGen or something along this lines and old function should
retain old signature
With specialized modules it's easy. They are specialized then export
specialized signatures like
{{{
backpermute :: Vector a -> Vector Int -> Vector a
}}}
If they are too restrictive you have to import from D.V.Generic. It's not
too paintful I think.
--
Ticket URL: <http://trac.haskell.org/vector/ticket/46#comment:2>
vector <http://trac.haskell.org/vector>
Package vector
More information about the vector
mailing list