title: how to implement lexical analyser and parser in Haskell
body: <p>I got this piece of code here, it is a program written in an imperative programming language structured in Haskell, so the question is "how can I implement a lexer analyser and parser for this language", the program is defined to be a sequence of statements of which there are 6 types: ":=", "goto", "write", "stop", "if goto" and "int"</p>
  
  <ol>
  <li>int n=5</li>
  <li>write n</li>
  <li>int fac=1</li>
  <li>if0 n goto 8</li>
  <li>fac := fac * n</li>
  <li>n := n-1</li>
  <li>goto 4</li>
  <li>write fac</li>
  <li>stop</li>
  </ol>
  
  <p>I'm kinda lost here, I've read about lexers and parsers, but did not find any example how to implement them,I will appreciate if you could give me piece of code, so that I could try to do it myself, or at least links with useful info</p>