retrie-2.0.0: retrie.cabal
-- Copyright (c) 2025 Andrew Farmer
-- Copyright (c) 2020-2024 Facebook, Inc. and its affiliates.
--
-- This source code is licensed under the MIT license found in the
-- LICENSE file in the root directory of this source tree.
--
name: retrie
version: 2.0.0
synopsis: A powerful, easy-to-use codemodding tool for Haskell.
homepage: https://github.com/xich/retrie
bug-reports: https://github.com/xich/retrie/issues
license: MIT
license-file: LICENSE
author: Andrew Farmer <andrew@andrewfarmer.name>
maintainer: Andrew Farmer <andrew@andrewfarmer.name>
copyright:
Copyright (c) 2025 Andrew Farmer
Copyright (c) 2020-2024 Facebook, Inc. and its affiliates.
category: Development
build-type: Simple
cabal-version: >=1.10
extra-source-files:
CHANGELOG.md
CONTRIBUTING.md
README.md
tests/inputs/*.custom
tests/inputs/*.test
tested-with: GHC ==9.6.7, GHC ==9.8.4, GHC ==9.12.4, GHC ==9.14.1
description:
Retrie is a tool for codemodding Haskell. Key goals include:
.
* Speed: Efficiently rewrite in large (>1 million line) codebases.
* Safety: Avoids large classes of codemod-related errors.
* Ease-of-use: Haskell syntax instead of regular expressions. No hand-rolled AST traversals.
.
This package provides a command-line tool (@retrie@) and a library
("Retrie") for making equational edits to Haskell code.
.
Please see the [README](#readme) for examples and usage.
library
exposed-modules:
Retrie,
Retrie.AlphaEnv,
Retrie.CPP,
Retrie.Context,
Retrie.Debug,
Retrie.Elaborate,
Retrie.ExactPrint,
Retrie.ExactPrint.Annotated,
Retrie.Expr,
Retrie.Fixity,
Retrie.FreeVars,
Retrie.GHC,
Retrie.GroundTerms,
Retrie.Monad,
Retrie.Options,
Retrie.PatternMap.Bag,
Retrie.PatternMap.Class,
Retrie.PatternMap.Instances,
Retrie.Pretty,
Retrie.Quantifiers,
Retrie.Query,
Retrie.Replace,
Retrie.Rewrites,
Retrie.Rewrites.Function,
Retrie.Rewrites.Patterns,
Retrie.Rewrites.Rules,
Retrie.Rewrites.Types,
Retrie.Run,
Retrie.Subst,
Retrie.Substitution,
Retrie.SYB,
Retrie.Types,
Retrie.Universe,
Retrie.Util
GHC-Options: -Wall
if flag(Werror)
GHC-Options: -Werror
if impl(ghc >= 9.10)
GHC-Options: -Wno-incomplete-record-selectors
build-depends:
ansi-terminal >= 0.10.3 && < 1.2,
async >= 2.2.2 && < 2.3,
base >= 4.11 && < 4.23,
bytestring >= 0.10.8 && < 0.13,
containers >= 0.5.11 && < 0.9,
data-default >= 0.7.1 && < 0.9,
directory >= 1.3.1 && < 1.4,
filepath >= 1.4.2 && < 1.6,
ghc >= 9.6 && < 9.9 || >= 9.12 && < 9.13 || >= 9.14 && < 9.15,
list-t >= 1.0.4 && < 1.1,
mtl >= 2.2.2 && < 2.4,
optparse-applicative >= 0.15.1 && < 0.19,
process >= 1.6.3 && < 1.7,
random-shuffle >= 0.0.4 && < 0.1,
syb >= 0.7.1 && < 0.8,
text >= 1.2.3 && < 2.2,
transformers >= 0.5.5 && < 0.7,
unordered-containers >= 0.2.10 && < 0.3
-- Each ghc-exactprint major series only builds against one GHC series.
if impl(ghc >= 9.14 && < 9.15)
build-depends: ghc-exactprint >= 1.14.2 && < 1.15
if impl(ghc >= 9.12 && < 9.13)
build-depends: ghc-exactprint >= 1.12.1 && < 1.13
if impl(ghc < 9.12)
build-depends: ghc-exactprint >= 1.7.1 && < 1.12
default-language: Haskell2010
Flag BuildExecutable
Description: build the retrie executable
Default: True
-- Off by default because Hackage rejects packages that build with -Werror
-- unconditionally. cabal.project turns it on for development and CI.
Flag Werror
Description: build with -Werror
Default: False
Manual: True
executable retrie
if flag(BuildExecutable)
Buildable: True
else
Buildable: False
main-is:
Main.hs
hs-source-dirs: bin hse
other-modules: Fixity
GHC-Options: -Wall -threaded
if flag(Werror)
GHC-Options: -Werror
build-depends:
retrie,
base >= 4.11 && < 4.23,
haskell-src-exts >= 1.23.0 && < 1.25,
ghc-paths
default-language: Haskell2010
executable demo-retrie
if flag(BuildExecutable)
Buildable: True
else
Buildable: False
main-is:
Main.hs
hs-source-dirs: demo hse
other-modules: Fixity
GHC-Options: -Wall -threaded
if flag(Werror)
GHC-Options: -Werror
build-depends:
retrie,
base >= 4.11 && < 4.23,
haskell-src-exts >= 1.23.0 && < 1.25,
ghc-paths
default-language: Haskell2010
test-suite test
type: exitcode-stdio-1.0
main-is: Main.hs
other-modules:
AllTests,
Annotated,
CPP,
Demo,
Dependent,
Exclude,
Fixity,
Golden,
GroundTerms,
Ignore,
ParseQualified,
Targets,
Util
hs-source-dirs: tests hse
default-language: Haskell2010
GHC-Options: -Wall
build-depends:
retrie,
HUnit,
base,
containers,
data-default,
deepseq,
directory,
exceptions,
filepath,
ghc,
ghc-exactprint,
ghc-paths,
haskell-src-exts,
mtl,
optparse-applicative,
process,
syb,
tasty,
temporary,
text,
unordered-containers
source-repository head
type: git
location: https://github.com/xich/retrie