srtree-2.0.1.4: A general library to work with Symbolic Regression expression trees.
Copyright(c) Fabricio Olivetti 2021 - 2024
LicenseBSD3
Maintainer[email protected]
Stabilityexperimental
PortabilityConstraintKinds
Safe HaskellNone
LanguageHaskell2010

Text.ParseSR

Description

Functions to parse a string representing an expression

Synopsis

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)))"

showOutput :: Output -> Fix SRTree -> String Source #

Returns the corresponding function from Data.SRTree.Print for a given Output.

data SRAlgs Source #

Supported algorithms.

Constructors

TIR 
HL 
OPERON 
BINGO 
GOMEA 
PYSR 
SBP 
EPLEX 

Instances

Instances details
Bounded SRAlgs Source # 
Instance details

Defined in Text.ParseSR

Enum SRAlgs Source # 
Instance details

Defined in Text.ParseSR

Read SRAlgs Source # 
Instance details

Defined in Text.ParseSR

Show SRAlgs Source # 
Instance details

Defined in Text.ParseSR

data Output Source #

Supported outputs.

Constructors

PYTHON 
MATH 
TIKZ 
LATEX 

Instances

Instances details
Bounded Output Source # 
Instance details

Defined in Text.ParseSR

Enum Output Source # 
Instance details

Defined in Text.ParseSR

Read Output Source # 
Instance details

Defined in Text.ParseSR

Show Output Source # 
Instance details

Defined in Text.ParseSR