turingMachine-0.1.1.2: An implementation of Turing Machine and Automaton

Copyright(c) Jorge Santiago Alvarez Cuadros, 2016
LicenseGPL-3
Maintainersanjorgek@ciencias.unam.mx
Stabilityexperimental
Portabilityportable
Safe HaskellSafe
LanguageHaskell2010

Data.State

Contents

Description

Simple State function, have an isomorphism with Maybe but order are diferent

Synopsis

Data and type

data State a Source

Macine states are only a label, maybe a letter

Constructors

Q a

State constructor

QE

Error state

Instances

Monad State Source

Same as Maybe

Functor State Source

Same as Maybe

Applicative State Source

Same as Maybe

Foldable State Source 
Bounded a => Bounded (State a) Source

In this differ with Maybe because this show a upper bounded order

Enum a => Enum (State a) Source

Same as Maybe

Eq a => Eq (State a) Source 
Ord a => Ord (State a) Source 
Show a => Show (State a) Source 
Monoid a => Monoid (State a) Source 

type Final a = [State a] Source

Final state represent a set of states which elements put end to computation

terminal :: Eq a => Final a -> State a -> Bool Source

Tells if a state is final

Functions

isError :: Eq a => State a -> Bool Source

Verifica si el estado es de error, comparandolo con la definicion de estado de error

Tells if a state is a error state