vak: (Знайка)
[personal profile] vak
Structure and Interpretation of Quantum Mechanics — a Functional Framework

Типа такого:
infixl 7 *>
infixl 6 <+>,<->

class Vspace v where
(<+>) :: v -> v -> v
(<->) :: v -> v -> v
(*>) :: Scalar -> v -> v

type HV b = b->Scalar
instance Vspace (HV b) where
(f <+> g) a = f a + g a
(f <-> g) a = f a - g a
(c *> f) a = c*(f a)