File: Rectangular.hs

package info (click to toggle)
haskell-algebra 2.1.1.2-1
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 420 kB
  • sloc: haskell: 4,758; makefile: 2
file content (21 lines) | stat: -rw-r--r-- 585 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
module Numeric.Band.Rectangular 
  ( Rect(..)
  ) where

import Numeric.Algebra.Class
import Numeric.Algebra.Idempotent
import Data.Semigroupoid

-- | a rectangular band is a nowhere commutative semigroup.
-- That is to say, if ab = ba then a = b. From this it follows
-- classically that aa = a and that such a band is isomorphic 
-- to the following structure
data Rect i j = Rect i j deriving (Eq,Ord,Show,Read)

instance Semigroupoid Rect where
  Rect _ i `o` Rect j _ = Rect j i

instance Multiplicative (Rect i j) where
  Rect i _ * Rect _ j = Rect i j

instance Band (Rect i j)