acme-mutable-package (empty) → 0
raw patch · 4 files changed
+92/−0 lines, 4 filesdep +basebuild-type:Customsetup-changed
Dependencies added: base
Files
- AcmeMutablePackage.lhs +15/−0
- LICENSE.markdown +23/−0
- Setup.hs +12/−0
- acme-mutable-package.cabal +42/−0
+ AcmeMutablePackage.lhs view
@@ -0,0 +1,15 @@+> -- | This is a joke package. It is meant to show Haskell packages on +> -- Hackage can be mutated by revising them. This package uses a custom +> -- Cabal setup. It reads the package description, which is what you are +> -- reading now, and creates a file at build time from its contents. Since +> -- revisions are allowed to change descriptions, the package itself is +> -- mutable. I personally disagree with Hackage revisions, so I authored +> -- this package to show one way they can be abused. +> +> module AcmeMutablePackage ( mutable ) where +> +> -- | Are packages mutable? You might think they would be immutable, but you +> -- would be wrong. +> +> mutable :: Bool +> mutable = True
+ LICENSE.markdown view
@@ -0,0 +1,23 @@+# [The MIT License (MIT)][] + +Copyright (c) Taylor Fausak + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies +of the Software, and to permit persons to whom the Software is furnished to do +so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. + +[The MIT License (MIT)]: http://opensource.org/licenses/MIT
+ Setup.hs view
@@ -0,0 +1,12 @@+import Distribution.PackageDescription.Parse +import Distribution.Simple +import Distribution.Types.GenericPackageDescription +import Distribution.Types.PackageDescription + +main :: IO () +main = defaultMainWithHooks simpleUserHooks + { preBuild = \ args flags -> do + package <- readGenericPackageDescription minBound "acme-mutable-package.cabal" + writeFile "AcmeMutablePackage.lhs" (description (packageDescription package)) + preBuild simpleUserHooks args flags + }
+ acme-mutable-package.cabal view
@@ -0,0 +1,42 @@+name: acme-mutable-package +version: 0 + +build-type: Custom +cabal-version: >= 1.6 +category: ACME +license: MIT +license-file: LICENSE.markdown +maintainer: Taylor Fausak + +synopsis: A mutable package. +description: + > -- | This is a joke package. It is meant to show Haskell packages on + > -- Hackage can be mutated by revising them. This package uses a custom + > -- Cabal setup. It reads the package description, which is what you are + > -- reading now, and creates a file at build time from its contents. Since + > -- revisions are allowed to change descriptions, the package itself is + > -- mutable. I personally disagree with Hackage revisions, so I authored + > -- this package to show one way they can be abused. + > + > module AcmeMutablePackage ( mutable ) where + > + > -- | Are packages mutable? You might think they would be immutable, but you + > -- would be wrong. + > + > mutable :: Bool + > mutable = True + +source-repository head + type: git + location: https://github.com/tfausak/acme-mutable-package + +custom-setup + setup-depends: + base >= 4.10.1 && < 4.11, + Cabal >= 2.0.1 && < 2.1 + +library + build-depends: + base >= 4.10.1 && < 4.11 + exposed-modules: + AcmeMutablePackage