{-# LANGUAGE MultiParamTypeClasses, FunctionalDependencies, FlexibleInstances, UndecidableInstances, FlexibleContexts, EmptyDataDecls, ScopedTypeVariables, TypeOperators, TypeSynonymInstances, TypeFamilies #-} module Automata where class Eq a => DFA a b where start :: a delta :: b -> a -> a finals :: [a] dfa :: [b] -> a dfa = foldl (flip delta) start -- dfaAccept :: [b] -> Bool -- dfaAccept xs = (dfa xs) `elem` finals