radium-formula-parser-0.2: Chemistry

Portabilityportable
Stabilityalpha
MaintainerKrzysztof Langner <klangner@gmail.com>
Safe HaskellSafe-Inferred

Radium.FormulaParser

Description

Formula parser. . Formula can be entered as H2O, 2H2O, SO4+2 (Sulfate) or (CH3)2CO (Acetone)

Synopsis

Documentation

data Molecule Source

Constructors

Ion Molecule Int 
Molecule [Molecule] Int 
Element String Int 

Instances

Eq Molecule 
Show Molecule 

parseFormula :: String -> MoleculeSource

Parse formula

 parseFormula "C2H4" `shouldBe` Molecule [(element 6, 2), (element 1, 4)]