dumb-cas-0.2.1.1: A computer “algebra” system that knows nothing about algebra, at the core.
Copyright(c) Justus Sagemüller 2017
LicenseGPL v3
Maintainer(@) jsag $ hvl.no
Stabilityexperimental
Portabilityportable
Safe HaskellSafe-Inferred
LanguageHaskell2010

CAS.Dumb.Symbols

Description

 
Synopsis

Documentation

data SymbolD σ c Source #

Instances

Instances details
(UnicodeSymbols c, RenderableEncapsulations c) => Show (Expression c) Source # 
Instance details

Defined in CAS.Dumb.Symbols.Unicode.MathLatin_RomanGreek__BopomofoGaps

(UnicodeSymbols c, RenderableEncapsulations c) => Show (Pattern c) Source # 
Instance details

Defined in CAS.Dumb.Symbols.Unicode.MathLatin_RomanGreek__BopomofoGaps

Methods

showsPrec :: Int -> Pattern c -> ShowS #

show :: Pattern c -> String #

showList :: [Pattern c] -> ShowS #

Unwieldy c => Unwieldy (Symbol c) Source # 
Instance details

Defined in CAS.Dumb.Symbols.ASCII

Unwieldy c => Unwieldy (Symbol c) Source # 
Instance details

Defined in CAS.Dumb.Symbols.Unicode.MathLatin_RomanGreek__BopomofoGaps

(SymbolClass σ, SCConstraint σ c, Eq c) => Eq (SymbolD σ c) Source # 
Instance details

Defined in CAS.Dumb.Symbols

Methods

(==) :: SymbolD σ c -> SymbolD σ c -> Bool #

(/=) :: SymbolD σ c -> SymbolD σ c -> Bool #

(SymbolClass σ, SCConstraint σ String) => Floating (AlgebraExpr' γ σ String) Source # 
Instance details

Defined in CAS.Dumb.Symbols

(SymbolClass σ, SCConstraint σ String) => Num (AlgebraExpr' γ σ String) Source # 
Instance details

Defined in CAS.Dumb.Symbols

(SymbolClass σ, SCConstraint σ String) => Fractional (AlgebraExpr' γ σ String) Source # 
Instance details

Defined in CAS.Dumb.Symbols

(ASCIISymbols c, RenderableEncapsulations c) => Show (CAS (Infix c) (Encapsulation c) (Symbol c)) Source # 
Instance details

Defined in CAS.Dumb.Symbols.ASCII

Methods

showsPrec :: Int -> CAS (Infix c) (Encapsulation c) (Symbol c) -> ShowS #

show :: CAS (Infix c) (Encapsulation c) (Symbol c) -> String #

showList :: [CAS (Infix c) (Encapsulation c) (Symbol c)] -> ShowS #

(ASCIISymbols c, RenderableEncapsulations c, Monoid c) => Show (CAS' GapId (Infix c) (Encapsulation c) (Symbol c)) Source # 
Instance details

Defined in CAS.Dumb.Symbols.ASCII

data Infix s Source #

Constructors

Infix 

Fields

Instances

Instances details
(UnicodeSymbols c, RenderableEncapsulations c) => Show (Expression c) Source # 
Instance details

Defined in CAS.Dumb.Symbols.Unicode.MathLatin_RomanGreek__BopomofoGaps

(UnicodeSymbols c, RenderableEncapsulations c) => Show (Pattern c) Source # 
Instance details

Defined in CAS.Dumb.Symbols.Unicode.MathLatin_RomanGreek__BopomofoGaps

Methods

showsPrec :: Int -> Pattern c -> ShowS #

show :: Pattern c -> String #

showList :: [Pattern c] -> ShowS #

Eq s => Eq (Infix s) Source # 
Instance details

Defined in CAS.Dumb.Symbols

Methods

(==) :: Infix s -> Infix s -> Bool #

(/=) :: Infix s -> Infix s -> Bool #

(SymbolClass σ, SCConstraint σ String) => Floating (AlgebraExpr' γ σ String) Source # 
Instance details

Defined in CAS.Dumb.Symbols

(SymbolClass σ, SCConstraint σ String) => Num (AlgebraExpr' γ σ String) Source # 
Instance details

Defined in CAS.Dumb.Symbols

(SymbolClass σ, SCConstraint σ String) => Fractional (AlgebraExpr' γ σ String) Source # 
Instance details

Defined in CAS.Dumb.Symbols

(ASCIISymbols c, RenderableEncapsulations c) => Show (CAS (Infix c) (Encapsulation c) (Symbol c)) Source # 
Instance details

Defined in CAS.Dumb.Symbols.ASCII

Methods

showsPrec :: Int -> CAS (Infix c) (Encapsulation c) (Symbol c) -> ShowS #

show :: CAS (Infix c) (Encapsulation c) (Symbol c) -> String #

showList :: [CAS (Infix c) (Encapsulation c) (Symbol c)] -> ShowS #

(ASCIISymbols c, RenderableEncapsulations c, Monoid c) => Show (CAS' GapId (Infix c) (Encapsulation c) (Symbol c)) Source # 
Instance details

Defined in CAS.Dumb.Symbols.ASCII

type family SpecialEncapsulation s Source #

Instances

Instances details
type SpecialEncapsulation String Source # 
Instance details

Defined in CAS.Dumb.Symbols

data Encapsulation s Source #

Instances

Instances details
(UnicodeSymbols c, RenderableEncapsulations c) => Show (Expression c) Source # 
Instance details

Defined in CAS.Dumb.Symbols.Unicode.MathLatin_RomanGreek__BopomofoGaps

(UnicodeSymbols c, RenderableEncapsulations c) => Show (Pattern c) Source # 
Instance details

Defined in CAS.Dumb.Symbols.Unicode.MathLatin_RomanGreek__BopomofoGaps

Methods

showsPrec :: Int -> Pattern c -> ShowS #

show :: Pattern c -> String #

showList :: [Pattern c] -> ShowS #

Eq (Encapsulation String) Source # 
Instance details

Defined in CAS.Dumb.Symbols

(SymbolClass σ, SCConstraint σ String) => Floating (AlgebraExpr' γ σ String) Source # 
Instance details

Defined in CAS.Dumb.Symbols

(SymbolClass σ, SCConstraint σ String) => Num (AlgebraExpr' γ σ String) Source # 
Instance details

Defined in CAS.Dumb.Symbols

(SymbolClass σ, SCConstraint σ String) => Fractional (AlgebraExpr' γ σ String) Source # 
Instance details

Defined in CAS.Dumb.Symbols

(ASCIISymbols c, RenderableEncapsulations c) => Show (CAS (Infix c) (Encapsulation c) (Symbol c)) Source # 
Instance details

Defined in CAS.Dumb.Symbols.ASCII

Methods

showsPrec :: Int -> CAS (Infix c) (Encapsulation c) (Symbol c) -> ShowS #

show :: CAS (Infix c) (Encapsulation c) (Symbol c) -> String #

showList :: [CAS (Infix c) (Encapsulation c) (Symbol c)] -> ShowS #

(ASCIISymbols c, RenderableEncapsulations c, Monoid c) => Show (CAS' GapId (Infix c) (Encapsulation c) (Symbol c)) Source # 
Instance details

Defined in CAS.Dumb.Symbols.ASCII

type AlgebraExpr σ l = CAS (Infix l) (Encapsulation l) (SymbolD σ l) Source #

type AlgebraExpr' γ σ l = CAS' γ (Infix l) (Encapsulation l) (SymbolD σ l) Source #

don'tParenthesise :: Monoid s¹ => CAS' γ (Infix s²) (Encapsulation s¹) s⁰ -> CAS' γ (Infix s²) (Encapsulation s¹) s⁰ Source #

symbolInfix Source #

Arguments

:: s²

The operator we want to describe

-> CAS' γ s² s¹ s⁰ 
-> CAS' γ s² s¹ s⁰ 
-> CAS' γ s² s¹ s⁰ 

symbolFunction :: Monoid s¹ => s¹ -> CAS' γ (Infix s²) (Encapsulation s¹) s⁰ -> CAS' γ (Infix s²) (Encapsulation s¹) s⁰ Source #

class ASCIISymbols c where Source #

Instances

Instances details
ASCIISymbols String Source # 
Instance details

Defined in CAS.Dumb.Symbols

type RenderingCombinator σ c r Source #

Arguments

 = Bool

Should the result be parenthesised?

-> Maybe r

Left context

-> SymbolD σ c

Central expressionfunctioninfix to render

-> Maybe r

Right context

-> r

Rendering result

data ContextFixity Source #

Instances

Instances details
Eq ContextFixity Source # 
Instance details

Defined in CAS.Dumb.Symbols

class UnicodeSymbols c where Source #

Instances

Instances details
UnicodeSymbols String Source # 
Instance details

Defined in CAS.Dumb.Symbols

normaliseSymbols :: forall σ c γ s² s¹. (SymbolClass σ, SCConstraint σ c) => CAS' γ s² s¹ (SymbolD σ c) -> CAS' γ s² s¹ (SymbolD σ c) Source #

(%$>) :: forall σ c c' γ s² s¹. (SymbolClass σ, SCConstraint σ c) => (c -> c') -> CAS' γ s² s¹ (SymbolD σ c) -> CAS' γ s² s¹ (SymbolD σ c') infixl 4 Source #

Transform the symbols of an expression, in their underlying representation.

(map succ%$> 𝑎+𝑝) * 𝑥  ≡  (𝑏+𝑞) * 𝑥

Note that this can not be used with number literals.

continueExpr Source #

Arguments

:: (Eq l, Monoid l) 
=> (AlgebraExpr' γ σ l -> AlgebraExpr' γ σ l -> AlgebraExpr' γ σ l)

Combinator to use for chaining the new expression to the old ones

-> (AlgebraExpr' γ σ l -> AlgebraExpr' γ σ l)

Transformation to apply to the rightmost expression in the previous chain

-> AlgebraExpr' γ σ l -> AlgebraExpr' γ σ l

Transformation which appends the result.

(&~~!) :: (Eq l, Eq (Encapsulation l), SymbolClass σ, SCConstraint σ l, Show (AlgebraExpr σ l), Show (AlgebraPattern σ l)) => AlgebraExpr σ l -> [AlgebraPattern σ l] -> AlgebraExpr σ l infixl 1 Source #

Apply a sequence of pattern-transformations and yield the result concatenated to the original via the corresponding chain-operator. Because only the rightmost expression in a chain is processed, this can be iterated, giving a chain of intermediate results.

If one of the patterns does not match, this manipulator will raise an error.

(&~~:) :: (Eq l, Eq (Encapsulation l), SymbolClass σ, SCConstraint σ l, Show (AlgebraExpr σ l), Show (AlgebraPattern σ l)) => AlgebraExpr σ l -> [AlgebraPattern σ l] -> AlgebraExpr σ l infixl 1 Source #

Apply a sequence of pattern-transformations, each in every spot possible, and yield the result concatenated to the original via the corresponding chain-operator. Because only the rightmost expression in a chain is processed, this can be iterated, giving a chain of intermediate results.