Copyright | Copyright (C) 2014 Krzysztof Langner |
---|---|
License | BSD3 |
Maintainer | Krzysztof Langner <klangner@gmail.com> |
Stability | alpha |
Portability | portable |
Safe Haskell | Safe-Inferred |
Language | Haskell2010 |
Parser for condensed formula format (http:/en.wikipedia.orgwiki/Structural_formula#Condensed_formulas). . Formula can be entered as H2O, 2H2O, SO4+2 (Sulfate) or (CH3)2CO (Acetone)
Documentation
readCondensed :: String -> SymbolMolecule Source
Parse formula
parseFormula "C2H4" `shouldBe` Molecule [Element "C" 2, Element "H", 4)]
writeCondensed :: SymbolMolecule -> String Source
Write Molecule to string