Madlibs DSL for templating text (http://polemic.vmchale.com/madlang)

root / madlang.cabal

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
name:                madlang
version:             4.0.0.2
synopsis:            Randomized templating language DSL
description:         Madlang is a text templating language written in Haskell,
                     meant to explore computational creativity and generative
                     literature.
homepage:            https://hub.darcs.net/vmchale/madlang
license:             BSD3
license-file:        LICENSE
author:              Vanessa McHale
maintainer:          vanessa.mchale@reconfigure.io
copyright:           Copyright: (c) 2016-2017 Vanessa McHale
category:            Web
build-type:          Custom
stability:           experimental
extra-source-files:  README.md
                   , test/templates/*.mad
                   , test/templates/err/*.mad
                   , demo/*.mad
                   , cabal.project.local
                   , man/madlang.1
cabal-version:       >=1.10

custom-setup
  setup-depends:   base
                 , Cabal
                 , cli-setup >= 0.1.0.2

Flag profile {
  Description: Build for profiling
  Default: False
  Manual: True
}

Flag development {
  Description: Turn on '-Werror'
  Default: False
  Manual: True
}

Flag library {
  Description: Don't build an executable
  Default:     False
}

library
  hs-source-dirs:      src
  exposed-modules:     Text.Madlibs
  other-modules:       Text.Madlibs.Ana.ParseUtils
                     , Text.Madlibs.Cata.Run
                     , Text.Madlibs.Ana.Parse
                     , Text.Madlibs.Ana.Resolve
                     , Text.Madlibs.Internal.Types
                     , Text.Madlibs.Generate.TH
                     , Text.Madlibs.Internal.Utils
                     , Text.Madlibs.Cata.SemErr
                     , Text.Madlibs.Cata.Display
                     , Text.Madlibs.Exec.Main
                     , Text.Madlibs.Packaging.Fetch
                     , Paths_madlang
  build-depends:       base >= 4.9 && < 5
                     , megaparsec >= 6.0
                     , text
                     , optparse-applicative
                     , template-haskell
                     , MonadRandom
                     , composition-prelude >= 1.1.0.0
                     , directory
                     , file-embed
                     , random-shuffle
                     , mtl
                     , recursion-schemes-ext
                     , ansi-wl-pprint
                     , containers
                     , titlecase >= 1.0
                     , th-lift-instances
                     , http-client
                     , http-client-tls
                     , tar
                     , zlib
                     , zip-archive
                     , recursion-schemes
                     , binary
  default-language:    Haskell2010
  if flag(development)
    ghc-options:       -Werror
  if impl(ghc >= 8.0)
    ghc-options:       -Wincomplete-uni-patterns -Wincomplete-record-updates
  ghc-options:         -Wall

executable madlang
  if flag(library)
    Buildable: False
  else
    Buildable: True
  hs-source-dirs:      app
  main-is:             Main.hs
  if flag(profile)
    ghc-options:       -rtsopts -fprof-auto -prof
  if flag(development)
    ghc-options:       -Werror
  if impl(ghc >= 8.0)
    ghc-options:       -Wincomplete-uni-patterns -Wincomplete-record-updates
  ghc-options:         -Wall
  build-depends:       base
                     , madlang
  default-language:    Haskell2010

benchmark madlang-bench
  type:             exitcode-stdio-1.0
  hs-source-dirs:   bench
  main-is:          Bench.hs
  build-depends:    base
                  , criterion
                  , madlang
                  , megaparsec
                  , text
  if flag(development)
    ghc-options:    -Werror
  if impl(ghc >= 8.0)
    ghc-options:    -Wincomplete-uni-patterns -Wincomplete-record-updates
  default-language: Haskell2010

test-suite madlang-test
  type:                exitcode-stdio-1.0
  hs-source-dirs:      test
  main-is:             Spec.hs
  other-modules:       Demo
  build-depends:       base
                     , madlang
                     , hspec
                     , text
                     , hspec-megaparsec
  if flag(development)
    ghc-options:       -Werror
  if impl(ghc >= 8.0)
    ghc-options:       -Wincomplete-uni-patterns -Wincomplete-record-updates
  ghc-options:         -threaded -rtsopts -Wall -with-rtsopts=-N
  default-language:    Haskell2010

source-repository head
  type:     darcs
  location: https://hub.darcs.net/vmchale/madlang