Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Lack of documentation! #8

Open
akash-07 opened this issue Apr 26, 2017 · 0 comments
Open

Lack of documentation! #8

akash-07 opened this issue Apr 26, 2017 · 0 comments

Comments

@akash-07
Copy link

akash-07 commented Apr 26, 2017

  • I have tried using Language.HaLex.FaAsDiGraph and Language.HaLex.Ndfa to generate the dot files but there are no example codes of how to use it.

  • By this I mean I initially started with my own data type for Ndfa and later I had to convert an instance of my type into an instance of the Ndfa data type defined in the module.

  • The documentation on hackage just gives you the type definition of Ndfa and of other functions. There are no clear examples of how to use it.

  • I faced a lot of trouble in converting an instance of my Ndfa data type into an instance of Ndfa type defined in the library. Basically the definition of delta function or transition function is not clear.

data Ndfa st sy = Ndfa [sy]                            -- Vocabulary
                       [st]                            -- Finite set of states
                       [st]                            -- The set of start state
                       [st]                            -- The set of final states
                       (st -> Maybe sy -> [st])        -- Transition function
  • An example for instance of Ndfa would make it much more clearer. For example we can realize the Ndfa in the given figure as -->

aorb

myNdfa :: Ndfa Int Char
myNdfa = Ndfa ['a','b'] [0,1,2,3,4,5] [0] [5] delta

delta :: Int -> Maybe Char -> Int
delta 0 Nothing  = [1,3]
delta 1 Just 'a' = [2]
delta 3 Just 'b' = [4]
delta 2 Nothing = [5]
delta 4 Nothing = [5]
delta _ _ = []

  • In the entire documentation no where it is stated that Nothing corresponds to an Epsilon rule in the documentation. Also it is not mentioned what the resulting list returned by the transition function should be like.
    Should it be an epsilon closure of final states reachable from the input state or it should just be the list of final states?

  • Another important thing is they have not specified for what the input [Char] is required. Intuitively it makes sense that it should be the file name but this is where it troubles the user, I mean the lack of documentation. Hackage just says to Print a Ndfa in GraphViz use :

ndfa2graphviz :: (Eq sy, Show a, Show sy, Ord a) => Ndfa a sy -> [Char] -> [Char]
  • Since I was to use just these two modules, I felt lack of documentation while using them. This is one of the best libraries to realize finite state automatas. But essentially the lack of documentation makes it quite troublesome to use. Please update the documentation. It would really be helpful!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant