XPn      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklm,Equation solver and calculator la metafont(c) Kristof Bastiaensen, 2015BSD-3kristof@resonata.beunstableghcNone05:<=IMbANA 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 2: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.n 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 (o, p and q,) 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.sinecosineabsolute valuereciprocal (1/x)signnatural exponential (e^x)natural logarithm (log x)hyperbolic cosineinverse hyperbolic tangenttangenthyperbolic tangenthyperbolic sine inverse sine inverse cosine!inverse hyperbolic sine"inverse hyperbolic cosine#inverse tangent%Addition&Multiplication(+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 constant0$Create an expression from a variable1An empty system of equations.2addEquation d e: Add the equation e = 0 to the system d.3Eliminate 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.42Return True if the variable is known or dependend.57Return all dependend variables with their dependencies.6Return all known variables.7mReturn the value of the variable, or a list of variables it depends on. Only linear dependencies are shown.8Return all nonlinear equations e_i, where e_i = 0.9>Show all variables and equations. Useful in combination with H.:AGet the dependencies from a state monad. Specialized version of r.;3Return the value of the variable or throw an error.<Monadic version of 4.=Monadic version of 7.>Monadic version of 3.?(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).ASucceed even when trowing a  error.Brun the solver.CaReturn the result of solving the equations, or throw the error as an exception. Monadic version.DIReturn the result of solving the equations or an error. Monadic version.EIRun the solver and return the dependencies or an error. Monadic version.FOReturn the result of solving the equations, or throw the error as an exception.G7Return the result of solving the equations or an error.H7Run the solver and return the dependencies or an error.T@A simple String wrapper, which will print formulas more cleanly.stuvnwxyz{|}~   !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYI  !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHI    !"#$%& 0/.-)*(+,12376485?@:;=<>ABGHF9'DECustuvnwxyz{|}~    !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXY?1@1        !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqorsotuvwx yz{|}~ &mfsolve-0.3.2.0-J7SZ9Kp9Pe2IAwq1BbAf3H Math.MFSolveMFSolver MFSolverTDepError UndefinedVar UnknownVarInconsistentEq RedundantEq DependenciesLinExprExpr SimpleVar SimpleExprSEBinSEUnVarConstUnaryOpSinCosAbsRecipSignumExpLogCoshAtanhTanTanhSinhAsinAcosAsinhAcoshAtanBinaryOpAddMul runSolverThasVartoSimple evalSimple mapSimplemapExpr fromSimpleevalExpr makeConstant makeVariablenoDeps addEquation eliminate varDefined dependendVars knownVarsgetKnown nonlinearEqsshowVars dependenciesgetValue varDefinedM getKnownM eliminateM====&=ignore runSolver unsafeSolveT evalSolverT execSolverT unsafeSolve evalSolver execSolver$fShowDepError$fShowDependencies$fFloatingExpr$fFractionalExpr $fNumExpr $fShowUnaryOp$fShowBinaryOp$fShowSimpleExpr$fMonadTransMFSolverT $fShowExpr$fExceptionDepError$fShowSimpleVar$fHashableSimpleVar$fHashableExpr$fHashableUnaryOp$fHashableNonLinExpr$fHashableLinExpr $fEqBinaryOp $fEqUnaryOp$fGenericUnaryOp $fEqSimpleVar$fOrdSimpleVar$fGenericSimpleVar$fGenericLinExpr $fEqLinExpr $fShowLinExpr$fGenericNonLinExpr $fGenericExpr$fFunctorMFSolverT$fApplicativeMFSolverT$fMonadMFSolverT$fMonadIOMFSolverT$fMonadStateMFSolverT$fMonadErrorMFSolverT$fMonadReaderMFSolverT$fMonadWriterMFSolverT$fMonadContMFSolverT LinearMapbaseGHC.NumNum GHC.FloatFloatingGHC.Real Fractional mtl-2.2.1-6qsR1PHUy5lL47Hpoa4jCMControl.Monad.State.ClassgetTrigEq2TrigEq NonLinExprUnaryAppMulExpSinExpTrigTerm AmplitudePhasePeriodLConstConstELinearE withParens addSimpleseHasVar linToSimple trigToSimplenonlinToSimpleevalBinevalUnzeroTermzeroExprtrigExpr nonlinExprisConstlinVarsaddLinaddExprmerge addTrigTerms addTrigTermtermIsMultiple compareTerm compareBy mulLinExpr mulConstTrig mulLinTrigmulExprsinExprunExpr substVarLinsubstVarNonLin substVarTrigsubst simpleSubst trigToExpr trig2ToExpraddEqsselectsubstDepaddEq0 deleteDep reArrange reArrangeTrigelimTrigdmodsplitMax