~alcinnz/haskell-stylist

28191a35ce32d9a3433a98574035e478c8623bfb — Adrian Cochrane 5 years ago dd6765e
Update README.md
1 files changed, 0 insertions(+), 7 deletions(-)

M README.md
M README.md => README.md +0 -7
@@ 5,13 5,6 @@ Stylish Haskell implements CSS selection and cascade (but not inheritance) indep

For more interesting projects see: https://github.io/alcinnz/browser-engine-ganarchy/

## Why Haskell?
No matter what you think about Haskell and other functional languages, there are great reasons to choose it for this project.

The primary reason is that the biggest challenge in implementing a CSS engine is in defining all the various CSS properties, and as such it needs to be trivial to define each individual property. Haskell's pattern matching syntax is perfect for this, and it's laziness is useful.

Though beyond that Haskell makes just as trivial to assemble functions as it does datastructures, which comes in very handy for parsing and interpreting programming languages like CSS selectors.

## API
To parse a CSS stylesheet call `Data.CSS.Syntax.StyleSheet.parse` which returns a variant of the passed in `StyleSheet`. `StyleSheet` is a typeclass specifying methods for parsing at-rules (`parseAtRule`), storing parsed style rules (`addRule`), and optionally setting the stylesheet's priority (`setPriority`).