úÎPÐHöH      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFG,Equation solver and calculator à la metafont(c) Kristof Bastiaensen, 2015BSD-3kristof@resonata.beunstableghcNone+047CGZ.NA monad for solving equations. Basicly just a state and exception monad over  and .fA monad transformer for solving equations. Basicly just a state and exception monad transformer over  and .An error type for >, ? and 1:The variable is not defined.9The variable is defined but dependend an other variables.The equation was reduced to the impossible equation `a == 0` for nonzero a, which means the equation is inconsistent with previous equations.iThe equation was reduced to the redundant equation `0 == 0`, which means it doesn't add any information.®This hidden datatype represents a system of equations. It contains linear dependencies on variables as well as nonlinear equations. The following terminology is used from metafont:known variable/: A variable who's dependency is just a number.dependend variable7: A variable which depends linearly on other variables.independend variable: any other variable.A  dependend# variable can only depend on other  independend§ variables. Nonlinear equations will be simplified by substituting and evaluating known variables, or by reducing some trigonometric equations to linear equations.H An angular function of the form c + n*sin(theta + alpha) where theta, and n are linear terms, alpha and c are constants.8A linear expression of several variables. For example:  2*a + 3*b + 2 would be represented as LinExpr 2 [(a, 2), (b, 3)]. LA mathematical expression of several variables. Several Numeric instances (I, J and K,) are provided, so doing calculations over   is more convenient. cA simplified datatype representing an expression. This can be used to inspect the structure of a  , which is hidden.'+The expression contains the given variable.( Convert an   to a  .):evaluate a simple expression using the given substitution.*5map a simple expression using the given substitution.+/map an expression using the given substitution.,+Make a expression from a simple expression.-6Evaluate the expression given a variable substitution..$Create an expression from a constant/$Create an expression from a variable0An empty system of equations.1addEquation d e: Add the equation e = 0 to the system d.2«Eliminate an variable from the equations. Returns the eliminated equations. Before elimination it performs substitution to minimize the number of eliminated equations. Important;: this function is still experimental and mostly untested.32Return True if the variable is known or dependend.47Return all dependend variables with their dependencies.5Return all known variables.6mReturn the value of the variable, or a list of variables it depends on. Only linear dependencies are shown.7Return all nonlinear equations e_i, where e_i = 0.8>Show all variables and equations. Useful in combination with G.9AGet the dependencies from a state monad. Specialized version of L.:3Return the value of the variable or throw an error.;Monadic version of 3.<Monadic version of 6.=Monadic version of 2.>(Make the expressions on both sides equal?qMake the pairs of expressions on both sides equal. No error is signaled if the equation for one of the sides is  Redundant" for example in (x, 0) == (y, 0).@Succeed even when trowing a  error.Arun the solver.BaReturn the result of solving the equations, or throw the error as an exception. Monadic version.CIReturn the result of solving the equations or an error. Monadic version.DIRun the solver and return the dependencies or an error. Monadic version.EOReturn the result of solving the equations, or throw the error as an exception.F7Return the result of solving the equations or an error.G7Run the solver and return the dependencies or an error.M@A simple String wrapper, which will print formulas more cleanly.–NOPQHRSTUVWXY Z  !"#$%[\]&^_`'abc(de)*+,-f./ghijklmnopqrstuvwxyz{|0}~€1‚ƒ„2…†‡ˆ‰3456789:;<=>?@ABCDEFGŠ‹ŒŽ‘’“”M•–—˜™H  !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGH    !"#$% /.-,()'*+01265374>?9:<;=@AFGE8&CDBtNOPQHRSTUVWXY Z   !"#$%[\]&^_`'abc(de)*+,-f./ghijklmnopqrstuvwxyz{|0}~€1‚ƒ„2…†‡ˆ‰3456789:;<=>?@ABCDEFGŠ‹ŒŽ‘’“”M•–—˜™>?š        !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKILMINOPQRS TUVWXYZ[\] ^_`abcdefghijklmnopqrstuvwxyz{|}~€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œmfsol_Fd7j180AasdAKRE2TJvJuN Math.MFSolveMFSolver MFSolverTDepError UndefinedVar UnknownVarInconsistentEq RedundantEq DependenciesLinExprExpr SimpleVar SimpleExprSEBinSEUnVarConstUnaryOpSinAbsRecipSignumExpLogCosCoshAtanhTanSinhAsinAcosAsinhAcoshAtanBinaryOpAddMul runSolverThasVartoSimple evalSimple mapSimplemapExpr fromSimpleevalExpr makeConstant makeVariablenoDeps addEquation eliminate varDefined dependendVars knownVarsgetKnown nonlinearEqsshowVars dependenciesgetValue varDefinedM getKnownM eliminateM====&=ignore runSolver unsafeSolveT evalSolverT execSolverT unsafeSolve evalSolver execSolver LinearMapbaseGHC.NumNum GHC.FloatFloatingGHC.Real Fractionalmtl_KMpng31YRYc5JfMWFZ3FCUControl.Monad.State.Classget$fShowSimpleVarTrigEq2TrigEq NonLinExprUnaryAppMulExpSinExpTrigTerm AmplitudePhasePeriodLinearEConstELConst withParens addSimpleseHasVar linToSimple trigToSimplenonlinToSimpleevalBinevalUnzeroTermtrigExpr nonlinExprisConstlinVarsaddLinaddExprmerge addTrigTerms addTrigTermtermIsMultiple compareTerm compareBy mulLinExpr mulConstTrig mulLinTrigmulExprsinExprunExpr substVarLinsubstVarNonLin substVarTrigsubst simpleSubst trigToExpr trig2ToExpraddEqsselectsubstDepaddEq0 deleteDep reArrange reArrangeTrigelimTrigdmodsplitMax$fShowDepError$fShowDependencies$fFloatingExpr$fFractionalExpr $fNumExpr $fShowUnaryOp$fShowBinaryOp$fShowSimpleExpr$fMonadTransMFSolverT $fShowExpr$fExceptionDepError$fHashableSimpleVar$fHashableExpr$fHashableUnaryOp$fHashableNonLinExpr$fHashableLinExpr