I have a string that needs to be tokenized into a list with the following rules:

* The '(' and ')' brackets
* A number with a possible decimal point
* Operators (+, / , \*, >=, etc.)
* An identifier that starts with a letter and rest of the string can be letters or numbers

To do this I have created the above rules as finite state machines in Haskell code:

```
data FsaState = R | Q -- start state: Q; success state R;
  deriving Show

```

Input:

```
tokenize “( (23.5+age) ∗ (20.99+adres))”

```

Output:

```
[ “(”, “ ”, “(”, “23.5”, “+”, “age”, “)”, “ ”, “∗”, “ ”, “(”, “20.99”, “+”, “adres”, “)”, “)” ]

```

(maybe filter out the strings with only whitespace)

How should I begin? I am stuck in the imperative mindset as Haskell is not my main language.