module Algebra.Affine where import Algebra (Group (..)) class Group (Diff a) => Affine a where type Diff a diff :: a -> a -> Diff a offset :: Diff a -> a -> a infix 6 .-. (.-.) :: Affine a => a -> a -> Diff a .-. :: a -> a -> Diff a (.-.) = a -> a -> Diff a forall a. Affine a => a -> a -> Diff a diff infixl 6 .+, .- (.+), (.-) :: Affine a => a -> Diff a -> a a :: a a .+ :: a -> Diff a -> a .+ δ :: Diff a δ = Diff a -> a -> a forall a. Affine a => Diff a -> a -> a offset Diff a δ a a a :: a a .- :: a -> Diff a -> a .- δ :: Diff a δ = Diff a -> a -> a forall a. Affine a => Diff a -> a -> a offset (Diff a -> Diff a forall a. Group a => a -> a invert Diff a δ) a a