cabal-version: 2.4 -- Initial package description 'context-free-art.cabal' generated by 'cabal -- init'. For further documentation, see -- http://haskell.org/cabal/users-guide/ name: context-free-art version: 0.3.0.1 synopsis: Generate art from context-free grammars description: . Create art via context free grammar production rules. . == Context free grammar primer . Context free grammars consist of a set of terminal symbols, a set of non-terminal symbols, and production rules that map non-terminals to other symbols. . With a context-free grammar, we can generate strings of terminals that conform to the specified language. . Our language will describe graphics. . ==How to use . >import Art.ContextFree.Definite >import Data.List.NonEmpty > >move = Mod [Move (0, -1.8), Scale 0.8] > >armN :: Int -> Symbol >armN 0 = move $ Circle 1 >armN n = move $ Branch $ > Circle 1 :| [Mod [Rotate 10] $ armN (n - 1)] > >arm :: Symbol >arm = armN 20 > >spiral = Branch $ > Circle 1 :| [arm, Mod [Rotate 120] arm, Mod [Rotate 240] arm] . The latter produces this graphic: . <> . ## Examples . The code for these can be found in the [exmaples/](https://github.com/414owen/context-free-art/tree/master/examples) folder . <> <> <> homepage: https://github.com/414owen/context-free-art -- bug-reports: license: BSD-3-Clause license-file: LICENSE author: Owen Shepherd maintainer: 414owen@gmail.com -- copyright: category: Graphics extra-source-files: CHANGELOG.md executable examples main-is: Main.hs hs-source-dirs: examples other-modules: Sierpinski.Triangle , Sierpinski.Carpet , Spiral , Circles build-depends: base >= 4.12 && < 5 , blaze-svg >= 0.3.6 , context-free-art , blaze-markup , text >= 1.2 , directory >= 1.3 ghc-options: -Wall -fwarn-incomplete-patterns default-language: Haskell2010 test-suite tests type: exitcode-stdio-1.0 main-is: Tests.hs other-modules: Art.ContextFree.Geometry , Art.ContextFree.Definite.Grammar , Art.ContextFree.Probabilistic.Grammar , Art.ContextFree.Definite.Render , Art.ContextFree.Modifier , Art.ContextFree.Probabilistic.Render , Art.ContextFree.Util build-depends: base >= 4.12 && < 5 , blaze-svg >= 0.3.6 , random >= 1.1 , blaze-markup , bifunctors >= 5.5 , text-show >= 3.8 , text >= 1.2 , HUnit >= 1.6 ghc-options: -Wall -fwarn-incomplete-patterns default-language: Haskell2010 library exposed-modules: Art.ContextFree.Definite , Art.ContextFree.Probabilistic other-modules: Art.ContextFree.Geometry , Art.ContextFree.Definite.Grammar , Art.ContextFree.Probabilistic.Grammar , Art.ContextFree.Definite.Render , Art.ContextFree.Modifier , Art.ContextFree.Probabilistic.Render , Art.ContextFree.Util build-depends: base >= 4.12 && < 5 , blaze-svg >= 0.3.6 , random >= 1.1 , blaze-markup , bifunctors >= 5.5 , text-show >= 3.8 , text >= 1.2 default-language: Haskell2010