srtree-2.0.0.0: A general library to work with Symbolic Regression expression trees.
Copyright(c) Fabricio Olivetti 2021 - 2024
LicenseBSD3
Maintainerfabricio.olivetti@gmail.com
Stabilityexperimental
PortabilityConstraintKinds
Safe HaskellSafe-Inferred
LanguageHaskell2010

Text.ParseSR.IO

Description

Functions to parse multiple expressions from stdin or a text file.

Synopsis

Documentation

withInput :: String -> SRAlgs -> String -> Bool -> Bool -> IO [Either String (Fix SRTree)] #

given a filename, the symbolic regression algorithm, a string of variables name, and two booleans indicating whether to convert float values to parameters and whether to simplify the expression or not, it will read the file and parse everything returning a list of either an error message or a tree.

empty filename defaults to stdin

withOutput :: String -> Output -> [Either String (Fix SRTree)] -> IO () #

outputs a list of either error or trees to a file using the Output format.

empty filename defaults to stdout

withOutputDebug :: String -> Output -> [Either String (Fix SRTree, Fix SRTree)] -> IO () #

debug version of output function to check the invalid parsers