hgeometry-combinatorial
Copyright(C) Frank Staals
Licensesee the LICENSE file
MaintainerFrank Staals
Safe HaskellNone
LanguageGHC2021

HGeometry.Sign

Description

Signs of expressions

Synopsis

Documentation

data Sign Source #

The sign of an expression

Constructors

Negative 
Positive 

Instances

Instances details
Bounded Sign Source # 
Instance details

Defined in HGeometry.Sign

Enum Sign Source # 
Instance details

Defined in HGeometry.Sign

Methods

succ :: Sign -> Sign #

pred :: Sign -> Sign #

toEnum :: Int -> Sign #

fromEnum :: Sign -> Int #

enumFrom :: Sign -> [Sign] #

enumFromThen :: Sign -> Sign -> [Sign] #

enumFromTo :: Sign -> Sign -> [Sign] #

enumFromThenTo :: Sign -> Sign -> Sign -> [Sign] #

Show Sign Source # 
Instance details

Defined in HGeometry.Sign

Methods

showsPrec :: Int -> Sign -> ShowS #

show :: Sign -> String #

showList :: [Sign] -> ShowS #

Eq Sign Source # 
Instance details

Defined in HGeometry.Sign

Methods

(==) :: Sign -> Sign -> Bool #

(/=) :: Sign -> Sign -> Bool #

Ord Sign Source # 
Instance details

Defined in HGeometry.Sign

Methods

compare :: Sign -> Sign -> Ordering #

(<) :: Sign -> Sign -> Bool #

(<=) :: Sign -> Sign -> Bool #

(>) :: Sign -> Sign -> Bool #

(>=) :: Sign -> Sign -> Bool #

max :: Sign -> Sign -> Sign #

min :: Sign -> Sign -> Sign #

flipSign :: Sign -> Sign Source #

Flip Positive = Negative.

signFromTerms :: (Num r, Eq r, Foldable1 f) => f r -> Maybe Sign Source #

Given the terms, in decreasing order of significance, computes the sign

i.e. expects a list of terms, we base the sign on the sign of the first non-zero term.