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

Show Sign Source # 
Instance details

Defined in HGeometry.Sign

Eq Sign Source # 
Instance details

Defined in HGeometry.Sign

Methods

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

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

Ord Sign Source # 
Instance details

Defined in HGeometry.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.