A haskell library to solve the challange molecules to atoms on CodeWars.
To explore the library running commands on the GHCi interpreter, you should type:
$ ghci src/Molecules.hs
ghci> lexer "H2O" -- Parser the water formula
Right [Token {tokenType = Atom, tokenStr = "H"},Token {tokenType = Number 2, tokenStr = "2"},Token {tokenType = Atom, tokenStr = "O"}]
There are a suit of unit tests, to run them type:
cabal test
This command assumes that you have the haskell ecosystem installed on your machine.