Copyright | (c) Fabricio Olivetti 2021 - 2024 |
---|---|
License | BSD3 |
Maintainer | [email protected] |
Stability | experimental |
Portability | ConstraintKinds |
Safe Haskell | None |
Language | Haskell2010 |
Text.ParseSR
Description
Functions to parse a string representing an expression
Synopsis
- parseSR :: SRAlgs -> ByteString -> Bool -> ByteString -> Either String (Fix SRTree)
- parsePat :: ByteString -> Either String Pattern
- parseNonTerms :: String -> [SRTree ()]
- showOutput :: Output -> Fix SRTree -> String
- data SRAlgs
- data Output
Documentation
parseSR :: SRAlgs -> ByteString -> Bool -> ByteString -> Either String (Fix SRTree) Source #
Calls the corresponding parser for a given SRAlgs
>>>
fmap (showOutput MATH) $ parseSR OPERON "lambda,theta" False "lambda ^ 2 - sin(theta*3*lambda)"
Right "((x0 ^ 2.0) - Sin(((x1 * 3.0) * x0)))"
parseNonTerms :: String -> [SRTree ()] Source #
showOutput :: Output -> Fix SRTree -> String Source #
Returns the corresponding function from Data.SRTree.Print for a given Output
.
Supported algorithms.