I\'ve got a numeric application that does a lot of work with negative logs of probabilities, which (since probabilities range from zero to one) take the values of positive doubl
The Unbox
type class doesn't have any methods -- it's just shorthand for the Vector
and MVector
type classes. Derive those, and the Unbox
class comes for free (either via deriving or by just writing instance U.Unbox Score
on its own line somewhere).
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
import Data.Vector.Generic.Base
import Data.Vector.Generic.Mutable
import qualified Data.Vector.Unboxed as U
newtype Score = Score Double deriving (Vector U.Vector, MVector U.MVector, U.Unbox)