BNFC-2.8: A compiler front-end generator.

Safe HaskellNone
LanguageHaskell98

Algebra.RingUtils

Documentation

module Prelude

class AbelianGroup a where Source

Methods

zero :: a Source

(+) :: a -> a -> a infixl 6 Source

class AbelianGroup a => AbelianGroupZ a where Source

Methods

isZero :: a -> Bool Source

class AbelianGroupZ a => Ring a where Source

Methods

(*) :: a -> a -> a infixl 7 Source

Instances

class AbelianGroupZ a => RingP a where Source

Methods

mul :: Bool -> a -> a -> Pair a Source

data Pair a Source

Constructors

(:/:) infixl 2 

Fields

leftOf :: a
 
rightOf :: a
 

select :: Bool -> [t] -> Pair [t] Source

onlyLeft :: [t] -> Pair [t] Source

onlyRight :: [t] -> Pair [t] Source

newtype O f g a Source

Constructors

O 

Fields

fromO :: f (g a)
 

Instances

(Functor f, Functor g) => Functor (O f g) 
Matrix m => Matrix (O Pair m) 
Show (f (g a)) => Show (O f g a) 
AbelianGroupZ (f (g a)) => AbelianGroupZ (O f g a) 
AbelianGroup (f (g a)) => AbelianGroup (O f g a) 

sum :: AbelianGroup a => [a] -> a Source

mulDefault :: RingP a => a -> a -> a Source

module Data.Pair