[Haskell-cafe] ANN: fixed-vector

Michael Orlitzky michael at orlitzky.com
Tue Nov 13 02:32:15 CET 2012


On 11/12/12 07:05, Aleksey Khudyakov wrote:
>> I have a lot of one-off code where I've defined these myself. Is it
>> possible to e.g. define vectors in R^2 and R^3, and write the p-norm
>> functions only once?
>>
> 
> Yes. it's possible.
> 
>> {-# LANGUAGE TypeFamilies #-}
>> {-# LANGUAGE FlexibleInstances #-}
>> {-# LANGUAGE MultiParamTypeClasses #-}
>> import Data.Vector.Fixed as V
>> import Data.Vector.Fixed.Internal
>> -- ^^^ Needed for Fun /will be reexported from Data.Vector.Fixed
>> import Data.Vector.Fixed.Unboxed
> 
> First we need to define data types and instances. It's possible to use
> vectors from library
> 
> ...

Thanks, this looks like exactly what I need. I'll try to replace my R^2
and R^3 implementations the next time I do my homework before the last
minute.



More information about the Haskell-Cafe mailing list