High-level input/output interface for finite state machines.
This module allows one to load and save FSMs, where the format to be used may be either explicitly specified, or guessed according to the filename's extension.
Documentation
Known FSM I/O formats.
FsmActionMatrices | ActionMatrix format: use
|
FsmEdges | FsmEdges format: use
|
FsmMatrix | FsmMatrix format: use
|
fsmFormats :: FilePath -> [FsmIO]Source
Given a path, return a list of all FsmIO
formats, with guesses
(according to the file extension) at the front.
loadFsm :: FilePath -> [FsmIO] -> IO (Either FsmError (FSM String))Source
Read an FSM
from a file. If the user specifies
any FsmIO
formats, try each of those in turn; otherwise, try
every format known, using the filename extension to guess which to
try first.
The returned value is either the resultant FSM
,
or the error message produced by trying to load it with the _first_
format (so in the case of guessing formats, if the guess is wrong
and the file is corrupt, you might get an unhelpful error message).