From d3f6fdc3ea71386c2b9a9cd5a686455dbee3e60e Mon Sep 17 00:00:00 2001 From: Gregor Kleen Date: Mon, 21 May 2018 16:14:26 +0200 Subject: Introduce FSTs & Generalize input/output `toFST` is currently invalid --- edit-lens/src/Control/FST.lhs | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 edit-lens/src/Control/FST.lhs (limited to 'edit-lens/src/Control/FST.lhs') diff --git a/edit-lens/src/Control/FST.lhs b/edit-lens/src/Control/FST.lhs new file mode 100644 index 0000000..d3c8ca9 --- /dev/null +++ b/edit-lens/src/Control/FST.lhs @@ -0,0 +1,24 @@ +\begin{code} + +{-| +Description: Finite state transducers with epsilon-transitions +-} +module Control.FST + ( FST(..) + ) where + +import Data.Map.Strict (Map) +import qualified Data.Map.Strict as Map + +import Data.Set (Set) + +import Data.Sequence (Seq) + +import Control.Lens.TH + +data FST state input output = FST + { stInitial :: state + , stTransition :: Map (state, Maybe input) (Set (state, Maybe output)) + , stAccept :: Set state + } +\end{code} -- cgit v1.2.3