├── .devcontainer ├── Dockerfile └── devcontainer.json ├── .github └── workflows │ └── ci.yaml ├── .gitignore ├── .hlint.yaml ├── .vscode ├── extensions.json └── settings.json ├── ChangeLog.md ├── LICENSE ├── README.md ├── brittany-sample.gif ├── brittany.cabal ├── brittany.yaml ├── cabal.project ├── data ├── Test1.hs ├── Test10.hs ├── Test100.hs ├── Test101.hs ├── Test102.hs ├── Test103.hs ├── Test104.hs ├── Test105.hs ├── Test106.hs ├── Test107.hs ├── Test108.hs ├── Test109.hs ├── Test11.hs ├── Test110.hs ├── Test111.hs ├── Test112.hs ├── Test113.hs ├── Test114.hs ├── Test115.hs ├── Test116.hs ├── Test117.hs ├── Test118.hs ├── Test119.hs ├── Test12.hs ├── Test120.hs ├── Test121.hs ├── Test122.hs ├── Test123.hs ├── Test124.hs ├── Test125.hs ├── Test126.hs ├── Test127.hs ├── Test128.hs ├── Test129.hs ├── Test13.hs ├── Test130.hs ├── Test131.hs ├── Test132.hs ├── Test133.hs ├── Test134.hs ├── Test135.hs ├── Test136.hs ├── Test137.hs ├── Test138.hs ├── Test139.hs ├── Test14.hs ├── Test140.hs ├── Test141.hs ├── Test142.hs ├── Test143.hs ├── Test144.hs ├── Test145.hs ├── Test146.hs ├── Test147.hs ├── Test148.hs ├── Test149.hs ├── Test15.hs ├── Test150.hs ├── Test151.hs ├── Test152.hs ├── Test153.hs ├── Test154.hs ├── Test155.hs ├── Test156.hs ├── Test157.hs ├── Test158.hs ├── Test159.hs ├── Test16.hs ├── Test160.hs ├── Test161.hs ├── Test162.hs ├── Test163.hs ├── Test164.hs ├── Test165.hs ├── Test166.hs ├── Test167.hs ├── Test168.hs ├── Test169.hs ├── Test17.hs ├── Test170.hs ├── Test171.hs ├── Test172.hs ├── Test173.hs ├── Test174.hs ├── Test175.hs ├── Test176.hs ├── Test177.hs ├── Test178.hs ├── Test179.hs ├── Test18.hs ├── Test180.hs ├── Test181.hs ├── Test182.hs ├── Test183.hs ├── Test184.hs ├── Test185.hs ├── Test186.hs ├── Test187.hs ├── Test188.hs ├── Test189.hs ├── Test19.hs ├── Test190.hs ├── Test191.hs ├── Test192.hs ├── Test193.hs ├── Test194.hs ├── Test195.hs ├── Test196.hs ├── Test197.hs ├── Test198.hs ├── Test199.hs ├── Test2.hs ├── Test20.hs ├── Test200.hs ├── Test201.hs ├── Test202.hs ├── Test203.hs ├── Test204.hs ├── Test205.hs ├── Test206.hs ├── Test207.hs ├── Test208.hs ├── Test209.hs ├── Test21.hs ├── Test210.hs ├── Test211.hs ├── Test212.hs ├── Test213.hs ├── Test214.hs ├── Test215.hs ├── Test216.hs ├── Test217.hs ├── Test218.hs ├── Test219.hs ├── Test22.hs ├── Test220.hs ├── Test221.hs ├── Test222.hs ├── Test223.hs ├── Test224.hs ├── Test225.hs ├── Test226.hs ├── Test227.hs ├── Test228.hs ├── Test229.hs ├── Test23.hs ├── Test230.hs ├── Test231.hs ├── Test232.hs ├── Test233.hs ├── Test234.hs ├── Test235.hs ├── Test236.hs ├── Test237.hs ├── Test238.hs ├── Test239.hs ├── Test24.hs ├── Test240.hs ├── Test241.hs ├── Test242.hs ├── Test243.hs ├── Test244.hs ├── Test245.hs ├── Test246.hs ├── Test247.hs ├── Test248.hs ├── Test249.hs ├── Test25.hs ├── Test250.hs ├── Test251.hs ├── Test252.hs ├── Test253.hs ├── Test254.hs ├── Test255.hs ├── Test256.hs ├── Test257.hs ├── Test258.hs ├── Test259.hs ├── Test26.hs ├── Test260.hs ├── Test261.hs ├── Test262.hs ├── Test263.hs ├── Test264.hs ├── Test265.hs ├── Test266.hs ├── Test267.hs ├── Test268.hs ├── Test269.hs ├── Test27.hs ├── Test270.hs ├── Test271.hs ├── Test272.hs ├── Test273.hs ├── Test274.hs ├── Test275.hs ├── Test276.hs ├── Test277.hs ├── Test278.hs ├── Test279.hs ├── Test28.hs ├── Test280.hs ├── Test281.hs ├── Test282.hs ├── Test283.hs ├── Test284.hs ├── Test285.hs ├── Test286.hs ├── Test287.hs ├── Test288.hs ├── Test289.hs ├── Test29.hs ├── Test290.hs ├── Test291.hs ├── Test292.hs ├── Test293.hs ├── Test294.hs ├── Test295.hs ├── Test296.hs ├── Test297.hs ├── Test298.hs ├── Test299.hs ├── Test3.hs ├── Test30.hs ├── Test300.hs ├── Test301.hs ├── Test302.hs ├── Test303.hs ├── Test304.hs ├── Test305.hs ├── Test306.hs ├── Test307.hs ├── Test308.hs ├── Test309.hs ├── Test31.hs ├── Test310.hs ├── Test311.hs ├── Test312.hs ├── Test313.hs ├── Test314.hs ├── Test315.hs ├── Test316.hs ├── Test317.hs ├── Test318.hs ├── Test319.hs ├── Test32.hs ├── Test320.hs ├── Test321.hs ├── Test322.hs ├── Test323.hs ├── Test324.hs ├── Test325.hs ├── Test326.hs ├── Test327.hs ├── Test328.hs ├── Test329.hs ├── Test33.hs ├── Test330.hs ├── Test331.hs ├── Test332.hs ├── Test333.hs ├── Test334.hs ├── Test335.hs ├── Test336.hs ├── Test337.hs ├── Test338.hs ├── Test339.hs ├── Test34.hs ├── Test340.hs ├── Test341.hs ├── Test342.hs ├── Test343.hs ├── Test344.hs ├── Test345.hs ├── Test346.hs ├── Test347.hs ├── Test348.hs ├── Test349.hs ├── Test35.hs ├── Test350.hs ├── Test351.hs ├── Test352.hs ├── Test353.hs ├── Test354.hs ├── Test355.hs ├── Test356.hs ├── Test357.hs ├── Test358.hs ├── Test359.hs ├── Test36.hs ├── Test360.hs ├── Test361.hs ├── Test362.hs ├── Test363.hs ├── Test364.hs ├── Test365.hs ├── Test366.hs ├── Test367.hs ├── Test368.hs ├── Test369.hs ├── Test37.hs ├── Test370.hs ├── Test371.hs ├── Test372.hs ├── Test373.hs ├── Test374.hs ├── Test375.hs ├── Test376.hs ├── Test377.hs ├── Test378.hs ├── Test379.hs ├── Test38.hs ├── Test380.hs ├── Test381.hs ├── Test382.hs ├── Test383.hs ├── Test384.hs ├── Test385.hs ├── Test386.hs ├── Test387.hs ├── Test388.hs ├── Test389.hs ├── Test39.hs ├── Test390.hs ├── Test391.hs ├── Test392.hs ├── Test393.hs ├── Test394.hs ├── Test395.hs ├── Test396.hs ├── Test397.hs ├── Test398.hs ├── Test399.hs ├── Test4.hs ├── Test40.hs ├── Test400.hs ├── Test401.hs ├── Test402.hs ├── Test403.hs ├── Test404.hs ├── Test405.hs ├── Test406.hs ├── Test407.hs ├── Test408.hs ├── Test409.hs ├── Test41.hs ├── Test410.hs ├── Test411.hs ├── Test412.hs ├── Test413.hs ├── Test414.hs ├── Test415.hs ├── Test416.hs ├── Test417.hs ├── Test418.hs ├── Test419.hs ├── Test42.hs ├── Test420.hs ├── Test421.hs ├── Test422.hs ├── Test423.hs ├── Test424.hs ├── Test425.hs ├── Test426.hs ├── Test427.hs ├── Test428.hs ├── Test429.hs ├── Test43.hs ├── Test430.hs ├── Test431.hs ├── Test432.hs ├── Test433.hs ├── Test434.hs ├── Test435.hs ├── Test436.hs ├── Test437.hs ├── Test438.hs ├── Test439.hs ├── Test44.hs ├── Test440.hs ├── Test441.hs ├── Test442.hs ├── Test443.hs ├── Test444.hs ├── Test445.hs ├── Test446.hs ├── Test447.hs ├── Test448.hs ├── Test449.hs ├── Test45.hs ├── Test450.hs ├── Test451.hs ├── Test452.hs ├── Test453.hs ├── Test454.hs ├── Test455.hs ├── Test456.hs ├── Test457.hs ├── Test458.hs ├── Test459.hs ├── Test46.hs ├── Test460.hs ├── Test461.hs ├── Test462.hs ├── Test463.hs ├── Test464.hs ├── Test465.hs ├── Test466.hs ├── Test467.hs ├── Test468.hs ├── Test469.hs ├── Test47.hs ├── Test470.hs ├── Test471.hs ├── Test472.hs ├── Test473.hs ├── Test474.hs ├── Test475.hs ├── Test476.hs ├── Test477.hs ├── Test478.hs ├── Test479.hs ├── Test48.hs ├── Test480.hs ├── Test481.hs ├── Test482.hs ├── Test483.hs ├── Test484.hs ├── Test485.hs ├── Test486.hs ├── Test487.hs ├── Test488.hs ├── Test489.hs ├── Test49.hs ├── Test490.hs ├── Test491.hs ├── Test492.hs ├── Test493.hs ├── Test494.hs ├── Test495.hs ├── Test496.hs ├── Test497.hs ├── Test498.hs ├── Test499.hs ├── Test5.hs ├── Test50.hs ├── Test500.hs ├── Test501.hs ├── Test502.hs ├── Test503.hs ├── Test504.hs ├── Test505.hs ├── Test506.hs ├── Test507.hs ├── Test508.hs ├── Test509.hs ├── Test51.hs ├── Test510.hs ├── Test511.hs ├── Test512.hs ├── Test513.hs ├── Test514.hs ├── Test515.hs ├── Test516.hs ├── Test517.hs ├── Test518.hs ├── Test519.hs ├── Test52.hs ├── Test520.hs ├── Test521.hs ├── Test522.hs ├── Test523.hs ├── Test524.hs ├── Test525.hs ├── Test526.hs ├── Test527.hs ├── Test528.hs ├── Test529.hs ├── Test53.hs ├── Test530.hs ├── Test531.hs ├── Test532.hs ├── Test533.hs ├── Test534.hs ├── Test535.hs ├── Test536.hs ├── Test537.hs ├── Test538.hs ├── Test539.hs ├── Test54.hs ├── Test540.hs ├── Test55.hs ├── Test56.hs ├── Test57.hs ├── Test58.hs ├── Test59.hs ├── Test6.hs ├── Test60.hs ├── Test61.hs ├── Test62.hs ├── Test63.hs ├── Test64.hs ├── Test65.hs ├── Test66.hs ├── Test67.hs ├── Test68.hs ├── Test69.hs ├── Test7.hs ├── Test70.hs ├── Test71.hs ├── Test72.hs ├── Test73.hs ├── Test74.hs ├── Test75.hs ├── Test76.hs ├── Test77.hs ├── Test78.hs ├── Test79.hs ├── Test8.hs ├── Test80.hs ├── Test81.hs ├── Test82.hs ├── Test83.hs ├── Test84.hs ├── Test85.hs ├── Test86.hs ├── Test87.hs ├── Test88.hs ├── Test89.hs ├── Test9.hs ├── Test90.hs ├── Test91.hs ├── Test92.hs ├── Test93.hs ├── Test94.hs ├── Test95.hs ├── Test96.hs ├── Test97.hs ├── Test98.hs ├── Test99.hs └── brittany.yaml ├── doc-svg-gen ├── Main.hs ├── Setup.hs ├── doc-svg-gen.cabal └── generated │ ├── .gitignore │ ├── bridocgen.svg │ ├── periphery.svg │ └── ppm.svg ├── doc ├── hcar │ └── Brittany.tex ├── implementation │ ├── bridoc-api.md │ ├── bridoc-design.md │ ├── dataflow.md │ ├── exactprinting.md │ ├── index.md │ ├── output-example-01.md │ ├── output-example-02.md │ ├── output-example-03.md │ └── theory.md └── showcases │ ├── BrittanyComparison.md │ ├── Layout_Alignment.md │ ├── Layout_Interactions.md │ ├── Layout_Types.md │ ├── Module.md │ └── Parser.md ├── output └── .gitignore └── source ├── executable └── Main.hs ├── library └── Language │ └── Haskell │ ├── Brittany.hs │ └── Brittany │ ├── Internal.hs │ ├── Internal │ ├── Backend.hs │ ├── BackendUtils.hs │ ├── Config.hs │ ├── Config │ │ ├── Types.hs │ │ └── Types │ │ │ └── Instances.hs │ ├── ExactPrintUtils.hs │ ├── LayouterBasics.hs │ ├── Layouters │ │ ├── DataDecl.hs │ │ ├── Decl.hs │ │ ├── Expr.hs │ │ ├── Expr.hs-boot │ │ ├── IE.hs │ │ ├── Import.hs │ │ ├── Module.hs │ │ ├── Pattern.hs │ │ ├── Stmt.hs │ │ ├── Stmt.hs-boot │ │ └── Type.hs │ ├── Obfuscation.hs │ ├── ParseModule.hs │ ├── Prelude.hs │ ├── PreludeUtils.hs │ ├── Transformations │ │ ├── Alt.hs │ │ ├── Columns.hs │ │ ├── Floating.hs │ │ ├── Indent.hs │ │ └── Par.hs │ ├── Types.hs │ └── Utils.hs │ └── Main.hs └── test-suite └── Main.hs /.devcontainer/Dockerfile: -------------------------------------------------------------------------------- 1 | ARG UBUNTU_TAG=20.04 2 | FROM ubuntu:"$UBUNTU_TAG" 3 | 4 | ENV LANG=C.UTF-8 5 | RUN \ 6 | apt-get update && \ 7 | apt-get install --assume-yes curl gcc git libgmp-dev libtinfo-dev make sudo 8 | 9 | ARG GHCUP_VERSION=0.1.17.4 10 | RUN \ 11 | curl --output /usr/local/bin/ghcup "https://downloads.haskell.org/~ghcup/$GHCUP_VERSION/x86_64-linux-ghcup-$GHCUP_VERSION" && \ 12 | chmod +x /usr/local/bin/ghcup && \ 13 | ghcup --version 14 | 15 | ARG USER_NAME=haskell 16 | RUN \ 17 | useradd --create-home --shell "$( which bash )" "$USER_NAME" && \ 18 | echo "$USER_NAME ALL=(ALL) NOPASSWD: ALL" | tee "/etc/sudoers.d/$USER_NAME" 19 | USER "$USER_NAME" 20 | ENV PATH="/home/$USER_NAME/.cabal/bin:/home/$USER_NAME/.ghcup/bin:$PATH" 21 | 22 | ARG GHC_VERSION=9.0.1 23 | RUN \ 24 | ghcup install ghc "$GHC_VERSION" --set && \ 25 | ghc --version 26 | 27 | ARG CABAL_VERSION=3.6.2.0 28 | RUN \ 29 | ghcup install cabal "$CABAL_VERSION" --set && \ 30 | cabal --version 31 | -------------------------------------------------------------------------------- /.devcontainer/devcontainer.json: -------------------------------------------------------------------------------- 1 | { 2 | "build": { 3 | "dockerfile": "Dockerfile" 4 | }, 5 | "postCreateCommand": "cabal update" 6 | } 7 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | *.prof 2 | *.aux 3 | *.eventlog 4 | *.hp 5 | *.ps 6 | /*.pdf 7 | dist/ 8 | dist-newstyle/ 9 | local/ 10 | .cabal-sandbox/ 11 | cabal.sandbox.config 12 | cabal.project.local* 13 | cabal.project.freeze 14 | .ghc.environment.* 15 | result 16 | -------------------------------------------------------------------------------- /.hlint.yaml: -------------------------------------------------------------------------------- 1 | # HLint configuration file 2 | # https://github.com/ndmitchell/hlint 3 | ########################## 4 | 5 | # This file contains a template configuration file, which is typically 6 | # placed as .hlint.yaml in the root of your project 7 | 8 | - ignore: { name: 'Use :' } 9 | - ignore: { name: Eta reduce } 10 | - ignore: { name: Move brackets to avoid $ } 11 | - ignore: { name: Redundant $ } 12 | - ignore: { name: Redundant bracket } 13 | - ignore: { name: Use newtype instead of data } 14 | - ignore: {name: "Redundant do"} 15 | - ignore: {name: "Redundant return"} 16 | - ignore: {name: "Use camelCase"} 17 | -------------------------------------------------------------------------------- /.vscode/extensions.json: -------------------------------------------------------------------------------- 1 | { 2 | "recommendations": [ 3 | "taylorfausak.purple-yolk" 4 | ] 5 | } 6 | -------------------------------------------------------------------------------- /.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "purple-yolk.brittany.command": "cabal exec -- brittany --write-mode inplace", 3 | "purple-yolk.ghci.command": "cabal repl --repl-options -ddump-json", 4 | "purple-yolk.hlint.command": "false", 5 | "purple-yolk.hlint.onSave": false 6 | } 7 | -------------------------------------------------------------------------------- /brittany-sample.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lspitzner/brittany/e03ab8425bbc5a3171808cee3285480f64d21536/brittany-sample.gif -------------------------------------------------------------------------------- /brittany.yaml: -------------------------------------------------------------------------------- 1 | conf_layout: 2 | lconfig_columnAlignMode: 3 | tag: ColumnAlignModeDisabled 4 | lconfig_indentPolicy: IndentPolicyLeft 5 | -------------------------------------------------------------------------------- /cabal.project: -------------------------------------------------------------------------------- 1 | packages: . 2 | 3 | allow-newer: 4 | -- https://github.com/lspitzner/butcher/issues/7 5 | , butcher:base 6 | -- https://github.com/lspitzner/data-tree-print/pull/2 7 | , data-tree-print:base 8 | -- https://github.com/lspitzner/multistate/pull/8 9 | , multistate:base 10 | -------------------------------------------------------------------------------- /data/Test1.hs: -------------------------------------------------------------------------------- 1 | func :: a -> a 2 | -------------------------------------------------------------------------------- /data/Test10.hs: -------------------------------------------------------------------------------- 1 | func 2 | :: lkasdlkjalsdjlakjsdlkjasldkjalskdjlkajsd 3 | -> (lakjsdlkjasldkj -> lakjsdlkjasldkj) 4 | -------------------------------------------------------------------------------- /data/Test100.hs: -------------------------------------------------------------------------------- 1 | func = klajsdas klajsdas klajsdas 2 | -------------------------------------------------------------------------------- /data/Test101.hs: -------------------------------------------------------------------------------- 1 | func = lakjsdlajsdljasdlkjasldjasldjasldjalsdjlaskjd 2 | lakjsdlajsdljasdlkjasldjasldjasldjalsdjlaskjd 3 | lakjsdlajsdljasdlkjasldjasldjasldjalsdjlaskjd 4 | -------------------------------------------------------------------------------- /data/Test102.hs: -------------------------------------------------------------------------------- 1 | func = lakjsdlajsdljasdlkjasldjasldjasldjalsdjlaskjd lakjsdlajsdljas 2 | lakjsdlajsdljas 3 | lakjsdlajsdljas 4 | -------------------------------------------------------------------------------- /data/Test103.hs: -------------------------------------------------------------------------------- 1 | func = (1 +) 2 | -------------------------------------------------------------------------------- /data/Test104.hs: -------------------------------------------------------------------------------- 1 | func = (+ 1) 2 | -------------------------------------------------------------------------------- /data/Test105.hs: -------------------------------------------------------------------------------- 1 | func = (1 `abc`) 2 | -------------------------------------------------------------------------------- /data/Test106.hs: -------------------------------------------------------------------------------- 1 | func = (`abc` 1) 2 | -------------------------------------------------------------------------------- /data/Test107.hs: -------------------------------------------------------------------------------- 1 | func = (abc, def) 2 | -------------------------------------------------------------------------------- /data/Test108.hs: -------------------------------------------------------------------------------- 1 | func = (abc, ) 2 | -------------------------------------------------------------------------------- /data/Test109.hs: -------------------------------------------------------------------------------- 1 | func = (, abc) 2 | -------------------------------------------------------------------------------- /data/Test11.hs: -------------------------------------------------------------------------------- 1 | func 2 | :: (lkasdlkjalsdjlakjsdlkjasldkjalskdjlkajsd -> lakjsdlkjasldkj) 3 | -> lakjsdlkjasldkj 4 | -------------------------------------------------------------------------------- /data/Test110.hs: -------------------------------------------------------------------------------- 1 | myTupleSection = 2 | ( verylaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaargefirstelement 3 | , 4 | , verylaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaargethirdelement 5 | , 6 | ) 7 | -------------------------------------------------------------------------------- /data/Test111.hs: -------------------------------------------------------------------------------- 1 | func = 2 | ( lakjsdlajsdljasdlkjasldjasldjasldjalsdjlaskjd 3 | , lakjsdlajsdljasdlkjasldjasldjasldjalsdjlaskjd 4 | ) 5 | -------------------------------------------------------------------------------- /data/Test112.hs: -------------------------------------------------------------------------------- 1 | foo = if True 2 | then 3 | -- iiiiii 4 | "a " 5 | else 6 | "b " 7 | -------------------------------------------------------------------------------- /data/Test113.hs: -------------------------------------------------------------------------------- 1 | func = if cond 2 | then pure 42 3 | else do 4 | -- test 5 | abc 6 | -------------------------------------------------------------------------------- /data/Test114.hs: -------------------------------------------------------------------------------- 1 | func = case x of 2 | False -> False 3 | True -> True 4 | -------------------------------------------------------------------------------- /data/Test115.hs: -------------------------------------------------------------------------------- 1 | func = 2 | case 3 | lakjsdlajsdljasdlkjasldjasldjasldjalsdjlaskjd 4 | lakjsdlajsdljasdlkjasldjasldjasldjalsdjlaskjd 5 | of 6 | False -> False 7 | True -> True 8 | -------------------------------------------------------------------------------- /data/Test116.hs: -------------------------------------------------------------------------------- 1 | func = do 2 | case 3 | lakjsdlajsdljasdlkjasldjasldjasldjalsdjlaskjd 4 | lakjsdlajsdljasdlkjasldjasldjasldjalsdjlaskjd 5 | of 6 | False -> False 7 | True -> True 8 | -------------------------------------------------------------------------------- /data/Test117.hs: -------------------------------------------------------------------------------- 1 | func = case x of {} 2 | -------------------------------------------------------------------------------- /data/Test118.hs: -------------------------------------------------------------------------------- 1 | func = 2 | case 3 | lakjsdlajsdljasdlkjasldjasldjasldjalsdjlaskjd 4 | lakjsdlajsdljasdlkjasldjasldjasldjalsdjlaskjd 5 | of {} 6 | -------------------------------------------------------------------------------- /data/Test119.hs: -------------------------------------------------------------------------------- 1 | func = do 2 | case 3 | lakjsdlajsdljasdlkjasldjasldjasldjalsdjlaskjd 4 | lakjsdlajsdljasdlkjasldjasldjasldjalsdjlaskjd 5 | of {} 6 | -------------------------------------------------------------------------------- /data/Test12.hs: -------------------------------------------------------------------------------- 1 | func 2 | :: ( lkasdlkjalsdjlakjsdlkjasldkjalskdjlkajsd 3 | -> lkasdlkjalsdjlakjsdlkjasldkjalskdjlkajsd 4 | ) 5 | -> lakjsdlkjasldkj 6 | -------------------------------------------------------------------------------- /data/Test120.hs: -------------------------------------------------------------------------------- 1 | func = do 2 | stmt 3 | stmt 4 | -------------------------------------------------------------------------------- /data/Test121.hs: -------------------------------------------------------------------------------- 1 | func = do 2 | x <- stmt 3 | stmt x 4 | -------------------------------------------------------------------------------- /data/Test122.hs: -------------------------------------------------------------------------------- 1 | func = do 2 | let x = 13 3 | stmt x 4 | -------------------------------------------------------------------------------- /data/Test123.hs: -------------------------------------------------------------------------------- 1 | func = 2 | foooooo 3 | $ [ case 4 | foooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo 5 | of 6 | _ -> True 7 | ] 8 | -------------------------------------------------------------------------------- /data/Test124.hs: -------------------------------------------------------------------------------- 1 | testMethod foo bar baz qux = 2 | let x = undefined foo bar baz qux qux baz bar :: String 3 | -- some comment explaining the in expression 4 | in undefined foo x :: String 5 | -------------------------------------------------------------------------------- /data/Test125.hs: -------------------------------------------------------------------------------- 1 | testMethod foo bar baz qux = 2 | let x = undefined :: String 3 | -- some comment explaining the in expression 4 | in undefined :: String 5 | -------------------------------------------------------------------------------- /data/Test126.hs: -------------------------------------------------------------------------------- 1 | testMethod foo bar baz qux = 2 | -- some comment explaining the in expression 3 | let x = undefined :: String in undefined :: String 4 | -------------------------------------------------------------------------------- /data/Test127.hs: -------------------------------------------------------------------------------- 1 | foo foo bar baz qux = 2 | let a = 1 3 | b = 2 4 | c = 3 5 | -- some comment explaining the in expression 6 | in undefined :: String 7 | -------------------------------------------------------------------------------- /data/Test128.hs: -------------------------------------------------------------------------------- 1 | func = 2 | foo 3 | $ [ aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa 4 | , bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb 5 | ] 6 | ++ [ccccccccccccccccccccccccccccccccccccccccccccccccccccccccc] 7 | -------------------------------------------------------------------------------- /data/Test129.hs: -------------------------------------------------------------------------------- 1 | module Main where 2 | -------------------------------------------------------------------------------- /data/Test13.hs: -------------------------------------------------------------------------------- 1 | func 2 | :: ( ( lkasdlkjalsdjlakjsdlkjasldkjalskdjlkajsd 3 | -> lkasdlkjalsdjlakjsdlkjasldkjalskdjlkajsd 4 | ) 5 | ) 6 | -------------------------------------------------------------------------------- /data/Test130.hs: -------------------------------------------------------------------------------- 1 | module Main () where 2 | -------------------------------------------------------------------------------- /data/Test131.hs: -------------------------------------------------------------------------------- 1 | module Main (main) where 2 | -------------------------------------------------------------------------------- /data/Test132.hs: -------------------------------------------------------------------------------- 1 | module Main (main, test1, test2) where 2 | -------------------------------------------------------------------------------- /data/Test133.hs: -------------------------------------------------------------------------------- 1 | module Main 2 | ( main 3 | , test1 4 | , test2 5 | , test3 6 | , test4 7 | , test5 8 | , test6 9 | , test7 10 | , test8 11 | , test9 12 | ) where 13 | -------------------------------------------------------------------------------- /data/Test134.hs: -------------------------------------------------------------------------------- 1 | module Main 2 | ( main 3 | -- main 4 | , test1 5 | , test2 6 | -- Test 3 7 | , test3 8 | , test4 9 | -- Test 5 10 | , test5 11 | -- Test 6 12 | ) where 13 | -------------------------------------------------------------------------------- /data/Test135.hs: -------------------------------------------------------------------------------- 1 | module Main (Test(..)) where 2 | -------------------------------------------------------------------------------- /data/Test136.hs: -------------------------------------------------------------------------------- 1 | module Main (module Main) where 2 | -------------------------------------------------------------------------------- /data/Test137.hs: -------------------------------------------------------------------------------- 1 | module Main (Test(Test, a, b)) where 2 | -------------------------------------------------------------------------------- /data/Test138.hs: -------------------------------------------------------------------------------- 1 | -- comment1 2 | module Main 3 | ( Test(Test, a, b) 4 | , foo -- comment2 5 | ) -- comment3 6 | where 7 | -------------------------------------------------------------------------------- /data/Test139.hs: -------------------------------------------------------------------------------- 1 | module Main (Test()) where 2 | -------------------------------------------------------------------------------- /data/Test14.hs: -------------------------------------------------------------------------------- 1 | func :: asd -> Either a b 2 | -------------------------------------------------------------------------------- /data/Test140.hs: -------------------------------------------------------------------------------- 1 | -- Intentionally left empty 2 | -------------------------------------------------------------------------------- /data/Test141.hs: -------------------------------------------------------------------------------- 1 | import Data.List 2 | -------------------------------------------------------------------------------- /data/Test142.hs: -------------------------------------------------------------------------------- 1 | import Data.List as L 2 | -------------------------------------------------------------------------------- /data/Test143.hs: -------------------------------------------------------------------------------- 1 | import qualified Data.List 2 | -------------------------------------------------------------------------------- /data/Test144.hs: -------------------------------------------------------------------------------- 1 | import qualified Data.List as L 2 | -------------------------------------------------------------------------------- /data/Test145.hs: -------------------------------------------------------------------------------- 1 | import safe Data.List as L 2 | -------------------------------------------------------------------------------- /data/Test146.hs: -------------------------------------------------------------------------------- 1 | import {-# SOURCE #-} Data.List ( ) 2 | -------------------------------------------------------------------------------- /data/Test147.hs: -------------------------------------------------------------------------------- 1 | import safe qualified Data.List 2 | -------------------------------------------------------------------------------- /data/Test148.hs: -------------------------------------------------------------------------------- 1 | import {-# SOURCE #-} safe qualified Data.List 2 | -------------------------------------------------------------------------------- /data/Test149.hs: -------------------------------------------------------------------------------- 1 | import qualified "base" Data.List 2 | -------------------------------------------------------------------------------- /data/Test15.hs: -------------------------------------------------------------------------------- 1 | func 2 | :: asd 3 | -> Either 4 | lkasdlkjalsdjlakjsdlkjasldkjalskdjlkajsd 5 | lkasdlkjalsdjlakjsdlkjasldkjalskdjlkajsd 6 | -------------------------------------------------------------------------------- /data/Test150.hs: -------------------------------------------------------------------------------- 1 | import {-# SOURCE #-} safe qualified "base" Data.List as L 2 | import {-# SOURCE #-} safe qualified "base" Data.List ( ) 3 | import {-# SOURCE #-} safe qualified Data.List hiding ( ) 4 | -------------------------------------------------------------------------------- /data/Test151.hs: -------------------------------------------------------------------------------- 1 | import qualified Data.List ( ) 2 | -------------------------------------------------------------------------------- /data/Test152.hs: -------------------------------------------------------------------------------- 1 | import Data.List ( nub ) 2 | -------------------------------------------------------------------------------- /data/Test153.hs: -------------------------------------------------------------------------------- 1 | import Data.List ( foldl' 2 | , indexElem 3 | , nub 4 | ) 5 | -------------------------------------------------------------------------------- /data/Test154.hs: -------------------------------------------------------------------------------- 1 | import Test ( Long 2 | , anymore 3 | , fit 4 | , items 5 | , line 6 | , list 7 | , not 8 | , onA 9 | , quite 10 | , single 11 | , that 12 | , will 13 | , with 14 | ) 15 | -------------------------------------------------------------------------------- /data/Test155.hs: -------------------------------------------------------------------------------- 1 | import Test ( (+) 2 | , (:!)(..) 3 | , (:*)((:.), T7, t7) 4 | , (:.) 5 | , T 6 | , T2() 7 | , T3(..) 8 | , T4(T4) 9 | , T5(T5, t5) 10 | , T6((<|>)) 11 | ) 12 | -------------------------------------------------------------------------------- /data/Test156.hs: -------------------------------------------------------------------------------- 1 | import Test hiding ( ) 2 | import Test as T 3 | hiding ( ) 4 | -------------------------------------------------------------------------------- /data/Test157.hs: -------------------------------------------------------------------------------- 1 | import Prelude as X 2 | hiding ( head 3 | , init 4 | , last 5 | , maximum 6 | , minimum 7 | , pred 8 | , read 9 | , readFile 10 | , succ 11 | , tail 12 | , undefined 13 | ) 14 | -------------------------------------------------------------------------------- /data/Test158.hs: -------------------------------------------------------------------------------- 1 | import TestJustAbitToLongModuleNameLikeThisOneIs 2 | ( ) 3 | import TestJustShortEnoughModuleNameLikeThisOne ( ) 4 | -------------------------------------------------------------------------------- /data/Test159.hs: -------------------------------------------------------------------------------- 1 | import TestJustAbitToLongModuleNameLikeThisOneI 2 | as T 3 | import TestJustShortEnoughModuleNameLikeThisOn as T 4 | -------------------------------------------------------------------------------- /data/Test16.hs: -------------------------------------------------------------------------------- 1 | func 2 | :: asd 3 | -> Trither 4 | lkasdlkjalsdjlakjsdlkjasldkjalskdjlkajsd 5 | lkasdlkjalsdjlakjsdlkjasldkjalskdjlkajsd 6 | lkasdlkjalsdjlakjsdlkjasldkjalskdjlkajsd 7 | -------------------------------------------------------------------------------- /data/Test160.hs: -------------------------------------------------------------------------------- 1 | import TestJustAbitToLongModuleNameLikeTh 2 | hiding ( ) 3 | import TestJustShortEnoughModuleNameLike hiding ( ) 4 | -------------------------------------------------------------------------------- /data/Test161.hs: -------------------------------------------------------------------------------- 1 | import MoreThanSufficientlyLongModuleNameWithSome 2 | ( compact 3 | , fit 4 | , inA 5 | , items 6 | , layout 7 | , not 8 | , that 9 | , will 10 | ) 11 | -------------------------------------------------------------------------------- /data/Test162.hs: -------------------------------------------------------------------------------- 1 | import TestJustAbitToLongModuleNameLikeTh 2 | hiding ( abc 3 | , def 4 | , ghci 5 | , jklm 6 | ) 7 | import TestJustShortEnoughModuleNameLike hiding ( abc 8 | , def 9 | , ghci 10 | , jklm 11 | ) 12 | -------------------------------------------------------------------------------- /data/Test163.hs: -------------------------------------------------------------------------------- 1 | import {-# SOURCE #-} safe qualified "qualifier" A hiding ( ) 2 | import {-# SOURCE #-} safe qualified "qualifiers" A 3 | hiding ( ) 4 | import {-# SOURCE #-} safe qualified "qualifiers" AlsoAf as T 5 | import {-# SOURCE #-} safe qualified "qualifiers" AlsoAff ( ) 6 | import {-# SOURCE #-} safe qualified "qualifiers" AlsoAff 7 | as T 8 | import {-# SOURCE #-} safe qualified "qualifiers" AlsoAffe 9 | ( ) 10 | -------------------------------------------------------------------------------- /data/Test164.hs: -------------------------------------------------------------------------------- 1 | -- Test 2 | import Data.List ( nub ) -- Test 3 | {- Test -} 4 | import qualified Data.List as L 5 | ( foldl' ) {- Test -} 6 | -- Test 7 | import Test ( test ) 8 | -------------------------------------------------------------------------------- /data/Test165.hs: -------------------------------------------------------------------------------- 1 | import Test ( abc 2 | , def 3 | -- comment 4 | ) 5 | -------------------------------------------------------------------------------- /data/Test166.hs: -------------------------------------------------------------------------------- 1 | import Test ( abc 2 | -- comment 3 | ) 4 | -------------------------------------------------------------------------------- /data/Test167.hs: -------------------------------------------------------------------------------- 1 | import Test ( abc 2 | -- comment 3 | , def 4 | , ghi 5 | {- comment -} 6 | , jkl 7 | -- comment 8 | ) 9 | -------------------------------------------------------------------------------- /data/Test168.hs: -------------------------------------------------------------------------------- 1 | import Test ( -- comment 2 | ) 3 | -------------------------------------------------------------------------------- /data/Test169.hs: -------------------------------------------------------------------------------- 1 | import Test ( longbindingNameThatoverflowsColum 2 | ) 3 | import Test ( Long 4 | ( List 5 | , Of 6 | , Things 7 | ) 8 | ) 9 | -------------------------------------------------------------------------------- /data/Test17.hs: -------------------------------------------------------------------------------- 1 | func 2 | :: Trither 3 | lkasdlkjalsdjlakjsdlkjasldkjalskdjlkajsd 4 | lkasdlkjalsdjlakjsdlkjasldkjalskdjlkajsd 5 | lkasdlkjalsdjlakjsdlkjasldkjalskdjlkajsd 6 | -> asd 7 | -------------------------------------------------------------------------------- /data/Test170.hs: -------------------------------------------------------------------------------- 1 | import Test ( Thing 2 | ( -- Comments 3 | ) 4 | ) 5 | import Test ( Thing 6 | ( Item 7 | -- and Comment 8 | ) 9 | ) 10 | import Test ( Thing 11 | ( With 12 | -- Comments 13 | , and 14 | -- also 15 | , items 16 | -- ! 17 | ) 18 | ) 19 | -------------------------------------------------------------------------------- /data/Test171.hs: -------------------------------------------------------------------------------- 1 | import VeryLongModuleNameThatCouldEvenCauseAnEmptyBindingListToExpandIntoMultipleLine 2 | ( ) 3 | -------------------------------------------------------------------------------- /data/Test172.hs: -------------------------------------------------------------------------------- 1 | {-# LANGUAGE BangPatterns #-} 2 | {- 3 | - Test module 4 | -} 5 | module Test 6 | ( test1 7 | -- ^ test 8 | , test2 9 | -- | test 10 | , test3 11 | , test4 12 | , test5 13 | , test6 14 | , test7 15 | , test8 16 | , test9 17 | , test10 18 | -- Test 10 19 | ) where 20 | -- Test 21 | import Data.List ( nub ) -- Test 22 | {- Test -} 23 | import qualified Data.List as L 24 | ( foldl' ) {- Test -} 25 | -- Test 26 | import Test ( test ) 27 | -------------------------------------------------------------------------------- /data/Test173.hs: -------------------------------------------------------------------------------- 1 | import Aaa 2 | import Baa 3 | -------------------------------------------------------------------------------- /data/Test174.hs: -------------------------------------------------------------------------------- 1 | import Zaa 2 | import Zab 3 | 4 | import Aaa 5 | import Baa 6 | -------------------------------------------------------------------------------- /data/Test175.hs: -------------------------------------------------------------------------------- 1 | import Boo 2 | import qualified Zoo 3 | -------------------------------------------------------------------------------- /data/Test176.hs: -------------------------------------------------------------------------------- 1 | import Boo ( a ) 2 | 3 | import Boo ( b ) 4 | -------------------------------------------------------------------------------- /data/Test177.hs: -------------------------------------------------------------------------------- 1 | import A.B.C 2 | import A.B.D 3 | -------------------------------------------------------------------------------- /data/Test178.hs: -------------------------------------------------------------------------------- 1 | type MySynonym = String 2 | -------------------------------------------------------------------------------- /data/Test179.hs: -------------------------------------------------------------------------------- 1 | type MySynonym a = [a] 2 | -------------------------------------------------------------------------------- /data/Test18.hs: -------------------------------------------------------------------------------- 1 | func 2 | :: Trither 3 | lkasdlkjalsdjlakjsdlkjasldkjalskdjlkajsd 4 | lkasdlkjalsdjlakjsdlkjasldkjalskdjlkajsd 5 | (lkasdlkjalsdjlakjsdlkjasldkjalskdjlkajsd -> asd) 6 | -------------------------------------------------------------------------------- /data/Test180.hs: -------------------------------------------------------------------------------- 1 | -- | Important comment thrown in 2 | type MySynonym b a 3 | = MySynonym a b -> MySynonym a b -> MyParamType a b -> MyParamType a b 4 | -------------------------------------------------------------------------------- /data/Test181.hs: -------------------------------------------------------------------------------- 1 | type MySynonym3 b a 2 | = MySynonym a b 3 | -> MySynonym a b 4 | -- ^ RandomComment 5 | -> MyParamType a b 6 | -> MyParamType a b 7 | -> MySynonym2 b a 8 | -------------------------------------------------------------------------------- /data/Test182.hs: -------------------------------------------------------------------------------- 1 | {-# LANGUAGE StarIsType #-} 2 | type MySynonym (a :: * -> *) 3 | = MySynonym a b 4 | -> MySynonym a b 5 | -> MyParamType a b 6 | -> MyParamType a b 7 | -> MySynonym2 b a 8 | -------------------------------------------------------------------------------- /data/Test183.hs: -------------------------------------------------------------------------------- 1 | type MySynonym a = Num a => a -> Int 2 | -------------------------------------------------------------------------------- /data/Test184.hs: -------------------------------------------------------------------------------- 1 | type MySynonym a 2 | = Num a 3 | => AReallyLongTypeName 4 | -> AnotherReallyLongTypeName 5 | -> AThirdTypeNameToOverflow 6 | -------------------------------------------------------------------------------- /data/Test185.hs: -------------------------------------------------------------------------------- 1 | {-# LANGUAGE RankNTypes #-} 2 | type MySynonym = forall a . [a] 3 | -------------------------------------------------------------------------------- /data/Test186.hs: -------------------------------------------------------------------------------- 1 | type (:+:) a b = (a, b) 2 | -------------------------------------------------------------------------------- /data/Test187.hs: -------------------------------------------------------------------------------- 1 | type a `MySynonym` b = a -> b 2 | -------------------------------------------------------------------------------- /data/Test188.hs: -------------------------------------------------------------------------------- 1 | type a :+: b = (a, b) 2 | -------------------------------------------------------------------------------- /data/Test189.hs: -------------------------------------------------------------------------------- 1 | type (a `Foo` b) c = (a, b, c) 2 | -------------------------------------------------------------------------------- /data/Test19.hs: -------------------------------------------------------------------------------- 1 | func 2 | :: Trither 3 | asd 4 | lkasdlkjalsdjlakjsdlkjasldkjalskdjlkajsd 5 | ( lkasdlkjalsdjlakjsdlkjasldkjalskdjlkajsd 6 | -> lkasdlkjalsdjlakjsdlkjasldkjalskdjlkajsd 7 | ) 8 | -------------------------------------------------------------------------------- /data/Test190.hs: -------------------------------------------------------------------------------- 1 | type Foo a -- fancy type comment 2 | = -- strange comment 3 | Int 4 | -------------------------------------------------------------------------------- /data/Test191.hs: -------------------------------------------------------------------------------- 1 | type (a :+: b) = (a, b) 2 | -------------------------------------------------------------------------------- /data/Test192.hs: -------------------------------------------------------------------------------- 1 | type Foo 2 | = ( -- t1 3 | A -- t2 4 | , -- t3 5 | B -- t4 6 | ) -- t5 7 | -------------------------------------------------------------------------------- /data/Test193.hs: -------------------------------------------------------------------------------- 1 | instance MyClass Int where 2 | myMethod x = x + 1 3 | -------------------------------------------------------------------------------- /data/Test194.hs: -------------------------------------------------------------------------------- 1 | instance MyClass Int where 2 | myMethod x = 3 | -- insightful comment 4 | x + 1 5 | -------------------------------------------------------------------------------- /data/Test195.hs: -------------------------------------------------------------------------------- 1 | instance MyClass Int where 2 | myMethod :: Int -> Int 3 | myMethod x = x + 1 4 | -------------------------------------------------------------------------------- /data/Test196.hs: -------------------------------------------------------------------------------- 1 | instance MyClass Int where 2 | myMethod 3 | :: Int 4 | -> Int 5 | -> AReallyLongType 6 | -> AReallyLongType 7 | -> AReallyLongType 8 | -> Int 9 | myMethod x = x + 1 10 | -------------------------------------------------------------------------------- /data/Test197.hs: -------------------------------------------------------------------------------- 1 | instance MyClass Int where 2 | myMethod x = x + 1 3 | myMethod2 x = x + 1 4 | -------------------------------------------------------------------------------- /data/Test198.hs: -------------------------------------------------------------------------------- 1 | instance MyClass Int where 2 | myMethod 3 | :: Int 4 | -> Int 5 | -> AReallyLongType 6 | -> AReallyLongType 7 | -> AReallyLongType 8 | -> Int 9 | myMethod x = x + 1 10 | myMethod2 :: Int -> Int 11 | myMethod2 x = x + 1 12 | -------------------------------------------------------------------------------- /data/Test199.hs: -------------------------------------------------------------------------------- 1 | -- | This instance should be commented on 2 | instance MyClass Int where 3 | -- | This method is also comment-worthy 4 | myMethod x = x + 1 5 | -------------------------------------------------------------------------------- /data/Test2.hs: -------------------------------------------------------------------------------- 1 | func 2 | :: lkasdlkjalsdjlakjsdlkjasldkjalskdjlkajsd 3 | -> lkasdlkjalsdjlakjsdlkjasldkjalskdjlkajsd 4 | -------------------------------------------------------------------------------- /data/Test20.hs: -------------------------------------------------------------------------------- 1 | func 2 | :: asd 3 | -> ( Trither 4 | lkasdlkjalsdjlakjsdlkjasldkjalskdjlkajsd 5 | lkasdlkjalsdjlakjsdlkjasldkjalskdjlkajsd 6 | lkasdlkjalsdjlakjsdlkjasldkjalskdjlkajsd 7 | ) 8 | -------------------------------------------------------------------------------- /data/Test200.hs: -------------------------------------------------------------------------------- 1 | instance MyClass Int where 2 | type MyType = Int 3 | myMethod :: MyType -> Int 4 | myMethod x = x + 1 5 | -------------------------------------------------------------------------------- /data/Test201.hs: -------------------------------------------------------------------------------- 1 | instance MyClass Int where 2 | type MyType = String 3 | myMethod :: MyType -> Int 4 | myMethod x = x + 1 5 | type MyType = Int 6 | -------------------------------------------------------------------------------- /data/Test202.hs: -------------------------------------------------------------------------------- 1 | instance MyClass Int where 2 | -- | This data is very important 3 | data MyData = IntData 4 | { intData :: String 5 | , intData2 :: Int 6 | } 7 | myMethod :: MyData -> Int 8 | myMethod = intData2 9 | -------------------------------------------------------------------------------- /data/Test203.hs: -------------------------------------------------------------------------------- 1 | instance MyClass Int where 2 | -- | This data is important 3 | data MyData = Test Int Int 4 | myMethod :: MyData -> Int 5 | myMethod = intData2 6 | -- | This data is also important 7 | data MyData2 = IntData 8 | { intData :: String 9 | -- ^ Interesting field 10 | , intData2 :: Int 11 | } 12 | -------------------------------------------------------------------------------- /data/Test204.hs: -------------------------------------------------------------------------------- 1 | {-# LANGUAGE TypeFamilies #-} 2 | module Lib where 3 | instance Foo () where 4 | newtype Bar () = Baz () 5 | deriving (Eq, Ord, Show) 6 | bar = Baz 7 | -------------------------------------------------------------------------------- /data/Test205.hs: -------------------------------------------------------------------------------- 1 | instance Foo Int where 2 | newtype Bar Int = BarInt 3 | { unBarInt :: Int 4 | } 5 | -------------------------------------------------------------------------------- /data/Test206.hs: -------------------------------------------------------------------------------- 1 | {-# language TypeFamilies #-} 2 | type family F a 3 | type instance F Int = IO Int 4 | -------------------------------------------------------------------------------- /data/Test207.hs: -------------------------------------------------------------------------------- 1 | {-# language TypeFamilies #-} 2 | type family F a 3 | type instance F Int = IO Int -- x 4 | -------------------------------------------------------------------------------- /data/Test208.hs: -------------------------------------------------------------------------------- 1 | {-# language TypeFamilies #-} 2 | module M where 3 | type family F a 4 | type instance F Int = IO Int 5 | -------------------------------------------------------------------------------- /data/Test209.hs: -------------------------------------------------------------------------------- 1 | {-# language TypeFamilies #-} 2 | data family F a 3 | newtype instance F Int = N Int 4 | -------------------------------------------------------------------------------- /data/Test21.hs: -------------------------------------------------------------------------------- 1 | func 2 | :: asd 3 | -> ( Trither 4 | lkasdlkjalsdjlakjsdlkjasldkjalskdjlkajsd 5 | lkasdlkjalsdjlakjsdlkjasldkjalskdjlkajsd 6 | ) 7 | lkasdlkjalsdjlakjsdlkjasldkjalskdjlkajsd 8 | -------------------------------------------------------------------------------- /data/Test210.hs: -------------------------------------------------------------------------------- 1 | {-# language TypeFamilies #-} 2 | data family F a 3 | newtype instance F Int = N Int -- x 4 | -------------------------------------------------------------------------------- /data/Test211.hs: -------------------------------------------------------------------------------- 1 | {-# language TypeFamilies #-} 2 | module M where 3 | data family F a 4 | newtype instance F Int = N Int 5 | -------------------------------------------------------------------------------- /data/Test212.hs: -------------------------------------------------------------------------------- 1 | {-# language TypeFamilies #-} 2 | data family F a 3 | data instance F Int = D Int 4 | -------------------------------------------------------------------------------- /data/Test213.hs: -------------------------------------------------------------------------------- 1 | {-# language TypeFamilies #-} 2 | data family F a 3 | data instance F Int = D Int -- x 4 | -------------------------------------------------------------------------------- /data/Test214.hs: -------------------------------------------------------------------------------- 1 | {-# language TypeFamilies #-} 2 | module M where 3 | data family F a 4 | data instance F Int = D Int 5 | -------------------------------------------------------------------------------- /data/Test215.hs: -------------------------------------------------------------------------------- 1 | {-# language TypeFamilies #-} 2 | class C a where 3 | type family F a 4 | instance C Int where 5 | type F Int = IO Int 6 | -------------------------------------------------------------------------------- /data/Test216.hs: -------------------------------------------------------------------------------- 1 | {-# language TypeFamilies #-} 2 | class C a where 3 | type family F a 4 | instance C Int where 5 | type F Int = IO Int -- x 6 | -------------------------------------------------------------------------------- /data/Test217.hs: -------------------------------------------------------------------------------- 1 | {-# language TypeFamilies #-} 2 | module M where 3 | class C a where 4 | type family F a 5 | instance C Int where 6 | type F Int = IO Int 7 | -------------------------------------------------------------------------------- /data/Test218.hs: -------------------------------------------------------------------------------- 1 | {-# language TypeFamilies #-} 2 | class C a where 3 | data family F a 4 | instance C Int where 5 | newtype F Int = N Int 6 | -------------------------------------------------------------------------------- /data/Test219.hs: -------------------------------------------------------------------------------- 1 | {-# language TypeFamilies #-} 2 | class C a where 3 | data family F a 4 | instance C Int where 5 | newtype F Int = N Int -- x 6 | -------------------------------------------------------------------------------- /data/Test22.hs: -------------------------------------------------------------------------------- 1 | func 2 | :: ( Trither 3 | lkasdlkjalsdjlakjsdlkjasldkjalskdjlkajsd 4 | lkasdlkjalsdjlakjsdlkjasldkjalskdjlkajsd 5 | ) 6 | lkasdlkjalsdjlakjsdlkjasldkjalskdjlkajsd 7 | -> asd 8 | -------------------------------------------------------------------------------- /data/Test220.hs: -------------------------------------------------------------------------------- 1 | {-# language TypeFamilies #-} 2 | module M where 3 | class C a where 4 | data family F a 5 | instance C Int where 6 | newtype F Int = N Int 7 | -------------------------------------------------------------------------------- /data/Test221.hs: -------------------------------------------------------------------------------- 1 | {-# language TypeFamilies #-} 2 | class C a where 3 | data family F a 4 | instance C Int where 5 | data F Int = D Int 6 | -------------------------------------------------------------------------------- /data/Test222.hs: -------------------------------------------------------------------------------- 1 | {-# language TypeFamilies #-} 2 | class C a where 3 | data family F a 4 | instance C Int where 5 | data F Int = D Int -- x 6 | -------------------------------------------------------------------------------- /data/Test223.hs: -------------------------------------------------------------------------------- 1 | {-# language TypeFamilies #-} 2 | module M where 3 | class C a where 4 | data family F a 5 | instance C Int where 6 | data F Int = D Int 7 | -------------------------------------------------------------------------------- /data/Test224.hs: -------------------------------------------------------------------------------- 1 | module Main where 2 | import Prelude 3 | firstDecl = True 4 | -------------------------------------------------------------------------------- /data/Test225.hs: -------------------------------------------------------------------------------- 1 | func = do 2 | -- complex first step 3 | aaa 4 | -- complex second step 5 | bbb 6 | where 7 | helper :: Helper 8 | helper = helpful 9 | other :: Other 10 | other = True 11 | -------------------------------------------------------------------------------- /data/Test226.hs: -------------------------------------------------------------------------------- 1 | type instance MyFam Bool = String 2 | -------------------------------------------------------------------------------- /data/Test227.hs: -------------------------------------------------------------------------------- 1 | type instance MyFam (Maybe a) = a -> Bool 2 | -------------------------------------------------------------------------------- /data/Test228.hs: -------------------------------------------------------------------------------- 1 | type instance MyFam ALongishType 2 | = AMuchLongerTypeThanThat 3 | -> AnEvenLongerTypeThanTheLastOne 4 | -> ShouldDefinitelyOverflow 5 | -------------------------------------------------------------------------------- /data/Test229.hs: -------------------------------------------------------------------------------- 1 | -- | A happy family 2 | type instance MyFam Bool -- This is an odd one 3 | = AnotherType -- Here's another 4 | -------------------------------------------------------------------------------- /data/Test23.hs: -------------------------------------------------------------------------------- 1 | func :: [a -> b] 2 | -------------------------------------------------------------------------------- /data/Test230.hs: -------------------------------------------------------------------------------- 1 | {-# LANGUAGE MultiWayIf #-} 2 | func = if 3 | | cond1 -> loooooooooooooooooooooooooooooong expr1 4 | | cond2 -> loooooooooooooooooooooooooooooong expr2 5 | -------------------------------------------------------------------------------- /data/Test231.hs: -------------------------------------------------------------------------------- 1 | {-# LANGUAGE MultiWayIf #-} 2 | func = do 3 | foo 4 | bar $ if 5 | | cond1 -> loooooooooooooooooooooooooooooong expr1 6 | | cond2 -> loooooooooooooooooooooooooooooong expr2 7 | -------------------------------------------------------------------------------- /data/Test232.hs: -------------------------------------------------------------------------------- 1 | {-# LANGUAGE LambdaCase #-} 2 | func = \case 3 | FooBar -> x 4 | Baz -> y 5 | -------------------------------------------------------------------------------- /data/Test233.hs: -------------------------------------------------------------------------------- 1 | {-# LANGUAGE ImplicitParams #-} 2 | func :: (?asd::Int) -> () 3 | -------------------------------------------------------------------------------- /data/Test234.hs: -------------------------------------------------------------------------------- 1 | {-# LANGUAGE ImplicitParams #-} 2 | func 3 | :: ( ?asd 4 | :: lkasdlkjalsdjlakjsdlkjasldkjalskdjlkajsd 5 | -> lkasdlkjalsdjlakjsdlkjasldkjalskdjlkajsd 6 | ) 7 | -> () 8 | -------------------------------------------------------------------------------- /data/Test235.hs: -------------------------------------------------------------------------------- 1 | {-# LANGUAGE RecursiveDo #-} 2 | foo = do 3 | rec a <- f b 4 | b <- g a 5 | return (a, b) 6 | -------------------------------------------------------------------------------- /data/Test236.hs: -------------------------------------------------------------------------------- 1 | {-# LANGUAGE RecursiveDo #-} 2 | foo = do 3 | rec -- comment 4 | a <- f b 5 | b <- g a 6 | return (a, b) 7 | -------------------------------------------------------------------------------- /data/Test237.hs: -------------------------------------------------------------------------------- 1 | {-# LANGUAGE ExplicitNamespaces #-} 2 | {-# LANGUAGE PatternSynonyms #-} 3 | module Test (type (++), (++), pattern Foo) where 4 | -------------------------------------------------------------------------------- /data/Test238.hs: -------------------------------------------------------------------------------- 1 | {-# LANGUAGE ExplicitNamespaces #-} 2 | {-# LANGUAGE PatternSynonyms #-} 3 | import Test ( type (++) 4 | , (++) 5 | , pattern (:.) 6 | , pattern Foo 7 | ) 8 | -------------------------------------------------------------------------------- /data/Test239.hs: -------------------------------------------------------------------------------- 1 | {-# LANGUAGE PatternSynonyms #-} 2 | pattern J x = Just x 3 | -------------------------------------------------------------------------------- /data/Test24.hs: -------------------------------------------------------------------------------- 1 | func 2 | :: [ lkasdlkjalsdjlakjsdlkjasldkjalskdjlkajsd 3 | -> lkasdlkjalsdjlakjsdlkjasldkjalskdjlkajsd 4 | ] 5 | -------------------------------------------------------------------------------- /data/Test240.hs: -------------------------------------------------------------------------------- 1 | {-# LANGUAGE PatternSynonyms #-} 2 | pattern F x <- (x, _) 3 | -------------------------------------------------------------------------------- /data/Test241.hs: -------------------------------------------------------------------------------- 1 | {-# LANGUAGE PatternSynonyms #-} 2 | pattern HeadC x <- x : xs where 3 | HeadC x = [x] 4 | -------------------------------------------------------------------------------- /data/Test242.hs: -------------------------------------------------------------------------------- 1 | {-# LANGUAGE PatternSynonyms #-} 2 | pattern Head2 x y <- x : y : xs where 3 | Head2 x y = [x, y] 4 | -------------------------------------------------------------------------------- /data/Test243.hs: -------------------------------------------------------------------------------- 1 | {-# LANGUAGE PatternSynonyms #-} 2 | pattern x :> y = [x, y] 3 | -------------------------------------------------------------------------------- /data/Test244.hs: -------------------------------------------------------------------------------- 1 | {-# LANGUAGE PatternSynonyms #-} 2 | pattern MyData { a, b, c } = [a, b, c] 3 | -------------------------------------------------------------------------------- /data/Test245.hs: -------------------------------------------------------------------------------- 1 | {-# LANGUAGE PatternSynonyms #-} 2 | pattern myLongLeftVariableName `MyLongInfixPatternMatcher` myLongRightVariableName = 3 | [myLongLeftVariableName, myLongRightVariableName] 4 | -------------------------------------------------------------------------------- /data/Test246.hs: -------------------------------------------------------------------------------- 1 | {-# LANGUAGE PatternSynonyms #-} 2 | pattern myLeftVariableName `MyInfixPatternMatcher` myRightVariableName <- 3 | [myLongLeftVariableName, myLongRightVariableName] where 4 | MyInfixPatternMatcher x y = [x, x, y] 5 | -------------------------------------------------------------------------------- /data/Test247.hs: -------------------------------------------------------------------------------- 1 | {-# LANGUAGE PatternSynonyms #-} 2 | pattern J :: a -> Maybe a 3 | pattern J x = Just x 4 | -------------------------------------------------------------------------------- /data/Test248.hs: -------------------------------------------------------------------------------- 1 | {-# LANGUAGE PatternSynonyms #-} 2 | {-# LANGUAGE ViewPatterns #-} 3 | pattern Signed x <- (asSigned -> x) where 4 | Signed (Neg x) = -x 5 | Signed Zero = 0 6 | Signed (Pos x) = x 7 | -------------------------------------------------------------------------------- /data/Test249.hs: -------------------------------------------------------------------------------- 1 | {-# LANGUAGE PatternSynonyms #-} 2 | {-# LANGUAGE ViewPatterns #-} 3 | pattern Signed xxxxxxxxxxxxxxxxxxxxxxxx <- 4 | (asSigned -> xxxxxxxxxxxxxxxxxxxxxxxx) where 5 | Signed (Neg x) = -x 6 | Signed Zero = 0 7 | Signed (Pos x) = x 8 | -------------------------------------------------------------------------------- /data/Test25.hs: -------------------------------------------------------------------------------- 1 | func 2 | :: [ ( lkasdlkjalsdjlakjsdlkjasldkjalskdjlkajsd 3 | -> lkasdlkjalsdjlakjsdlkjasldkjalskdjlkajsd 4 | ) 5 | ] 6 | -------------------------------------------------------------------------------- /data/Test250.hs: -------------------------------------------------------------------------------- 1 | {-# LANGUAGE PatternSynonyms #-} 2 | {-# LANGUAGE ViewPatterns #-} 3 | pattern Signed x <- (asSigned -> x) where 4 | Signed (Neg x) = -x -- negative comment 5 | Signed Zero = 0 -- zero comment 6 | Signed (Pos x) = x -- positive comment 7 | -------------------------------------------------------------------------------- /data/Test251.hs: -------------------------------------------------------------------------------- 1 | {-# LANGUAGE PatternSynonyms #-} 2 | pattern J, K :: a -> Maybe a 3 | -------------------------------------------------------------------------------- /data/Test252.hs: -------------------------------------------------------------------------------- 1 | {-# LANGUAGE PatternSynonyms #-} 2 | pattern LongMatcher 3 | :: longlongtypevar 4 | -> longlongtypevar 5 | -> longlongtypevar 6 | -> Maybe [longlongtypevar] 7 | pattern LongMatcher x y z = Just [x, y, z] 8 | -------------------------------------------------------------------------------- /data/Test253.hs: -------------------------------------------------------------------------------- 1 | {-# LANGUAGE UnboxedTuples #-} 2 | spanKey :: (# Int, Int #) -> (# Int, Int #) 3 | spanKey = case foo of 4 | (# bar, baz #) -> (# baz, bar #) 5 | -------------------------------------------------------------------------------- /data/Test254.hs: -------------------------------------------------------------------------------- 1 | {-# LANGUAGE MagicHash, UnboxedTuples #-} 2 | spanKey :: (# Int#, Int# #) -> (# Int#, Int# #) 3 | spanKey = case foo of 4 | (# bar#, baz# #) -> (# baz# +# bar#, bar# #) 5 | -------------------------------------------------------------------------------- /data/Test255.hs: -------------------------------------------------------------------------------- 1 | {-# LANGUAGE QuasiQuotes #-} 2 | func = [blub| 3 | asd 4 | qwe 5 | |] 6 | -------------------------------------------------------------------------------- /data/Test256.hs: -------------------------------------------------------------------------------- 1 | {-# LANGUAGE QuasiQuotes #-} 2 | func = [blub| 3 | asd 4 | qwe|] 5 | -------------------------------------------------------------------------------- /data/Test257.hs: -------------------------------------------------------------------------------- 1 | {-# LANGUAGE QuasiQuotes #-} 2 | func = do 3 | let body = [json| 4 | hello 5 | |] 6 | pure True 7 | -------------------------------------------------------------------------------- /data/Test258.hs: -------------------------------------------------------------------------------- 1 | -- brittany { lconfig_allowHangingQuasiQuotes: False } 2 | {-# LANGUAGE QuasiQuotes #-} 3 | func = do 4 | let 5 | body = 6 | [json| 7 | hello 8 | |] 9 | pure True 10 | -------------------------------------------------------------------------------- /data/Test259.hs: -------------------------------------------------------------------------------- 1 | {-# LANGUAGE OverloadedLabels #-} 2 | foo = #bar 3 | -------------------------------------------------------------------------------- /data/Test26.hs: -------------------------------------------------------------------------------- 1 | func :: (a, b, c) 2 | -------------------------------------------------------------------------------- /data/Test260.hs: -------------------------------------------------------------------------------- 1 | {-# LANGUAGE OverloadedLabels #-} 2 | foo = #bar . #baz $ fmap #foo xs 3 | -------------------------------------------------------------------------------- /data/Test261.hs: -------------------------------------------------------------------------------- 1 | {-# LANGUAGE ImplicitParams #-} 2 | foo = ?bar 3 | -------------------------------------------------------------------------------- /data/Test262.hs: -------------------------------------------------------------------------------- 1 | {-# LANGUAGE ImplicitParams #-} 2 | foo = let ?bar = Foo in value 3 | -------------------------------------------------------------------------------- /data/Test263.hs: -------------------------------------------------------------------------------- 1 | {-# LANGUAGE ImplicitParams #-} 2 | foo :: (?bar::Bool) => () 3 | foo = () 4 | -------------------------------------------------------------------------------- /data/Test264.hs: -------------------------------------------------------------------------------- 1 | func = do 2 | abc <- foo 3 | --abc 4 | return () 5 | -------------------------------------------------------------------------------- /data/Test265.hs: -------------------------------------------------------------------------------- 1 | func = (()) 2 | -------------------------------------------------------------------------------- /data/Test266.hs: -------------------------------------------------------------------------------- 1 | func = do 2 | let foo True = True 3 | foo _ = False 4 | return () 5 | -------------------------------------------------------------------------------- /data/Test267.hs: -------------------------------------------------------------------------------- 1 | func = do 2 | s <- mGet 3 | mSet $ s { _lstate_indent = _lstate_indent state } 4 | -------------------------------------------------------------------------------- /data/Test268.hs: -------------------------------------------------------------------------------- 1 | func = do 2 | s <- mGet 3 | mSet $ s { _lstate_indent = _lstate_indent state 4 | , _lstate_foo = _lstate_foo state 5 | } 6 | -------------------------------------------------------------------------------- /data/Test269.hs: -------------------------------------------------------------------------------- 1 | func = do 2 | s <- mGet 3 | mSet $ s 4 | { _lstate_indent = _lstate_indent lkasdlkjalsdjlakjsdlkjasldkjalskdjlkajsd 5 | , _lstate_foo = _lstate_foo lkasdlkjalsdjlakjsdlkjasldkjalskdjlkajsd 6 | } 7 | -------------------------------------------------------------------------------- /data/Test27.hs: -------------------------------------------------------------------------------- 1 | func :: ((a, b, c), (a, b, c), (a, b, c)) 2 | -------------------------------------------------------------------------------- /data/Test270.hs: -------------------------------------------------------------------------------- 1 | func = Foo { _lstate_indent = _lstate_indent state } 2 | -------------------------------------------------------------------------------- /data/Test271.hs: -------------------------------------------------------------------------------- 1 | func = Foo 2 | { _lstate_indent = _lstate_indent lkasdlkjalsdjlakjsdlkjasldkjalskdjlkajsd 3 | , _lstate_fooo = _lstate_foo lkasdlkjalsdjlakjsdlkjasldkjalskdjlkajsd 4 | } 5 | -------------------------------------------------------------------------------- /data/Test272.hs: -------------------------------------------------------------------------------- 1 | func = do 2 | Foo { _lstate_indent = _lstate_indent lkasdlkjalsdjlakjsdlkjasldkjalskdjlkajsd 3 | , _lstate_foo = _lstate_foo lkasdlkjalsdjlakjsdlkjasldkjalskdjlkajsd 4 | } 5 | -------------------------------------------------------------------------------- /data/Test273.hs: -------------------------------------------------------------------------------- 1 | func = do 2 | -- abc 3 | -- def 4 | return () 5 | -------------------------------------------------------------------------------- /data/Test274.hs: -------------------------------------------------------------------------------- 1 | func = do 2 | do 3 | return () 4 | -- abc 5 | -- def 6 | return () 7 | -------------------------------------------------------------------------------- /data/Test275.hs: -------------------------------------------------------------------------------- 1 | func 2 | :: Int -- basic indentation amount 3 | -> Int -- currently used width in current line (after indent) 4 | -- used to accurately calc placing of the current-line 5 | -> LayoutDesc 6 | -> Int 7 | -------------------------------------------------------------------------------- /data/Test276.hs: -------------------------------------------------------------------------------- 1 | func = 2 | ( lkjadljasldjalskdjaldjalsdjkalsdjlaksdjlasjdlajsaldskj 3 | $ abc 4 | $ def 5 | $ ghi 6 | $ jkl 7 | ) 8 | -------------------------------------------------------------------------------- /data/Test277.hs: -------------------------------------------------------------------------------- 1 | buildG bounds0 edges0 = accumArray (flip (:)) [] bounds0 (map reassoc edges0) 2 | where reassoc (v, e, w) = (v, (e, w)) 3 | -------------------------------------------------------------------------------- /data/Test278.hs: -------------------------------------------------------------------------------- 1 | downloadRepoPackage = case repo of 2 | RepoLocal {..} -> return () 3 | RepoLocal { abc } -> return () 4 | RepoLocal{} -> return () 5 | -------------------------------------------------------------------------------- /data/Test279.hs: -------------------------------------------------------------------------------- 1 | func = do 2 | let (primaryPkg, otherPkgs) = selectPrimaryLocalPackage pwd pkgs' 3 | (bproblems, x) = resolveBuildTargets primaryPkg otherPkgs utargets'' 4 | -- default local dir target if there's no given target 5 | utargets'' = "foo" 6 | return () 7 | -------------------------------------------------------------------------------- /data/Test28.hs: -------------------------------------------------------------------------------- 1 | func 2 | :: ( lkasdlkjalsdjlakjsdlkjasldkjalskdjlkajsd 3 | , lkasdlkjalsdjlakjsdlkjasldkjalskdjlkajsd 4 | , lkasdlkjalsdjlakjsdlkjasldkjalskdjlkajsd 5 | ) 6 | -------------------------------------------------------------------------------- /data/Test280.hs: -------------------------------------------------------------------------------- 1 | func = 2 | [ (thing, take 10 alts) --TODO: select best ones 3 | | (thing, _got, alts@(_ : _)) <- nosuchFooThing 4 | , gast <- award 5 | ] 6 | -------------------------------------------------------------------------------- /data/Test281.hs: -------------------------------------------------------------------------------- 1 | func = if x 2 | then if y -- y is important 3 | then foo 4 | else bar 5 | else Nothing 6 | -------------------------------------------------------------------------------- /data/Test282.hs: -------------------------------------------------------------------------------- 1 | wrapPatPrepend pat prepElem = do 2 | patDocs <- layoutPat pat 3 | case Seq.viewl patDocs of 4 | Seq.EmptyL -> return $ Seq.empty 5 | x1 Seq.:< xR -> do 6 | x1' <- docSeq [prepElem, return x1] 7 | return $ x1' Seq.<| xR 8 | -------------------------------------------------------------------------------- /data/Test283.hs: -------------------------------------------------------------------------------- 1 | layoutWriteNewlineBlock 2 | :: ( MonadMultiWriter Text.Builder.Builder m 3 | , MonadMultiState LayoutState m 4 | , MonadMultiWriter (Seq String) m 5 | ) 6 | => m () 7 | -------------------------------------------------------------------------------- /data/Test284.hs: -------------------------------------------------------------------------------- 1 | {-# LANGUAGE MultiWayIf #-} 2 | readMergePersConfig path shouldCreate conf = do 3 | exists <- liftIO $ System.Directory.doesFileExist path 4 | if 5 | | exists -> do 6 | contents <- liftIO $ ByteString.readFile path -- no lazy IO, tyvm. 7 | fileConf <- case Data.Yaml.decodeEither contents of 8 | Left e -> do 9 | liftIO 10 | $ putStrErrLn 11 | $ "error reading in brittany config from " 12 | ++ path 13 | ++ ":" 14 | liftIO $ putStrErrLn e 15 | mzero 16 | Right x -> return x 17 | return $ fileConf Semigroup.<> conf 18 | | shouldCreate -> do 19 | liftIO $ ByteString.writeFile path $ Data.Yaml.encode $ cMap 20 | (Option . Just . runIdentity) 21 | staticDefaultConfig 22 | return $ conf 23 | | otherwise -> do 24 | return conf 25 | -------------------------------------------------------------------------------- /data/Test285.hs: -------------------------------------------------------------------------------- 1 | func = BuildReport 2 | where 3 | convertInstallOutcome = case result of 4 | Left BR.PlanningFailed -> PlanningFailed 5 | Left (BR.DependentFailed p) -> DependencyFailed p 6 | Left (BR.DownloadFailed _) -> DownloadFailed 7 | Left (BR.UnpackFailed _) -> UnpackFailed 8 | Left (BR.ConfigureFailed _) -> ConfigureFailed 9 | Left (BR.BuildFailed _) -> BuildFailed 10 | Left (BR.TestsFailed _) -> TestsFailed 11 | Left (BR.InstallFailed _) -> InstallFailed 12 | Right (BR.BuildOk _ _ _ ) -> InstallOk 13 | -------------------------------------------------------------------------------- /data/Test286.hs: -------------------------------------------------------------------------------- 1 | func = BuildReport 2 | where 3 | convertInstallOutcome = case result of 4 | Left BR.PlanningFailed -> PlanningFailed 5 | Left (BR.DependentFailed p) -> DependencyFailed p 6 | Left (BR.DownloadFailed _) -> DownloadFailed 7 | Left (BR.UnpackFailed _) -> UnpackFailed 8 | Left (BR.ConfigureFailed _) -> ConfigureFailed 9 | Left (BR.BuildFailed _) -> BuildFailed 10 | Left (BR.TestsFailed _) -> TestsFailed 11 | Left (BR.InstallFailed _) -> InstallFailed 12 | Right (BR.BuildOk _ _ _ ) -> InstallOk 13 | -------------------------------------------------------------------------------- /data/Test287.hs: -------------------------------------------------------------------------------- 1 | showPackageDetailedInfo pkginfo = 2 | renderStyle (style { lineLength = 80, ribbonsPerLine = 1 }) 3 | $ char '*' 4 | $+$ something 5 | [ entry "Synopsis" synopsis hideIfNull reflowParagraphs 6 | , entry "Versions available" 7 | sourceVersions 8 | (altText null "[ Not available from server ]") 9 | (dispTopVersions 9 (preferredVersions pkginfo)) 10 | , entry 11 | "Versions installed" 12 | installedVersions 13 | (altText 14 | null 15 | (if hasLib pkginfo then "[ Not installed ]" else "[ Unknown ]") 16 | ) 17 | (dispTopVersions 4 (preferredVersions pkginfo)) 18 | , entry "Homepage" homepage orNotSpecified text 19 | , entry "Bug reports" bugReports orNotSpecified text 20 | , entry "Description" description hideIfNull reflowParagraphs 21 | , entry "Category" category hideIfNull text 22 | , entry "License" license alwaysShow disp 23 | , entry "Author" author hideIfNull reflowLines 24 | , entry "Maintainer" maintainer hideIfNull reflowLines 25 | , entry "Source repo" sourceRepo orNotSpecified text 26 | , entry "Executables" executables hideIfNull (commaSep text) 27 | , entry "Flags" flags hideIfNull (commaSep dispFlag) 28 | , entry "Dependencies" dependencies hideIfNull (commaSep dispExtDep) 29 | , entry "Documentation" haddockHtml showIfInstalled text 30 | , entry "Cached" haveTarball alwaysShow dispYesNo 31 | , if not (hasLib pkginfo) 32 | then empty 33 | else text "Modules:" 34 | $+$ nest 4 (vcat (map disp . sort . modules $ pkginfo)) 35 | ] 36 | -------------------------------------------------------------------------------- /data/Test288.hs: -------------------------------------------------------------------------------- 1 | isValidPosition position | validX && validY = Just position 2 | | otherwise = Nothing 3 | -------------------------------------------------------------------------------- /data/Test289.hs: -------------------------------------------------------------------------------- 1 | foo = Reflex.runSpiderHost $ ReflexHost.hostApp $ do 2 | (inputEvent :: Reflex.Event Reflex.Spider String, inputFire :: String 3 | -> IO Bool ) <- 4 | ReflexHost.newExternalEvent 5 | liftIO . forkIO . forever $ getLine >>= inputFire 6 | ReflexHost.performEvent_ $ fmap (liftIO . putStrLn) inputEvent 7 | -------------------------------------------------------------------------------- /data/Test29.hs: -------------------------------------------------------------------------------- 1 | func 2 | :: ( ( lkasdlkjalsdjlakjsdlkjasldkjalskdjlkajsd 3 | , (lkasdlkjalsdjlakjsdlkjasldkjalskdjlkajsd) 4 | , lkasdlkjalsdjlakjsdlkjasldkjalskdjlkajsd 5 | ) 6 | ) 7 | -------------------------------------------------------------------------------- /data/Test290.hs: -------------------------------------------------------------------------------- 1 | foldrDesc f z = unSwitchQueue $ \q -> 2 | switch (Min.foldrDesc (f unTaggedF) z q) (Min.foldrAsc (f unTaggedF) z q) 3 | -------------------------------------------------------------------------------- /data/Test291.hs: -------------------------------------------------------------------------------- 1 | autocheckCases = 2 | [ ("Never Deadlocks" , representative deadlocksNever) 3 | , ("No Exceptions" , representative exceptionsNever) 4 | , ("Consistent Result", alwaysSame) -- already representative 5 | ] 6 | -------------------------------------------------------------------------------- /data/Test292.hs: -------------------------------------------------------------------------------- 1 | autocheckCases = 2 | [ ("Never Deadlocks", representative deadlocksNever) 3 | , ("No Exceptions" , representative exceptionsNever) 4 | , ( "Consistent Result" 5 | , alwaysSame -- already representative 6 | ) 7 | ] 8 | -------------------------------------------------------------------------------- /data/Test293.hs: -------------------------------------------------------------------------------- 1 | func = 2 | [ (abc, (1111, 1111)) 3 | , (def, (2, 2)) 4 | , foo -- comment 5 | ] 6 | -------------------------------------------------------------------------------- /data/Test294.hs: -------------------------------------------------------------------------------- 1 | foo a b = g a b -- fooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo 2 | where g a b = b + b * a 3 | -------------------------------------------------------------------------------- /data/Test295.hs: -------------------------------------------------------------------------------- 1 | foo a b = g a b where g a b = b + b * a -- fooooooooooooooooooooooooooooooooooo 2 | -------------------------------------------------------------------------------- /data/Test296.hs: -------------------------------------------------------------------------------- 1 | func = do 2 | abc <- expr 3 | abcccccccccccccccccc <- expr 4 | abcccccccccccccccccccccccccccccccccccccccccc <- expr 5 | abccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc <- expr 6 | -------------------------------------------------------------------------------- /data/Test297.hs: -------------------------------------------------------------------------------- 1 | func (MyLongFoo abc def) = 1 2 | func (Bar a d ) = 2 3 | func _ = 3 4 | -------------------------------------------------------------------------------- /data/Test298.hs: -------------------------------------------------------------------------------- 1 | parserCompactLocation = 2 | [ try 3 | $ [ ParseRelAbs (Text.Read.read digits) _ _ 4 | | digits <- many1 digit 5 | , rel1 :: Maybe (Either Int (Ratio Int)) <- optionMaybe 6 | [ case divPart of 7 | Nothing -> Left $ Text.Read.read digits 8 | Just ddigits -> 9 | Right $ Text.Read.read digits % Text.Read.read ddigits 10 | | digits <- many1 digit 11 | , divPart <- optionMaybe (string "/" *> many1 digit) 12 | ] 13 | ] 14 | ] 15 | -------------------------------------------------------------------------------- /data/Test299.hs: -------------------------------------------------------------------------------- 1 | func = fooooooooooooooooooooooooooooooooo $ foooooooooooooooooooooooooooooooo 2 | foooooooooooooooooooooooooooooooo 3 | foooooooooooooooooooooooooooooooo 4 | -------------------------------------------------------------------------------- /data/Test3.hs: -------------------------------------------------------------------------------- 1 | func 2 | :: lkasdlkjalsdjlakjsdlkjasldkjalskdjlkajsd 3 | -> lakjsdlkjasldkj 4 | -> lakjsdlkjasldkj 5 | -------------------------------------------------------------------------------- /data/Test30.hs: -------------------------------------------------------------------------------- 1 | func 2 | :: [ ( lkasdlkjalsdjlakjsdlkjasldkjalskdjlkajsd 3 | , lkasdlkjalsdjlakjsdlkjasldkjalskdjlkajsd 4 | , lkasdlkjalsdjlakjsdlkjasldkjalskdjlkajsd 5 | ) 6 | ] 7 | -------------------------------------------------------------------------------- /data/Test300.hs: -------------------------------------------------------------------------------- 1 | func = 2 | fooooooooooooooooooooooooooooooooo 3 | + foooooooooooooooooooooooooooooooo foooooooooooooooooooooooooooooooo 4 | foooooooooooooooooooooooooooooooo 5 | -------------------------------------------------------------------------------- /data/Test301.hs: -------------------------------------------------------------------------------- 1 | func = fooooooooooooooooooooooooooooooooo + foooooooooooooooooooooooooooooooo 2 | [ foooooooooooooooooooooooooooooooo 3 | , foooooooooooooooooooooooooooooooo 4 | , foooooooooooooooooooooooooooooooo 5 | ] 6 | -------------------------------------------------------------------------------- /data/Test302.hs: -------------------------------------------------------------------------------- 1 | parserPrim = 2 | [ r 3 | | r <- 4 | [ SGPPrimFloat $ bool id (0 -) minus $ readGnok "parserPrim" 5 | (d1 ++ d2 ++ d3 ++ d4) 6 | | d2 <- string "." 7 | , d3 <- many1 (oneOf "0123456789") 8 | , _ <- string "f" 9 | ] 10 | <|> [ SGPPrimFloat $ bool id (0 -) minus $ fromIntegral 11 | (readGnok "parserPrim" d1 :: Integer) 12 | | _ <- string "f" 13 | ] 14 | <|> [ SGPPrimInt $ bool id (0 -) minus $ fromIntegral 15 | (readGnok "parserPrim" d1 :: Integer) 16 | | _ <- string "i" 17 | ] 18 | ] 19 | -------------------------------------------------------------------------------- /data/Test303.hs: -------------------------------------------------------------------------------- 1 | samples = (SV.unpackaaaaadat) <&> \f -> 2 | aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa 3 | -------------------------------------------------------------------------------- /data/Test304.hs: -------------------------------------------------------------------------------- 1 | runBrittany tabSize text = do 2 | let config' = staticDefaultConfig 3 | config = config' 4 | { _conf_layout = (_conf_layout config') 5 | { _lconfig_indentAmount = coerce tabSize 6 | } 7 | , _conf_forward = forwardOptionsSyntaxExtsEnabled 8 | } 9 | parsePrintModule config text 10 | -------------------------------------------------------------------------------- /data/Test305.hs: -------------------------------------------------------------------------------- 1 | -- brittany { lconfig_indentPolicy: IndentPolicyLeft } 2 | runBrittany tabSize text = do 3 | let 4 | config' = staticDefaultConfig 5 | config = config' 6 | { _conf_layout = (_conf_layout config') 7 | { _lconfig_indentAmount = coerce tabSize 8 | } 9 | , _conf_forward = forwardOptionsSyntaxExtsEnabled 10 | } 11 | parsePrintModule config text 12 | -------------------------------------------------------------------------------- /data/Test306.hs: -------------------------------------------------------------------------------- 1 | foo = 2 | ( a 3 | , -- comment1 4 | b 5 | -- comment2 6 | , c 7 | ) 8 | -------------------------------------------------------------------------------- /data/Test307.hs: -------------------------------------------------------------------------------- 1 | {-# LANGUAGE TypeApplications #-} 2 | foo = bar @Baz 3 | -------------------------------------------------------------------------------- /data/Test308.hs: -------------------------------------------------------------------------------- 1 | {-# LANGUAGE TypeApplications #-} 2 | layoutPatternBindFinal alignmentToken binderDoc mPatDoc clauseDocs = do 3 | docAlt 4 | $ -- one-line solution 5 | [ docCols 6 | (ColBindingLine alignmentToken) 7 | [ docSeq (patPartInline ++ [guardPart]) 8 | , docSeq 9 | [ appSep $ return binderDoc 10 | , docForceSingleline $ return body 11 | , wherePart 12 | ] 13 | ] 14 | | not hasComments 15 | , [(guards, body, _bodyRaw)] <- [clauseDocs] 16 | , let guardPart = singleLineGuardsDoc guards 17 | , wherePart <- case mWhereDocs of 18 | Nothing -> return @[] $ docEmpty 19 | Just [w] -> return @[] $ docSeq 20 | [ docSeparator 21 | , appSep $ docLit $ Text.pack "where" 22 | , docSetIndentLevel $ docForceSingleline $ return w 23 | ] 24 | _ -> [] 25 | ] 26 | ++ -- one-line solution + where in next line(s) 27 | [ docLines 28 | $ [ docCols 29 | (ColBindingLine alignmentToken) 30 | [ docSeq (patPartInline ++ [guardPart]) 31 | , docSeq 32 | [appSep $ return binderDoc, docForceParSpacing $ return body] 33 | ] 34 | ] 35 | ++ wherePartMultiLine 36 | | [(guards, body, _bodyRaw)] <- [clauseDocs] 37 | , let guardPart = singleLineGuardsDoc guards 38 | , Data.Maybe.isJust mWhereDocs 39 | ] 40 | ++ -- two-line solution + where in next line(s) 41 | [ docLines 42 | $ [ docForceSingleline 43 | $ docSeq (patPartInline ++ [guardPart, return binderDoc]) 44 | , docEnsureIndent BrIndentRegular $ docForceSingleline $ return 45 | body 46 | ] 47 | ++ wherePartMultiLine 48 | | [(guards, body, _bodyRaw)] <- [clauseDocs] 49 | , let guardPart = singleLineGuardsDoc guards 50 | ] 51 | -------------------------------------------------------------------------------- /data/Test309.hs: -------------------------------------------------------------------------------- 1 | {-# LANGUAGE MultiWayIf #-} 2 | func = do 3 | let foo = if 4 | | Constuctoooooooooooooooooooooooooooooooooooor `elem` artics -- TODO 5 | -> max 6 | (defLen - 0.2) -- TODO 7 | (defLen * 0.8) 8 | | otherwise -> max (defLen - 0.05) (defLen * 0.95) -- TODO 9 | return True 10 | -------------------------------------------------------------------------------- /data/Test31.hs: -------------------------------------------------------------------------------- 1 | {-# LANGUAGE ScopedTypeVariables #-} 2 | func :: forall (a :: *) b . a -> b 3 | -------------------------------------------------------------------------------- /data/Test310.hs: -------------------------------------------------------------------------------- 1 | foo n = case n of 2 | 1 -> True 3 | -1 -> False 4 | bar n = case n of 5 | (-2, -2) -> (-2, -2) 6 | -------------------------------------------------------------------------------- /data/Test311.hs: -------------------------------------------------------------------------------- 1 | {-# LANGUAGE TypeApplications #-} 2 | foo = 3 | let a = b @1 4 | cccc = () 5 | in foo 6 | -------------------------------------------------------------------------------- /data/Test312.hs: -------------------------------------------------------------------------------- 1 | {-# LANGUAGE RecordWildCards #-} 2 | v = A { a = 1, .. } where b = 2 3 | -------------------------------------------------------------------------------- /data/Test313.hs: -------------------------------------------------------------------------------- 1 | {-# LANGUAGE RecordWildCards #-} 2 | v = A { .. } where b = 2 3 | -------------------------------------------------------------------------------- /data/Test314.hs: -------------------------------------------------------------------------------- 1 | {-# LANGUAGE RecordWildCards #-} 2 | v = A { a = 1, b = 2, c = 3 } 3 | -------------------------------------------------------------------------------- /data/Test315.hs: -------------------------------------------------------------------------------- 1 | test :: Proxy 'Int 2 | -------------------------------------------------------------------------------- /data/Test316.hs: -------------------------------------------------------------------------------- 1 | test :: Proxy '[ 'True] 2 | -------------------------------------------------------------------------------- /data/Test317.hs: -------------------------------------------------------------------------------- 1 | test :: Proxy '[Bool] 2 | -------------------------------------------------------------------------------- /data/Test318.hs: -------------------------------------------------------------------------------- 1 | {-# LANGUAGE RankNTypes, KindSignatures #-} 2 | func 3 | :: forall m str 4 | . (Str str, Monad m) 5 | => Int 6 | -> Proxy (str :: [*]) 7 | -> m (Tagged str String) 8 | -------------------------------------------------------------------------------- /data/Test319.hs: -------------------------------------------------------------------------------- 1 | widgetsDyn = 2 | [ [ vBox 3 | [ padTop Max outputLinesWidget 4 | , padRight Max wid1 <+> flowWidget -- alignment here is strange/buggy 5 | , padBottom (Pad 5) help 6 | ] 7 | ] 8 | | wid1 <- promptDyn 9 | , (flowWidget, _) <- flowResultD 10 | , outputLinesWidget <- outputLinesWidgetD 11 | , help <- suggestionHelpBox 12 | , parser <- cmdParserD 13 | ] 14 | -------------------------------------------------------------------------------- /data/Test32.hs: -------------------------------------------------------------------------------- 1 | {-# LANGUAGE ScopedTypeVariables #-} 2 | func 3 | :: forall m 4 | . Foo 5 | => ColMap2 6 | -> ColInfo 7 | -> ColInfo 8 | -> ColInfo 9 | -> ColInfo 10 | -> m () 11 | -------------------------------------------------------------------------------- /data/Test320.hs: -------------------------------------------------------------------------------- 1 | fmapuv :: U.Unbox a => (a -> b) -> U.Vector a -> V.Vector b 2 | fmapuv f xs = G.generate (G.length xs) (f . (xs G.!)) 3 | -------------------------------------------------------------------------------- /data/Test321.hs: -------------------------------------------------------------------------------- 1 | cs0 = 0 : [ c / Interval n | c <- cs | n <- [1..] ] 2 | -------------------------------------------------------------------------------- /data/Test322.hs: -------------------------------------------------------------------------------- 1 | {-# LANGUAGE TemplateHaskell #-} 2 | deriveFromJSON (unPrefix "assignPost") ''AssignmentPost 3 | -------------------------------------------------------------------------------- /data/Test323.hs: -------------------------------------------------------------------------------- 1 | main = -- a 2 | let --b 3 | x = 1 -- x 4 | y = 2 -- y 5 | in do 6 | print x 7 | print y 8 | -------------------------------------------------------------------------------- /data/Test324.hs: -------------------------------------------------------------------------------- 1 | alternatives :: Parser (Maybe Text) 2 | alternatives = 3 | alternativeOne -- first try this one 4 | <|> alterantiveTwo -- then this one 5 | <|> alternativeThree -- then this one 6 | where 7 | alternativeOne = purer "one" 8 | alternativeTwo = purer "two" 9 | alterantiveThree = purer "three" 10 | -------------------------------------------------------------------------------- /data/Test325.hs: -------------------------------------------------------------------------------- 1 | {-# LANGUAGE BangPatterns #-} 2 | func = do 3 | let !forced = some 4 | pure () 5 | -------------------------------------------------------------------------------- /data/Test326.hs: -------------------------------------------------------------------------------- 1 | spanKey p q = case minViewWithKey q of 2 | Just ((k, _), q') | p k -> 3 | let (kas, q'') = spanKey p q' in ((k, a) : kas, q'') 4 | _ -> ([], q) 5 | -------------------------------------------------------------------------------- /data/Test327.hs: -------------------------------------------------------------------------------- 1 | a :: () ':- () 2 | -------------------------------------------------------------------------------- /data/Test328.hs: -------------------------------------------------------------------------------- 1 | func = do 2 | createDirectoryIfMissing True path 3 | openFile fileName AppendMode 4 | -------------------------------------------------------------------------------- /data/Test329.hs: -------------------------------------------------------------------------------- 1 | alternatives :: Parser (Maybe Text) 2 | alternatives = -- a 3 | ( -- b 4 | alternativeOne -- c 5 | <|> alterantiveTwo -- d 6 | <|> alternativeThree -- e 7 | ) -- f 8 | -------------------------------------------------------------------------------- /data/Test33.hs: -------------------------------------------------------------------------------- 1 | {-# LANGUAGE ScopedTypeVariables #-} 2 | func 3 | :: forall m 4 | . ColMap2 5 | -> ColInfo 6 | -> ColInfo 7 | -> ColInfo 8 | -> ColInfo 9 | -> ColInfo 10 | -> m () 11 | -------------------------------------------------------------------------------- /data/Test330.hs: -------------------------------------------------------------------------------- 1 | {-# LANGUAGE ScopedTypeVariables #-} 2 | func 3 | :: forall a 4 | . () 5 | => aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa 6 | -> aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa 7 | func 8 | :: () 9 | => aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa 10 | -> aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa 11 | -------------------------------------------------------------------------------- /data/Test331.hs: -------------------------------------------------------------------------------- 1 | go l [] = Right l 2 | go l ((IRType, _a) : eqr) = go l eqr 3 | go l ((_, IRType) : eqr) = go l eqr 4 | go _ ((IRTypeError ps t1 t2, _) : _) = Left $ makeError ps t1 t2 5 | go _ ((_, IRTypeError ps t1 t2) : _) = Left $ makeError ps t1 t2 6 | -------------------------------------------------------------------------------- /data/Test332.hs: -------------------------------------------------------------------------------- 1 | type instance XPure StageParse = () 2 | type Pair a = (a, a) 3 | -------------------------------------------------------------------------------- /data/Test333.hs: -------------------------------------------------------------------------------- 1 | -- brittany { lconfig_indentAmount: 4, lconfig_indentPolicy: IndentPolicyMultiple } 2 | dsfnjKeekbwwbosbOfakxqRsiyix cnehokzozwbVaguvu migbnaRwutbz = 3 | let 4 | eyuAfrarIso' 5 | :: (RveoexdxunuAafalm -> Axlau (Axlau (a, OinejrdCplle))) 6 | -> Gbodoy 7 | -> Axlau (Axlau OinejrdCplle, Gbodoy) 8 | eyuAfrarIso' = ulcPaaekBst cnehokzozwbVaguvu 9 | amkgoxEhalazJjxunecCuIfaw 10 | :: Axlau (Axlau OinejrdCplle, Gbodoy) -> Axlau RqlnrluYqednbCiggxi 11 | amkgoxEhalazJjxunecCuIfaw uKqviuBisjtn = do 12 | (sEmo, quc) <- uKqviuBisjtn 13 | pure (xoheccewfWoeyiagOkfodiq sEmo quc) 14 | xoheccewfWoeyiagOkfodiq 15 | :: Axlau OinejrdCplle -> Gbodoy -> RqlnrluYqednbCiggxi 16 | xoheccewfWoeyiagOkfodiq sEmo quc = case migbnaRwutbz of 17 | Afogmf -> xgeqe (OfBkkuih quc) (Ciitog quc) sEmo 18 | in QabqyilexuiNizzhsQuxxac migbnaRwutbz (hwaTihhjt lhowvscIiozgqe) 19 | -------------------------------------------------------------------------------- /data/Test334.hs: -------------------------------------------------------------------------------- 1 | spec = do 2 | it "creates a snapshot at the given level" . withGraph runDB $ do 3 | lift $ do 4 | studentDiagnosticReadingLevel updatedStudent `shouldBe` Just 10 -- x 5 | elaSnapshotReadingLevel snapshot `shouldBe` 12 6 | -------------------------------------------------------------------------------- /data/Test335.hs: -------------------------------------------------------------------------------- 1 | jaicyhHumzo btrKpeyiFej mava = do 2 | m :: VtohxeRgpmgsu <- qloxIfiq mava 3 | case m of 4 | ZumnaoFujayerIswadabo kkecm chlixxag -> do 5 | imomue <- ozisduRaqiseSBAob btrKpeyiFej $ \s -> 6 | case MizA.pigevo kkecm (_tc_gulawulu s) of 7 | Ebocaba -> 8 | ( s { _tc_gulawulu = MizA.jxariu kkecm rwuRqxzhjo (_tc_gulawulu s) } 9 | , Gtzvonm 10 | ) 11 | Xcde{} -> (s, Pioemav) 12 | pure imomue 13 | -------------------------------------------------------------------------------- /data/Test336.hs: -------------------------------------------------------------------------------- 1 | -- brittany { lconfig_indentPolicy: IndentPolicyMultiple } 2 | foo = bar 3 | arg1 -- this is the first argument 4 | arg2 -- this is the second argument 5 | arg3 -- this is the third argument, now I'll skip one comment 6 | arg4 7 | arg5 -- this is the fifth argument 8 | arg6 -- this is the sixth argument 9 | -------------------------------------------------------------------------------- /data/Test337.hs: -------------------------------------------------------------------------------- 1 | True `nand` True = False 2 | nand _ _ = True 3 | nor False False = True 4 | _ `nor` _ = False 5 | -------------------------------------------------------------------------------- /data/Test338.hs: -------------------------------------------------------------------------------- 1 | f ((:) a as) = undefined 2 | -------------------------------------------------------------------------------- /data/Test339.hs: -------------------------------------------------------------------------------- 1 | {-# LANGUAGE BangPatterns #-} 2 | a = \x -> x 3 | b = \ ~x -> x 4 | c = \ !x -> x 5 | d = \(~x) -> x 6 | -------------------------------------------------------------------------------- /data/Test34.hs: -------------------------------------------------------------------------------- 1 | {-# LANGUAGE RankNTypes #-} 2 | addFlagStringParam 3 | :: forall f out 4 | . (Applicative f) 5 | => String -- ^ short flag chars, i.e. "v" for -v 6 | -> [String] -- ^ list of long names, i.e. ["verbose"] 7 | -> String -- ^ param name 8 | -> Flag String -- ^ properties 9 | -> CmdParser f out String 10 | -------------------------------------------------------------------------------- /data/Test340.hs: -------------------------------------------------------------------------------- 1 | {-# LANGUAGE RankNTypes #-} 2 | func :: forall b . Show b => b -> String 3 | -------------------------------------------------------------------------------- /data/Test341.hs: -------------------------------------------------------------------------------- 1 | {-# LANGUAGE TypeFamilies #-} 2 | f :: ((~) a b) => a -> b 3 | f = id 4 | -------------------------------------------------------------------------------- /data/Test342.hs: -------------------------------------------------------------------------------- 1 | -- brittany { lconfig_indentPolicy: IndentPolicyLeft } 2 | vakjkeSulxudbFokvir = Duotpo 3 | { _ekku_gcrpbze = xgonae (1 :: Int) 4 | , _oola_louwu = FoqsiYcuidx 5 | { _xxagu_umea_iaztoj = xgonae False 6 | , _tuktg_tizo_kfikacygsqf = xgonae False 7 | , _ahzbo_xpow_otq_nzeyufq = xgonae False 8 | , _uagpi_lzps_luy_xcjn = xgonae False 9 | , _dxono_qjef_aqtafq_bes = xgonae False 10 | , _yzuaf_nviy_vuhwxe_ihnbo_uhw = xgonae False 11 | , _iwcit_fzjs_yerakt_dicox_mtryitko = xgonae False 12 | , _ehjim_ucfe_dewarp_newrt_gso = xgonae False 13 | , _ogtxb_ivoj_amqgai_rttui_xuwhetb = xgonae False 14 | , _bhycb_iexz_megaug_qunoa_ohaked = xgonae False 15 | , _nnmbe_uqgt_ewsuga_vaiis = xgonae False 16 | , _otzil_ucvugaiyj_aosoiatunx_asir = xgonae False 17 | } 18 | , _iwsc_lalojz = XqspaiDainqw 19 | { _uajznac_ugah = xgonae (80 :: Int) 20 | , _qayziku_gazibzDejipj = xgonae DewizeCxwgyiKjig 21 | , _auhebll_fiqjxyArfxia = xgonae (2 :: Int) 22 | , _zubfuhq_dupiwnIoophXameeet = xgonae True 23 | , _oavnuqg_opkreyOufuIkifiin = xgonae True 24 | , _ufojfwy_fhuzcePeqwfu = xgonae (50 :: Int) 25 | , _mlosikq_zajdxxSeRoelpf = xgonae (50 :: Int) 26 | , _heemavf_fjgOfoaikh = xgonae (FyoVfvdygaZuzuvbeWarwuq 3) 27 | , _ohxmeoq_ogtbfoPtqezVseu = xgonae (EdjotoLcbapUdiuMmytwoig 0.7) 28 | , _omupuiu_ituamexjuLccwu = xgonae (30 :: Int) 29 | , _xoseksf_atvwwdwaoHanofMyUvujjopoz = xgonae True 30 | , _umuuuat_nuamezwWeqfUqzrnaxwp = xgonae False 31 | , _uuriguz_wixhutbuKecigaFiwosret = xgonae True 32 | , _betohxp_scixaLsvcesErtwItxrnaJmuz = xgonae False 33 | , _lchxgee_olaetGcqzuqxVujenCzexub = xgonae True 34 | , _egeibao_imamkuigqikhZdcbpidokVcixiqew = xgonae False 35 | } 36 | , _nloo_cfmrgZcisiugk = YuwodSavxwnicBekuel 37 | { _oebew_rrtpvthUzlizjAqIwesly = xgonae False 38 | , _blkff_Acxoid = xgonae False 39 | , _datei_YewolAowoqOpunvpgu = xgonae BeekgUzojaPnixxaruJehyPmnnfu 40 | , _ejfrj_eheb_justvh_pumcp_ismya = xgonae False 41 | } 42 | , _kena_uzeddovosoki = NyoRvshullezUpauud 43 | { _mtfuwi_TUVEmoi = xgonae RZXKoytUtogx 44 | , _larqam_adaxPehaylZafeqgpc = xgonae False 45 | } 46 | , _spob_qipaarx = KaxavsmOtoyeaq { _rusrirw_okx = Tajemkix [] } 47 | , _vmah_uivucnfka_ikaquebxay_gzcm = xgonae False 48 | , _qaqb_eykzuyuwi = xgonae False 49 | -- test comment 50 | } 51 | -------------------------------------------------------------------------------- /data/Test343.hs: -------------------------------------------------------------------------------- 1 | -- brittany { lconfig_indentPolicy: IndentPolicyLeft } 2 | vakjkeSulxudbFokvir = Duotpo 3 | { _ekku_gcrpbze = xgonae (1 :: Int) 4 | , _spob_qipaarx = KaxavsmOtoyeaq { _rusrirw_okx = Tajemkix [] } 5 | , _vmah_uivucnfka_ikaquebxay_gzcm = xgonae False 6 | , _qaqb_eykzuyuwi = xgonae False 7 | -- test comment 8 | , -- N.B. 9 | .. -- x 10 | } 11 | -------------------------------------------------------------------------------- /data/Test344.hs: -------------------------------------------------------------------------------- 1 | func = abc + def 2 | -- a 3 | -- b 4 | -- comment 5 | where 6 | abc = 13 7 | def = 1 8 | -------------------------------------------------------------------------------- /data/Test345.hs: -------------------------------------------------------------------------------- 1 | zItazySunefp twgq nlyo lwojjoBiecao = 2 | let mhIarjyai = 3 | ukwAausnfcn 4 | $ XojlsTOSR.vuwOvuvdAZUOJaa 5 | $ XojlsTOSR.vkesForanLiufjeDI 6 | $ XojlsTOSR.vkesForanLiufjeDI 7 | $ XojlsTOSR.popjAyijoWarueeP 8 | $ XojlsTOSR.jpwuPmafuDqlbkt nlyo 9 | $ XojlsTOSR.jpwuPmafuDqlbkt xxneswWhxwng 10 | $ XojlsTOSR.jpwuPmafuDqlbkt oloCuxeDdow 11 | $ XojlsTOSR.jpwuPmafuDqlbkt (uwurrvoNnukzefuDjeh lwojjoBiecao nlyo) 12 | $ etOslnoz lwojjoBiecao 13 | in kucotg $ (bbbr, Yoxe.Dwzbuzi.zrLokoTnuy piv) 14 | -------------------------------------------------------------------------------- /data/Test346.hs: -------------------------------------------------------------------------------- 1 | -- test 2 | module MyModule where 3 | -------------------------------------------------------------------------------- /data/Test347.hs: -------------------------------------------------------------------------------- 1 | foo = 2 | [ ("xxx", "xx") 3 | , -- 4 | ("xx" , "xx") 5 | -- 6 | , ("xx" , "xxxxx") 7 | , ("xx" , "xx") 8 | ] 9 | -------------------------------------------------------------------------------- /data/Test348.hs: -------------------------------------------------------------------------------- 1 | foo = 2 | [ ("xx", "xx") 3 | , ( "xx" -- 4 | , "xx" 5 | ) 6 | , ("xx", "xxxxx") 7 | , ("xx", "xx") 8 | ] 9 | -------------------------------------------------------------------------------- /data/Test349.hs: -------------------------------------------------------------------------------- 1 | module Main 2 | ( DataTypeI 3 | , DataTypeII(DataConstructor) 4 | -- * Haddock heading 5 | , name 6 | ) where 7 | -------------------------------------------------------------------------------- /data/Test35.hs: -------------------------------------------------------------------------------- 1 | {-# LANGUAGE ScopedTypeVariables #-} 2 | func :: forall (a :: *) b . a -> b 3 | -------------------------------------------------------------------------------- /data/Test350.hs: -------------------------------------------------------------------------------- 1 | xeoeqibIaib 2 | :: ( KqujhIsaus m 3 | , XivuvIpoboi Droqifim m 4 | , IgorvOtowtf m 5 | , RyagaYaqac m 6 | , QouruDU m 7 | ) 8 | => MaptAdfuxgu 9 | -> Zcnxg NsxayqmvIjsezea -- ^ if Lvqucoo, opsip jl reyoyhk lfil qaculxgd 10 | -> QNOZqwuzg 11 | -> Eoattuq 12 | '[ XkatytdWdquraosu -- test comment 13 | , KyezKijim -- another test comment 14 | , DjmioeePuoeg 15 | , NinrxoiOwezc 16 | , QATAlrijacpk 17 | , TrutvotwIwifiqOjdtu 18 | , CoMmuatjwr 19 | , BoZckzqyodseZole 20 | , VagfwoXaeChfqe 21 | ] 22 | m 23 | () 24 | -------------------------------------------------------------------------------- /data/Test351.hs: -------------------------------------------------------------------------------- 1 | createRedirectedProcess processConfig = do 2 | let redirectedProc = (_processConfig_inner processConfig) 3 | { std_in = CreatePipe 4 | , std_out = CreatePipe 5 | , std_err = CreatePipe 6 | } 7 | foo 8 | -------------------------------------------------------------------------------- /data/Test352.hs: -------------------------------------------------------------------------------- 1 | instance HasDependencies SomeDataModel where 2 | -- N.B. Here is a bunch of explanatory context about the relationship 3 | -- between these data models or whatever. 4 | type Dependencies SomeDataModel 5 | = (SomeOtherDataModelId, SomeOtherOtherDataModelId) 6 | -------------------------------------------------------------------------------- /data/Test353.hs: -------------------------------------------------------------------------------- 1 | func = 2 | do 3 | y 4 | >>= x 5 | -------------------------------------------------------------------------------- /data/Test354.hs: -------------------------------------------------------------------------------- 1 | -- brittany { lconfig_indentAmount: 4, lconfig_indentPolicy: IndentPolicyMultiple } 2 | func = 3 | mweroiuxlskdfjlksjdflkjsdfljksldkjflkjsdflkj 4 | + mweroiuxlskdfjlksjdflkjsdfljksldkjflkjsdflkj 5 | -------------------------------------------------------------------------------- /data/Test355.hs: -------------------------------------------------------------------------------- 1 | -- brittany { lconfig_indentAmount: 4, lconfig_indentPolicy: IndentPolicyMultiple } 2 | foo = do 3 | let aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa = 4 | aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa + aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa 5 | foo 6 | -------------------------------------------------------------------------------- /data/Test356.hs: -------------------------------------------------------------------------------- 1 | -- brittany { lconfig_indentAmount: 8, lconfig_indentPolicy: IndentPolicyMultiple } 2 | foo = do 3 | let aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa = 4 | aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa + aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa 5 | foo 6 | foo = do 7 | let aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa = 8 | aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa 9 | + aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa 10 | + aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa 11 | foo 12 | -------------------------------------------------------------------------------- /data/Test357.hs: -------------------------------------------------------------------------------- 1 | -- brittany { lconfig_indentAmount: 4, lconfig_indentPolicy: IndentPolicyMultiple } 2 | foo = asdyf8asdf 3 | "ajsdfas" 4 | [ asjdf asyhf $ do 5 | aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa 6 | aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa 7 | ] 8 | -------------------------------------------------------------------------------- /data/Test358.hs: -------------------------------------------------------------------------------- 1 | -- brittany { lconfig_columnAlignMode: { tag: ColumnAlignModeDisabled }, lconfig_indentPolicy: IndentPolicyLeft } 2 | func :: a -> a 3 | -------------------------------------------------------------------------------- /data/Test359.hs: -------------------------------------------------------------------------------- 1 | -- brittany { lconfig_columnAlignMode: { tag: ColumnAlignModeDisabled }, lconfig_indentPolicy: IndentPolicyLeft } 2 | func 3 | :: lkasdlkjalsdjlakjsdlkjasldkjalskdjlkajsd 4 | -> lkasdlkjalsdjlakjsdlkjasldkjalskdjlkajsd 5 | -------------------------------------------------------------------------------- /data/Test36.hs: -------------------------------------------------------------------------------- 1 | func :: a -> b -- comment 2 | -------------------------------------------------------------------------------- /data/Test360.hs: -------------------------------------------------------------------------------- 1 | -- brittany { lconfig_columnAlignMode: { tag: ColumnAlignModeDisabled }, lconfig_indentPolicy: IndentPolicyLeft } 2 | func 3 | :: lkasdlkjalsdjlakjsdlkjasldkjalskdjlkajsd 4 | -> lakjsdlkjasldkj 5 | -> lakjsdlkjasldkj 6 | -------------------------------------------------------------------------------- /data/Test361.hs: -------------------------------------------------------------------------------- 1 | -- brittany { lconfig_columnAlignMode: { tag: ColumnAlignModeDisabled }, lconfig_indentPolicy: IndentPolicyLeft } 2 | func :: ((a)) 3 | -------------------------------------------------------------------------------- /data/Test362.hs: -------------------------------------------------------------------------------- 1 | -- brittany { lconfig_columnAlignMode: { tag: ColumnAlignModeDisabled }, lconfig_indentPolicy: IndentPolicyLeft } 2 | func :: (a -> a) -> a 3 | -------------------------------------------------------------------------------- /data/Test363.hs: -------------------------------------------------------------------------------- 1 | -- brittany { lconfig_columnAlignMode: { tag: ColumnAlignModeDisabled }, lconfig_indentPolicy: IndentPolicyLeft } 2 | func :: a -> (a -> a) 3 | -------------------------------------------------------------------------------- /data/Test364.hs: -------------------------------------------------------------------------------- 1 | -- brittany { lconfig_columnAlignMode: { tag: ColumnAlignModeDisabled }, lconfig_indentPolicy: IndentPolicyLeft } 2 | func :: (((((((((()))))))))) 3 | -- current output is.. funny. wonder if that can/needs to be improved.. 4 | -------------------------------------------------------------------------------- /data/Test365.hs: -------------------------------------------------------------------------------- 1 | -- brittany { lconfig_columnAlignMode: { tag: ColumnAlignModeDisabled }, lconfig_indentPolicy: IndentPolicyLeft } 2 | func :: () 3 | -------------------------------------------------------------------------------- /data/Test366.hs: -------------------------------------------------------------------------------- 1 | -- brittany { lconfig_columnAlignMode: { tag: ColumnAlignModeDisabled }, lconfig_indentPolicy: IndentPolicyLeft } 2 | func 3 | :: ( lkasdlkjalsdjlakjsdlkjasldkjalskdjlkajsd 4 | -> lakjsdlkjasldkj 5 | -> lakjsdlkjasldkj 6 | ) 7 | -------------------------------------------------------------------------------- /data/Test367.hs: -------------------------------------------------------------------------------- 1 | -- brittany { lconfig_columnAlignMode: { tag: ColumnAlignModeDisabled }, lconfig_indentPolicy: IndentPolicyLeft } 2 | func 3 | :: lkasdlkjalsdjlakjsdlkjasldkjalskdjlkajsd 4 | -> (lakjsdlkjasldkj -> lakjsdlkjasldkj) 5 | -------------------------------------------------------------------------------- /data/Test368.hs: -------------------------------------------------------------------------------- 1 | -- brittany { lconfig_columnAlignMode: { tag: ColumnAlignModeDisabled }, lconfig_indentPolicy: IndentPolicyLeft } 2 | func 3 | :: (lkasdlkjalsdjlakjsdlkjasldkjalskdjlkajsd -> lakjsdlkjasldkj) 4 | -> lakjsdlkjasldkj 5 | -------------------------------------------------------------------------------- /data/Test369.hs: -------------------------------------------------------------------------------- 1 | -- brittany { lconfig_columnAlignMode: { tag: ColumnAlignModeDisabled }, lconfig_indentPolicy: IndentPolicyLeft } 2 | func 3 | :: ( lkasdlkjalsdjlakjsdlkjasldkjalskdjlkajsd 4 | -> lkasdlkjalsdjlakjsdlkjasldkjalskdjlkajsd 5 | ) 6 | -> lakjsdlkjasldkj 7 | -------------------------------------------------------------------------------- /data/Test37.hs: -------------------------------------------------------------------------------- 1 | funcA :: a -> b -- comment A 2 | funcB :: a -> b -- comment B 3 | -------------------------------------------------------------------------------- /data/Test370.hs: -------------------------------------------------------------------------------- 1 | -- brittany { lconfig_columnAlignMode: { tag: ColumnAlignModeDisabled }, lconfig_indentPolicy: IndentPolicyLeft } 2 | func 3 | :: ( ( lkasdlkjalsdjlakjsdlkjasldkjalskdjlkajsd 4 | -> lkasdlkjalsdjlakjsdlkjasldkjalskdjlkajsd 5 | ) 6 | ) 7 | -------------------------------------------------------------------------------- /data/Test371.hs: -------------------------------------------------------------------------------- 1 | -- brittany { lconfig_columnAlignMode: { tag: ColumnAlignModeDisabled }, lconfig_indentPolicy: IndentPolicyLeft } 2 | func :: asd -> Either a b 3 | -------------------------------------------------------------------------------- /data/Test372.hs: -------------------------------------------------------------------------------- 1 | -- brittany { lconfig_columnAlignMode: { tag: ColumnAlignModeDisabled }, lconfig_indentPolicy: IndentPolicyLeft } 2 | func 3 | :: asd 4 | -> Either 5 | lkasdlkjalsdjlakjsdlkjasldkjalskdjlkajsd 6 | lkasdlkjalsdjlakjsdlkjasldkjalskdjlkajsd 7 | -------------------------------------------------------------------------------- /data/Test373.hs: -------------------------------------------------------------------------------- 1 | -- brittany { lconfig_columnAlignMode: { tag: ColumnAlignModeDisabled }, lconfig_indentPolicy: IndentPolicyLeft } 2 | func 3 | :: asd 4 | -> Trither 5 | lkasdlkjalsdjlakjsdlkjasldkjalskdjlkajsd 6 | lkasdlkjalsdjlakjsdlkjasldkjalskdjlkajsd 7 | lkasdlkjalsdjlakjsdlkjasldkjalskdjlkajsd 8 | -------------------------------------------------------------------------------- /data/Test374.hs: -------------------------------------------------------------------------------- 1 | -- brittany { lconfig_columnAlignMode: { tag: ColumnAlignModeDisabled }, lconfig_indentPolicy: IndentPolicyLeft } 2 | func 3 | :: Trither 4 | lkasdlkjalsdjlakjsdlkjasldkjalskdjlkajsd 5 | lkasdlkjalsdjlakjsdlkjasldkjalskdjlkajsd 6 | lkasdlkjalsdjlakjsdlkjasldkjalskdjlkajsd 7 | -> asd 8 | -------------------------------------------------------------------------------- /data/Test375.hs: -------------------------------------------------------------------------------- 1 | -- brittany { lconfig_columnAlignMode: { tag: ColumnAlignModeDisabled }, lconfig_indentPolicy: IndentPolicyLeft } 2 | func 3 | :: Trither 4 | lkasdlkjalsdjlakjsdlkjasldkjalskdjlkajsd 5 | lkasdlkjalsdjlakjsdlkjasldkjalskdjlkajsd 6 | (lkasdlkjalsdjlakjsdlkjasldkjalskdjlkajsd -> asd) 7 | -------------------------------------------------------------------------------- /data/Test376.hs: -------------------------------------------------------------------------------- 1 | -- brittany { lconfig_columnAlignMode: { tag: ColumnAlignModeDisabled }, lconfig_indentPolicy: IndentPolicyLeft } 2 | func 3 | :: Trither 4 | asd 5 | lkasdlkjalsdjlakjsdlkjasldkjalskdjlkajsd 6 | ( lkasdlkjalsdjlakjsdlkjasldkjalskdjlkajsd 7 | -> lkasdlkjalsdjlakjsdlkjasldkjalskdjlkajsd 8 | ) 9 | -------------------------------------------------------------------------------- /data/Test377.hs: -------------------------------------------------------------------------------- 1 | -- brittany { lconfig_columnAlignMode: { tag: ColumnAlignModeDisabled }, lconfig_indentPolicy: IndentPolicyLeft } 2 | func 3 | :: asd 4 | -> ( Trither 5 | lkasdlkjalsdjlakjsdlkjasldkjalskdjlkajsd 6 | lkasdlkjalsdjlakjsdlkjasldkjalskdjlkajsd 7 | lkasdlkjalsdjlakjsdlkjasldkjalskdjlkajsd 8 | ) 9 | -------------------------------------------------------------------------------- /data/Test378.hs: -------------------------------------------------------------------------------- 1 | -- brittany { lconfig_columnAlignMode: { tag: ColumnAlignModeDisabled }, lconfig_indentPolicy: IndentPolicyLeft } 2 | func 3 | :: asd 4 | -> ( Trither 5 | lkasdlkjalsdjlakjsdlkjasldkjalskdjlkajsd 6 | lkasdlkjalsdjlakjsdlkjasldkjalskdjlkajsd 7 | ) 8 | lkasdlkjalsdjlakjsdlkjasldkjalskdjlkajsd 9 | -------------------------------------------------------------------------------- /data/Test379.hs: -------------------------------------------------------------------------------- 1 | -- brittany { lconfig_columnAlignMode: { tag: ColumnAlignModeDisabled }, lconfig_indentPolicy: IndentPolicyLeft } 2 | func 3 | :: ( Trither 4 | lkasdlkjalsdjlakjsdlkjasldkjalskdjlkajsd 5 | lkasdlkjalsdjlakjsdlkjasldkjalskdjlkajsd 6 | ) 7 | lkasdlkjalsdjlakjsdlkjasldkjalskdjlkajsd 8 | -> asd 9 | -------------------------------------------------------------------------------- /data/Test38.hs: -------------------------------------------------------------------------------- 1 | -- a 2 | func -- b 3 | :: -- c 4 | a -- d 5 | -> -- e 6 | ( -- f 7 | c -- g 8 | , -- h 9 | d -- i 10 | ) -- j 11 | -- k 12 | -------------------------------------------------------------------------------- /data/Test380.hs: -------------------------------------------------------------------------------- 1 | -- brittany { lconfig_columnAlignMode: { tag: ColumnAlignModeDisabled }, lconfig_indentPolicy: IndentPolicyLeft } 2 | func :: [a -> b] 3 | -------------------------------------------------------------------------------- /data/Test381.hs: -------------------------------------------------------------------------------- 1 | -- brittany { lconfig_columnAlignMode: { tag: ColumnAlignModeDisabled }, lconfig_indentPolicy: IndentPolicyLeft } 2 | func 3 | :: [ lkasdlkjalsdjlakjsdlkjasldkjalskdjlkajsd 4 | -> lkasdlkjalsdjlakjsdlkjasldkjalskdjlkajsd 5 | ] 6 | -------------------------------------------------------------------------------- /data/Test382.hs: -------------------------------------------------------------------------------- 1 | -- brittany { lconfig_columnAlignMode: { tag: ColumnAlignModeDisabled }, lconfig_indentPolicy: IndentPolicyLeft } 2 | func 3 | :: [ ( lkasdlkjalsdjlakjsdlkjasldkjalskdjlkajsd 4 | -> lkasdlkjalsdjlakjsdlkjasldkjalskdjlkajsd 5 | ) 6 | ] 7 | -------------------------------------------------------------------------------- /data/Test383.hs: -------------------------------------------------------------------------------- 1 | -- brittany { lconfig_columnAlignMode: { tag: ColumnAlignModeDisabled }, lconfig_indentPolicy: IndentPolicyLeft } 2 | func :: (a, b, c) 3 | -------------------------------------------------------------------------------- /data/Test384.hs: -------------------------------------------------------------------------------- 1 | -- brittany { lconfig_columnAlignMode: { tag: ColumnAlignModeDisabled }, lconfig_indentPolicy: IndentPolicyLeft } 2 | func :: ((a, b, c), (a, b, c), (a, b, c)) 3 | -------------------------------------------------------------------------------- /data/Test385.hs: -------------------------------------------------------------------------------- 1 | -- brittany { lconfig_columnAlignMode: { tag: ColumnAlignModeDisabled }, lconfig_indentPolicy: IndentPolicyLeft } 2 | func 3 | :: ( lkasdlkjalsdjlakjsdlkjasldkjalskdjlkajsd 4 | , lkasdlkjalsdjlakjsdlkjasldkjalskdjlkajsd 5 | , lkasdlkjalsdjlakjsdlkjasldkjalskdjlkajsd 6 | ) 7 | -------------------------------------------------------------------------------- /data/Test386.hs: -------------------------------------------------------------------------------- 1 | -- brittany { lconfig_columnAlignMode: { tag: ColumnAlignModeDisabled }, lconfig_indentPolicy: IndentPolicyLeft } 2 | func 3 | :: ( ( lkasdlkjalsdjlakjsdlkjasldkjalskdjlkajsd 4 | , (lkasdlkjalsdjlakjsdlkjasldkjalskdjlkajsd) 5 | , lkasdlkjalsdjlakjsdlkjasldkjalskdjlkajsd 6 | ) 7 | ) 8 | -------------------------------------------------------------------------------- /data/Test387.hs: -------------------------------------------------------------------------------- 1 | -- brittany { lconfig_columnAlignMode: { tag: ColumnAlignModeDisabled }, lconfig_indentPolicy: IndentPolicyLeft } 2 | func 3 | :: [ ( lkasdlkjalsdjlakjsdlkjasldkjalskdjlkajsd 4 | , lkasdlkjalsdjlakjsdlkjasldkjalskdjlkajsd 5 | , lkasdlkjalsdjlakjsdlkjasldkjalskdjlkajsd 6 | ) 7 | ] 8 | -------------------------------------------------------------------------------- /data/Test388.hs: -------------------------------------------------------------------------------- 1 | -- brittany { lconfig_columnAlignMode: { tag: ColumnAlignModeDisabled }, lconfig_indentPolicy: IndentPolicyLeft } 2 | {-# LANGUAGE ScopedTypeVariables #-} 3 | func :: forall (a :: *) b . a -> b 4 | -------------------------------------------------------------------------------- /data/Test389.hs: -------------------------------------------------------------------------------- 1 | -- brittany { lconfig_columnAlignMode: { tag: ColumnAlignModeDisabled }, lconfig_indentPolicy: IndentPolicyLeft } 2 | {-# LANGUAGE ScopedTypeVariables #-} 3 | func 4 | :: forall m 5 | . Foo 6 | => ColMap2 7 | -> ColInfo 8 | -> ColInfo 9 | -> ColInfo 10 | -> ColInfo 11 | -> m () 12 | -------------------------------------------------------------------------------- /data/Test39.hs: -------------------------------------------------------------------------------- 1 | func = f 2 | where 3 | {-# INLINE f #-} 4 | f = id 5 | -------------------------------------------------------------------------------- /data/Test390.hs: -------------------------------------------------------------------------------- 1 | -- brittany { lconfig_columnAlignMode: { tag: ColumnAlignModeDisabled }, lconfig_indentPolicy: IndentPolicyLeft } 2 | {-# LANGUAGE ScopedTypeVariables #-} 3 | func 4 | :: forall m 5 | . ColMap2 6 | -> ColInfo 7 | -> ColInfo 8 | -> ColInfo 9 | -> ColInfo 10 | -> ColInfo 11 | -> m () 12 | -------------------------------------------------------------------------------- /data/Test391.hs: -------------------------------------------------------------------------------- 1 | -- brittany { lconfig_columnAlignMode: { tag: ColumnAlignModeDisabled }, lconfig_indentPolicy: IndentPolicyLeft } 2 | {-# LANGUAGE ScopedTypeVariables #-} 3 | func :: forall (a :: *) b . a -> b 4 | -------------------------------------------------------------------------------- /data/Test392.hs: -------------------------------------------------------------------------------- 1 | -- brittany { lconfig_columnAlignMode: { tag: ColumnAlignModeDisabled }, lconfig_indentPolicy: IndentPolicyLeft } 2 | func :: a -> b -- comment 3 | -------------------------------------------------------------------------------- /data/Test393.hs: -------------------------------------------------------------------------------- 1 | -- brittany { lconfig_columnAlignMode: { tag: ColumnAlignModeDisabled }, lconfig_indentPolicy: IndentPolicyLeft } 2 | funcA :: a -> b -- comment A 3 | funcB :: a -> b -- comment B 4 | -------------------------------------------------------------------------------- /data/Test394.hs: -------------------------------------------------------------------------------- 1 | -- brittany { lconfig_columnAlignMode: { tag: ColumnAlignModeDisabled }, lconfig_indentPolicy: IndentPolicyLeft } 2 | -- a 3 | func -- b 4 | :: -- c 5 | a -- d 6 | -> -- e 7 | ( -- f 8 | c -- g 9 | , -- h 10 | d -- i 11 | ) -- j-- k 12 | -------------------------------------------------------------------------------- /data/Test395.hs: -------------------------------------------------------------------------------- 1 | -- brittany { lconfig_columnAlignMode: { tag: ColumnAlignModeDisabled }, lconfig_indentPolicy: IndentPolicyLeft } 2 | {-# LANGUAGE ImplicitParams #-} 3 | func :: (?asd::Int) -> () 4 | -------------------------------------------------------------------------------- /data/Test396.hs: -------------------------------------------------------------------------------- 1 | -- brittany { lconfig_columnAlignMode: { tag: ColumnAlignModeDisabled }, lconfig_indentPolicy: IndentPolicyLeft } 2 | {-# LANGUAGE ImplicitParams #-} 3 | func 4 | :: ( ?asd 5 | :: lkasdlkjalsdjlakjsdlkjasldkjalskdjlkajsd 6 | -> lkasdlkjalsdjlakjsdlkjasldkjalskdjlkajsd 7 | ) 8 | -> () 9 | -------------------------------------------------------------------------------- /data/Test397.hs: -------------------------------------------------------------------------------- 1 | -- brittany { lconfig_columnAlignMode: { tag: ColumnAlignModeDisabled }, lconfig_indentPolicy: IndentPolicyLeft } 2 | func = f 3 | where 4 | {-# INLINE f #-} 5 | f = id 6 | -------------------------------------------------------------------------------- /data/Test398.hs: -------------------------------------------------------------------------------- 1 | -- brittany { lconfig_columnAlignMode: { tag: ColumnAlignModeDisabled }, lconfig_indentPolicy: IndentPolicyLeft } 2 | func = ($) 3 | where 4 | {-# INLINE ($) #-} 5 | ($) = id 6 | -------------------------------------------------------------------------------- /data/Test399.hs: -------------------------------------------------------------------------------- 1 | -- brittany { lconfig_columnAlignMode: { tag: ColumnAlignModeDisabled }, lconfig_indentPolicy: IndentPolicyLeft } 2 | func = f 3 | where 4 | {-# INLINE CONLIKE [1] f #-} 5 | f = id 6 | -------------------------------------------------------------------------------- /data/Test4.hs: -------------------------------------------------------------------------------- 1 | func :: ((a)) 2 | -------------------------------------------------------------------------------- /data/Test40.hs: -------------------------------------------------------------------------------- 1 | func = ($) 2 | where 3 | {-# INLINE ($) #-} 4 | ($) = id 5 | -------------------------------------------------------------------------------- /data/Test400.hs: -------------------------------------------------------------------------------- 1 | -- brittany { lconfig_columnAlignMode: { tag: ColumnAlignModeDisabled }, lconfig_indentPolicy: IndentPolicyLeft } 2 | func = f 3 | where 4 | {-# INLINE [~1] f #-} 5 | f = id 6 | -------------------------------------------------------------------------------- /data/Test401.hs: -------------------------------------------------------------------------------- 1 | -- brittany { lconfig_columnAlignMode: { tag: ColumnAlignModeDisabled }, lconfig_indentPolicy: IndentPolicyLeft } 2 | data Foo = Bar 3 | { foo :: Baz 4 | } 5 | -------------------------------------------------------------------------------- /data/Test402.hs: -------------------------------------------------------------------------------- 1 | -- brittany { lconfig_columnAlignMode: { tag: ColumnAlignModeDisabled }, lconfig_indentPolicy: IndentPolicyLeft } 2 | data Foo = Bar 3 | { foo, bar :: Baz 4 | } 5 | -------------------------------------------------------------------------------- /data/Test403.hs: -------------------------------------------------------------------------------- 1 | -- brittany { lconfig_columnAlignMode: { tag: ColumnAlignModeDisabled }, lconfig_indentPolicy: IndentPolicyLeft } 2 | data Foo = Bar 3 | { foo :: Baz 4 | , bar :: Bizzz 5 | } 6 | -------------------------------------------------------------------------------- /data/Test404.hs: -------------------------------------------------------------------------------- 1 | -- brittany { lconfig_columnAlignMode: { tag: ColumnAlignModeDisabled }, lconfig_indentPolicy: IndentPolicyLeft } 2 | data Foo = Bar 3 | { foo, biz :: Baz 4 | , bar :: Bizzz 5 | } 6 | -------------------------------------------------------------------------------- /data/Test405.hs: -------------------------------------------------------------------------------- 1 | -- brittany { lconfig_columnAlignMode: { tag: ColumnAlignModeDisabled }, lconfig_indentPolicy: IndentPolicyLeft } 2 | data Foo = Bar 3 | { foo :: Baz 4 | , bar :: Bizzz 5 | } 6 | deriving Show 7 | -------------------------------------------------------------------------------- /data/Test406.hs: -------------------------------------------------------------------------------- 1 | -- brittany { lconfig_columnAlignMode: { tag: ColumnAlignModeDisabled }, lconfig_indentPolicy: IndentPolicyLeft } 2 | data Foo = Bar 3 | { foo :: Baz 4 | , bar :: Bizzz 5 | } 6 | deriving (Show, Eq, Monad, Functor, Traversable, Foldable) 7 | -------------------------------------------------------------------------------- /data/Test407.hs: -------------------------------------------------------------------------------- 1 | -- brittany { lconfig_columnAlignMode: { tag: ColumnAlignModeDisabled }, lconfig_indentPolicy: IndentPolicyLeft } 2 | func x = x 3 | -------------------------------------------------------------------------------- /data/Test408.hs: -------------------------------------------------------------------------------- 1 | -- brittany { lconfig_columnAlignMode: { tag: ColumnAlignModeDisabled }, lconfig_indentPolicy: IndentPolicyLeft } 2 | x *** y = x 3 | -------------------------------------------------------------------------------- /data/Test409.hs: -------------------------------------------------------------------------------- 1 | -- brittany { lconfig_columnAlignMode: { tag: ColumnAlignModeDisabled }, lconfig_indentPolicy: IndentPolicyLeft } 2 | (***) x y = x 3 | -------------------------------------------------------------------------------- /data/Test41.hs: -------------------------------------------------------------------------------- 1 | func = f 2 | where 3 | {-# INLINE CONLIKE [1] f #-} 4 | f = id 5 | -------------------------------------------------------------------------------- /data/Test410.hs: -------------------------------------------------------------------------------- 1 | -- brittany { lconfig_columnAlignMode: { tag: ColumnAlignModeDisabled }, lconfig_indentPolicy: IndentPolicyLeft } 2 | func _ = x 3 | -------------------------------------------------------------------------------- /data/Test411.hs: -------------------------------------------------------------------------------- 1 | -- brittany { lconfig_columnAlignMode: { tag: ColumnAlignModeDisabled }, lconfig_indentPolicy: IndentPolicyLeft } 2 | func reallyreallyreallyreallyreallyreallyreallyreallyreallyreallylongvariable = 3 | x 4 | -------------------------------------------------------------------------------- /data/Test412.hs: -------------------------------------------------------------------------------- 1 | -- brittany { lconfig_columnAlignMode: { tag: ColumnAlignModeDisabled }, lconfig_indentPolicy: IndentPolicyLeft } 2 | func reallyreallyreallyreallyreallyreallyreallyreallyreallyreallylongvariable reallyreallyreallyreallyreallyreallyreallyreallyreallyreallylongvariable 3 | = x 4 | -------------------------------------------------------------------------------- /data/Test413.hs: -------------------------------------------------------------------------------- 1 | -- brittany { lconfig_columnAlignMode: { tag: ColumnAlignModeDisabled }, lconfig_indentPolicy: IndentPolicyLeft } 2 | func reallyreallyreallyreallyreallyreallyreallyreallyreallyreallylongvariable a b 3 | = x 4 | -------------------------------------------------------------------------------- /data/Test414.hs: -------------------------------------------------------------------------------- 1 | -- brittany { lconfig_columnAlignMode: { tag: ColumnAlignModeDisabled }, lconfig_indentPolicy: IndentPolicyLeft } 2 | func (A a) = a 3 | -------------------------------------------------------------------------------- /data/Test415.hs: -------------------------------------------------------------------------------- 1 | -- brittany { lconfig_columnAlignMode: { tag: ColumnAlignModeDisabled }, lconfig_indentPolicy: IndentPolicyLeft } 2 | func (x : xr) = x 3 | -------------------------------------------------------------------------------- /data/Test416.hs: -------------------------------------------------------------------------------- 1 | -- brittany { lconfig_columnAlignMode: { tag: ColumnAlignModeDisabled }, lconfig_indentPolicy: IndentPolicyLeft } 2 | func (x :+: xr) = x 3 | -------------------------------------------------------------------------------- /data/Test417.hs: -------------------------------------------------------------------------------- 1 | -- brittany { lconfig_columnAlignMode: { tag: ColumnAlignModeDisabled }, lconfig_indentPolicy: IndentPolicyLeft } 2 | func | True = x 3 | -------------------------------------------------------------------------------- /data/Test418.hs: -------------------------------------------------------------------------------- 1 | -- brittany { lconfig_columnAlignMode: { tag: ColumnAlignModeDisabled }, lconfig_indentPolicy: IndentPolicyLeft } 2 | func x 3 | | x = simple expression 4 | | otherwise = 0 5 | -------------------------------------------------------------------------------- /data/Test419.hs: -------------------------------------------------------------------------------- 1 | -- brittany { lconfig_columnAlignMode: { tag: ColumnAlignModeDisabled }, lconfig_indentPolicy: IndentPolicyLeft } 2 | func x 3 | | a somewhat longer guard x = "and a somewhat longer expession that does not" 4 | | otherwise = "fit without putting the guards in new lines" 5 | -------------------------------------------------------------------------------- /data/Test42.hs: -------------------------------------------------------------------------------- 1 | {-# NOINLINE func #-} 2 | func :: Int 3 | -------------------------------------------------------------------------------- /data/Test420.hs: -------------------------------------------------------------------------------- 1 | -- brittany { lconfig_columnAlignMode: { tag: ColumnAlignModeDisabled }, lconfig_indentPolicy: IndentPolicyLeft } 2 | func x 3 | | very long guard, another rather long guard that refers to x = nontrivial 4 | expression 5 | foo 6 | bar 7 | alsdkjlasdjlasj 8 | | otherwise = 0 9 | -------------------------------------------------------------------------------- /data/Test421.hs: -------------------------------------------------------------------------------- 1 | -- brittany { lconfig_columnAlignMode: { tag: ColumnAlignModeDisabled }, lconfig_indentPolicy: IndentPolicyLeft } 2 | func x 3 | | very long guard, another rather long guard that refers to x 4 | = nontrivialexpression foo bar alsdkjlasdjlasj 5 | | otherwise 6 | = 0 7 | -------------------------------------------------------------------------------- /data/Test422.hs: -------------------------------------------------------------------------------- 1 | -- brittany { lconfig_columnAlignMode: { tag: ColumnAlignModeDisabled }, lconfig_indentPolicy: IndentPolicyLeft } 2 | func x 3 | | very loooooooooooooooooooooooooooooong guard 4 | , another rather long guard that refers to x 5 | = nontrivial expression foo bar alsdkjlasdjlasj 6 | | otherwise 7 | = 0 8 | -------------------------------------------------------------------------------- /data/Test423.hs: -------------------------------------------------------------------------------- 1 | -- brittany { lconfig_columnAlignMode: { tag: ColumnAlignModeDisabled }, lconfig_indentPolicy: IndentPolicyLeft } 2 | func = x 3 | describe "infix op" $ do 4 | -------------------------------------------------------------------------------- /data/Test424.hs: -------------------------------------------------------------------------------- 1 | -- brittany { lconfig_columnAlignMode: { tag: ColumnAlignModeDisabled }, lconfig_indentPolicy: IndentPolicyLeft } 2 | func = x + x 3 | -------------------------------------------------------------------------------- /data/Test425.hs: -------------------------------------------------------------------------------- 1 | -- brittany { lconfig_columnAlignMode: { tag: ColumnAlignModeDisabled }, lconfig_indentPolicy: IndentPolicyLeft } 2 | func = 3 | mweroiuxlskdfjlksjdflkjsdfljksldkjflkjsdflkj 4 | + mweroiuxlskdfjlksjdflkjsdfljksldkjflkjsdflkj 5 | -------------------------------------------------------------------------------- /data/Test426.hs: -------------------------------------------------------------------------------- 1 | -- brittany { lconfig_columnAlignMode: { tag: ColumnAlignModeDisabled }, lconfig_indentPolicy: IndentPolicyLeft } 2 | func = 3 | mweroiuxlskdfjlksjdflkjsdfljksldkjflkjsdflkj 4 | + mweroiuxlskdfjlksj 5 | + mweroiuxlskdfjlksj 6 | -------------------------------------------------------------------------------- /data/Test427.hs: -------------------------------------------------------------------------------- 1 | -- brittany { lconfig_columnAlignMode: { tag: ColumnAlignModeDisabled }, lconfig_indentPolicy: IndentPolicyLeft } 2 | func = 3 | mweroiuxlskdfjlksj 4 | + mweroiuxlskdfjlksj 5 | + mweroiuxlskdfjlksjdflkjsdfljksldkjflkjsdflkj 6 | -------------------------------------------------------------------------------- /data/Test428.hs: -------------------------------------------------------------------------------- 1 | -- brittany { lconfig_columnAlignMode: { tag: ColumnAlignModeDisabled }, lconfig_indentPolicy: IndentPolicyLeft } 2 | func = 1 3 | func = "abc" 4 | func = 1.1e5 5 | func = 'x' 6 | func = 981409823458910394810928414192837123987123987123 7 | -------------------------------------------------------------------------------- /data/Test429.hs: -------------------------------------------------------------------------------- 1 | -- brittany { lconfig_columnAlignMode: { tag: ColumnAlignModeDisabled }, lconfig_indentPolicy: IndentPolicyLeft } 2 | {-# LANGUAGE LambdaCase #-} 3 | func = \case 4 | FooBar -> x 5 | Baz -> y 6 | -------------------------------------------------------------------------------- /data/Test43.hs: -------------------------------------------------------------------------------- 1 | func = f 2 | where 3 | {-# INLINE [~1] f #-} 4 | f = id 5 | -------------------------------------------------------------------------------- /data/Test430.hs: -------------------------------------------------------------------------------- 1 | -- brittany { lconfig_columnAlignMode: { tag: ColumnAlignModeDisabled }, lconfig_indentPolicy: IndentPolicyLeft } 2 | func = \x -> abc 3 | describe "app" $ do 4 | -------------------------------------------------------------------------------- /data/Test431.hs: -------------------------------------------------------------------------------- 1 | -- brittany { lconfig_columnAlignMode: { tag: ColumnAlignModeDisabled }, lconfig_indentPolicy: IndentPolicyLeft } 2 | func = klajsdas klajsdas klajsdas 3 | -------------------------------------------------------------------------------- /data/Test432.hs: -------------------------------------------------------------------------------- 1 | -- brittany { lconfig_columnAlignMode: { tag: ColumnAlignModeDisabled }, lconfig_indentPolicy: IndentPolicyLeft } 2 | func = lakjsdlajsdljasdlkjasldjasldjasldjalsdjlaskjd 3 | lakjsdlajsdljasdlkjasldjasldjasldjalsdjlaskjd 4 | lakjsdlajsdljasdlkjasldjasldjasldjalsdjlaskjd 5 | -------------------------------------------------------------------------------- /data/Test433.hs: -------------------------------------------------------------------------------- 1 | -- brittany { lconfig_columnAlignMode: { tag: ColumnAlignModeDisabled }, lconfig_indentPolicy: IndentPolicyLeft } 2 | func = lakjsdlajsdljasdlkjasldjasldjasldjalsdjlaskjd 3 | lakjsdlajsdljas 4 | lakjsdlajsdljas 5 | lakjsdlajsdljas 6 | -------------------------------------------------------------------------------- /data/Test434.hs: -------------------------------------------------------------------------------- 1 | -- brittany { lconfig_columnAlignMode: { tag: ColumnAlignModeDisabled }, lconfig_indentPolicy: IndentPolicyLeft } 2 | func = (1 +) 3 | -------------------------------------------------------------------------------- /data/Test435.hs: -------------------------------------------------------------------------------- 1 | -- brittany { lconfig_columnAlignMode: { tag: ColumnAlignModeDisabled }, lconfig_indentPolicy: IndentPolicyLeft } 2 | func = (+ 1) 3 | -------------------------------------------------------------------------------- /data/Test436.hs: -------------------------------------------------------------------------------- 1 | -- brittany { lconfig_columnAlignMode: { tag: ColumnAlignModeDisabled }, lconfig_indentPolicy: IndentPolicyLeft } 2 | func = (1 `abc`) 3 | -------------------------------------------------------------------------------- /data/Test437.hs: -------------------------------------------------------------------------------- 1 | -- brittany { lconfig_columnAlignMode: { tag: ColumnAlignModeDisabled }, lconfig_indentPolicy: IndentPolicyLeft } 2 | func = (`abc` 1) 3 | -------------------------------------------------------------------------------- /data/Test438.hs: -------------------------------------------------------------------------------- 1 | -- brittany { lconfig_columnAlignMode: { tag: ColumnAlignModeDisabled }, lconfig_indentPolicy: IndentPolicyLeft } 2 | func = (abc, def) 3 | -------------------------------------------------------------------------------- /data/Test439.hs: -------------------------------------------------------------------------------- 1 | -- brittany { lconfig_columnAlignMode: { tag: ColumnAlignModeDisabled }, lconfig_indentPolicy: IndentPolicyLeft } 2 | func = 3 | ( lakjsdlajsdljasdlkjasldjasldjasldjalsdjlaskjd 4 | , lakjsdlajsdljasdlkjasldjasldjasldjalsdjlaskjd 5 | ) 6 | -------------------------------------------------------------------------------- /data/Test44.hs: -------------------------------------------------------------------------------- 1 | data Foo = Bar {} 2 | data Biz = Baz 3 | -------------------------------------------------------------------------------- /data/Test440.hs: -------------------------------------------------------------------------------- 1 | -- brittany { lconfig_columnAlignMode: { tag: ColumnAlignModeDisabled }, lconfig_indentPolicy: IndentPolicyLeft } 2 | foo = 3 | let longIdentifierForShortValue = 1 4 | in longIdentifierForShortValue + longIdentifierForShortValue 5 | -------------------------------------------------------------------------------- /data/Test441.hs: -------------------------------------------------------------------------------- 1 | -- brittany { lconfig_columnAlignMode: { tag: ColumnAlignModeDisabled }, lconfig_indentPolicy: IndentPolicyLeft } 2 | func = do 3 | stmt 4 | stmt 5 | -------------------------------------------------------------------------------- /data/Test442.hs: -------------------------------------------------------------------------------- 1 | -- brittany { lconfig_columnAlignMode: { tag: ColumnAlignModeDisabled }, lconfig_indentPolicy: IndentPolicyLeft } 2 | func = do 3 | x <- stmt 4 | stmt x 5 | -------------------------------------------------------------------------------- /data/Test443.hs: -------------------------------------------------------------------------------- 1 | -- brittany { lconfig_columnAlignMode: { tag: ColumnAlignModeDisabled }, lconfig_indentPolicy: IndentPolicyLeft } 2 | func = do 3 | let x = 13 4 | stmt x 5 | -------------------------------------------------------------------------------- /data/Test444.hs: -------------------------------------------------------------------------------- 1 | -- brittany { lconfig_columnAlignMode: { tag: ColumnAlignModeDisabled }, lconfig_indentPolicy: IndentPolicyLeft } 2 | func = 3 | foooooo 4 | $ [ case 5 | foooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo 6 | of 7 | _ -> True 8 | ] 9 | -------------------------------------------------------------------------------- /data/Test445.hs: -------------------------------------------------------------------------------- 1 | -- brittany { lconfig_columnAlignMode: { tag: ColumnAlignModeDisabled }, lconfig_indentPolicy: IndentPolicyLeft } 2 | {-# LANGUAGE MultiWayIf #-} 3 | func = if 4 | | cond1 -> loooooooooooooooooooooooooooooong expr1 5 | | cond2 -> loooooooooooooooooooooooooooooong expr2 6 | -------------------------------------------------------------------------------- /data/Test446.hs: -------------------------------------------------------------------------------- 1 | -- brittany { lconfig_columnAlignMode: { tag: ColumnAlignModeDisabled }, lconfig_indentPolicy: IndentPolicyLeft } 2 | {-# LANGUAGE MultiWayIf #-} 3 | func = do 4 | foo 5 | bar $ if 6 | | cond1 -> loooooooooooooooooooooooooooooong expr1 7 | | cond2 -> loooooooooooooooooooooooooooooong expr2 8 | -------------------------------------------------------------------------------- /data/Test447.hs: -------------------------------------------------------------------------------- 1 | -- brittany { lconfig_columnAlignMode: { tag: ColumnAlignModeDisabled }, lconfig_indentPolicy: IndentPolicyLeft } 2 | func = 3 | foo 4 | $ [ aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa 5 | , bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb 6 | ] 7 | ++ [ccccccccccccccccccccccccccccccccccccccccccccccccccccccccc] 8 | -------------------------------------------------------------------------------- /data/Test448.hs: -------------------------------------------------------------------------------- 1 | -- brittany { lconfig_columnAlignMode: { tag: ColumnAlignModeDisabled }, lconfig_indentPolicy: IndentPolicyLeft } 2 | module Main where 3 | -------------------------------------------------------------------------------- /data/Test449.hs: -------------------------------------------------------------------------------- 1 | -- brittany { lconfig_columnAlignMode: { tag: ColumnAlignModeDisabled }, lconfig_indentPolicy: IndentPolicyLeft } 2 | module Main () where 3 | -------------------------------------------------------------------------------- /data/Test45.hs: -------------------------------------------------------------------------------- 1 | data Foo = Bar 2 | { foo :: Baz 3 | } 4 | -------------------------------------------------------------------------------- /data/Test450.hs: -------------------------------------------------------------------------------- 1 | -- brittany { lconfig_columnAlignMode: { tag: ColumnAlignModeDisabled }, lconfig_indentPolicy: IndentPolicyLeft } 2 | module Main (main) where 3 | -------------------------------------------------------------------------------- /data/Test451.hs: -------------------------------------------------------------------------------- 1 | -- brittany { lconfig_columnAlignMode: { tag: ColumnAlignModeDisabled }, lconfig_indentPolicy: IndentPolicyLeft } 2 | module Main (main, test1, test2) where 3 | -------------------------------------------------------------------------------- /data/Test452.hs: -------------------------------------------------------------------------------- 1 | -- brittany { lconfig_columnAlignMode: { tag: ColumnAlignModeDisabled }, lconfig_indentPolicy: IndentPolicyLeft } 2 | module Main 3 | ( main 4 | , test1 5 | , test2 6 | , test3 7 | , test4 8 | , test5 9 | , test6 10 | , test7 11 | , test8 12 | , test9 13 | ) where 14 | -------------------------------------------------------------------------------- /data/Test453.hs: -------------------------------------------------------------------------------- 1 | -- brittany { lconfig_columnAlignMode: { tag: ColumnAlignModeDisabled }, lconfig_indentPolicy: IndentPolicyLeft } 2 | module Main 3 | ( main 4 | -- main 5 | , test1 6 | , test2 7 | -- Test 3 8 | , test3 9 | , test4 10 | -- Test 5 11 | , test5 12 | -- Test 6 13 | ) where 14 | -------------------------------------------------------------------------------- /data/Test454.hs: -------------------------------------------------------------------------------- 1 | -- brittany { lconfig_columnAlignMode: { tag: ColumnAlignModeDisabled }, lconfig_indentPolicy: IndentPolicyLeft } 2 | module Main (Test(..)) where 3 | -------------------------------------------------------------------------------- /data/Test455.hs: -------------------------------------------------------------------------------- 1 | -- brittany { lconfig_columnAlignMode: { tag: ColumnAlignModeDisabled }, lconfig_indentPolicy: IndentPolicyLeft } 2 | module Main (module Main) where 3 | -------------------------------------------------------------------------------- /data/Test456.hs: -------------------------------------------------------------------------------- 1 | -- brittany { lconfig_columnAlignMode: { tag: ColumnAlignModeDisabled }, lconfig_indentPolicy: IndentPolicyLeft } 2 | module Main (Test(Test, a, b)) where 3 | -------------------------------------------------------------------------------- /data/Test457.hs: -------------------------------------------------------------------------------- 1 | -- brittany { lconfig_columnAlignMode: { tag: ColumnAlignModeDisabled }, lconfig_indentPolicy: IndentPolicyLeft } 2 | module Main (Test()) where 3 | -------------------------------------------------------------------------------- /data/Test458.hs: -------------------------------------------------------------------------------- 1 | -- brittany { lconfig_columnAlignMode: { tag: ColumnAlignModeDisabled }, lconfig_indentPolicy: IndentPolicyLeft } 2 | -- Intentionally left empty 3 | -------------------------------------------------------------------------------- /data/Test459.hs: -------------------------------------------------------------------------------- 1 | -- brittany { lconfig_columnAlignMode: { tag: ColumnAlignModeDisabled }, lconfig_indentPolicy: IndentPolicyLeft } 2 | import Data.List 3 | -------------------------------------------------------------------------------- /data/Test46.hs: -------------------------------------------------------------------------------- 1 | data Foo = Bar 2 | { foo, bar :: Baz 3 | } 4 | -------------------------------------------------------------------------------- /data/Test460.hs: -------------------------------------------------------------------------------- 1 | -- brittany { lconfig_columnAlignMode: { tag: ColumnAlignModeDisabled }, lconfig_indentPolicy: IndentPolicyLeft } 2 | import Data.List as L 3 | -------------------------------------------------------------------------------- /data/Test461.hs: -------------------------------------------------------------------------------- 1 | -- brittany { lconfig_columnAlignMode: { tag: ColumnAlignModeDisabled }, lconfig_indentPolicy: IndentPolicyLeft } 2 | import qualified Data.List 3 | -------------------------------------------------------------------------------- /data/Test462.hs: -------------------------------------------------------------------------------- 1 | -- brittany { lconfig_columnAlignMode: { tag: ColumnAlignModeDisabled }, lconfig_indentPolicy: IndentPolicyLeft } 2 | import qualified Data.List as L 3 | -------------------------------------------------------------------------------- /data/Test463.hs: -------------------------------------------------------------------------------- 1 | -- brittany { lconfig_columnAlignMode: { tag: ColumnAlignModeDisabled }, lconfig_indentPolicy: IndentPolicyLeft } 2 | import safe Data.List as L 3 | -------------------------------------------------------------------------------- /data/Test464.hs: -------------------------------------------------------------------------------- 1 | -- brittany { lconfig_columnAlignMode: { tag: ColumnAlignModeDisabled }, lconfig_indentPolicy: IndentPolicyLeft } 2 | import {-# SOURCE #-} Data.List () 3 | -------------------------------------------------------------------------------- /data/Test465.hs: -------------------------------------------------------------------------------- 1 | -- brittany { lconfig_columnAlignMode: { tag: ColumnAlignModeDisabled }, lconfig_indentPolicy: IndentPolicyLeft } 2 | import safe qualified Data.List hiding (nub) 3 | -------------------------------------------------------------------------------- /data/Test466.hs: -------------------------------------------------------------------------------- 1 | -- brittany { lconfig_columnAlignMode: { tag: ColumnAlignModeDisabled }, lconfig_indentPolicy: IndentPolicyLeft } 2 | import {-# SOURCE #-} safe qualified Data.List 3 | -------------------------------------------------------------------------------- /data/Test467.hs: -------------------------------------------------------------------------------- 1 | -- brittany { lconfig_columnAlignMode: { tag: ColumnAlignModeDisabled }, lconfig_indentPolicy: IndentPolicyLeft } 2 | import qualified "base" Data.List 3 | -------------------------------------------------------------------------------- /data/Test468.hs: -------------------------------------------------------------------------------- 1 | -- brittany { lconfig_columnAlignMode: { tag: ColumnAlignModeDisabled }, lconfig_indentPolicy: IndentPolicyLeft } 2 | import {-# SOURCE #-} safe qualified "base" Data.List as L 3 | import {-# SOURCE #-} safe qualified "base" Data.List () 4 | import {-# SOURCE #-} safe qualified Data.List hiding () 5 | -------------------------------------------------------------------------------- /data/Test469.hs: -------------------------------------------------------------------------------- 1 | -- brittany { lconfig_columnAlignMode: { tag: ColumnAlignModeDisabled }, lconfig_indentPolicy: IndentPolicyLeft } 2 | import qualified Data.List () 3 | -------------------------------------------------------------------------------- /data/Test47.hs: -------------------------------------------------------------------------------- 1 | data Foo = Bar 2 | { foo :: Baz 3 | , bars :: Bizzz 4 | } 5 | -------------------------------------------------------------------------------- /data/Test470.hs: -------------------------------------------------------------------------------- 1 | -- brittany { lconfig_columnAlignMode: { tag: ColumnAlignModeDisabled }, lconfig_indentPolicy: IndentPolicyLeft } 2 | import Data.List (nub) 3 | -------------------------------------------------------------------------------- /data/Test471.hs: -------------------------------------------------------------------------------- 1 | -- brittany { lconfig_columnAlignMode: { tag: ColumnAlignModeDisabled }, lconfig_indentPolicy: IndentPolicyLeft } 2 | import Data.List (foldl', indexElem, nub) 3 | -------------------------------------------------------------------------------- /data/Test472.hs: -------------------------------------------------------------------------------- 1 | -- brittany { lconfig_columnAlignMode: { tag: ColumnAlignModeDisabled }, lconfig_indentPolicy: IndentPolicyLeft } 2 | import Test 3 | ( Long 4 | , anymore 5 | , fit 6 | , items 7 | , line 8 | , list 9 | , not 10 | , onA 11 | , quite 12 | , single 13 | , that 14 | , will 15 | , with 16 | ) 17 | -------------------------------------------------------------------------------- /data/Test473.hs: -------------------------------------------------------------------------------- 1 | -- brittany { lconfig_columnAlignMode: { tag: ColumnAlignModeDisabled }, lconfig_indentPolicy: IndentPolicyLeft } 2 | import Test ((+), T, T2(), T3(..), T4(T4), T5(T5, t5), T6((<|>))) 3 | -------------------------------------------------------------------------------- /data/Test474.hs: -------------------------------------------------------------------------------- 1 | -- brittany { lconfig_columnAlignMode: { tag: ColumnAlignModeDisabled }, lconfig_indentPolicy: IndentPolicyLeft } 2 | import Test hiding () 3 | import Test as T hiding () 4 | -------------------------------------------------------------------------------- /data/Test475.hs: -------------------------------------------------------------------------------- 1 | -- brittany { lconfig_columnAlignMode: { tag: ColumnAlignModeDisabled }, lconfig_indentPolicy: IndentPolicyLeft } 2 | import Prelude as X 3 | hiding 4 | ( head 5 | , init 6 | , last 7 | , maximum 8 | , minimum 9 | , pred 10 | , read 11 | , readFile 12 | , succ 13 | , tail 14 | , undefined 15 | ) 16 | -------------------------------------------------------------------------------- /data/Test476.hs: -------------------------------------------------------------------------------- 1 | -- brittany { lconfig_columnAlignMode: { tag: ColumnAlignModeDisabled }, lconfig_indentPolicy: IndentPolicyLeft } 2 | import MoreThanSufficientlyLongModuleNameWithSome 3 | (compact, fit, inA, items, layout, not, that, will) 4 | import TestJustAbitToLongModuleNameLikeThisOneIs () 5 | import TestJustShortEnoughModuleNameLikeThisOne () 6 | -------------------------------------------------------------------------------- /data/Test477.hs: -------------------------------------------------------------------------------- 1 | -- brittany { lconfig_columnAlignMode: { tag: ColumnAlignModeDisabled }, lconfig_indentPolicy: IndentPolicyLeft } 2 | import TestJustAbitToLongModuleNameLikeThisOneI as T 3 | import TestJustShortEnoughModuleNameLikeThisOn as T 4 | -------------------------------------------------------------------------------- /data/Test478.hs: -------------------------------------------------------------------------------- 1 | -- brittany { lconfig_columnAlignMode: { tag: ColumnAlignModeDisabled }, lconfig_indentPolicy: IndentPolicyLeft } 2 | import TestJustAbitToLongModuleNameLikeTh hiding () 3 | import TestJustShortEnoughModuleNameLike hiding () 4 | -------------------------------------------------------------------------------- /data/Test479.hs: -------------------------------------------------------------------------------- 1 | -- brittany { lconfig_columnAlignMode: { tag: ColumnAlignModeDisabled }, lconfig_indentPolicy: IndentPolicyLeft } 2 | import MoreThanSufficientlyLongModuleNameWithSome 3 | (compact, fit, inA, items, layout, not, that, will) 4 | -------------------------------------------------------------------------------- /data/Test48.hs: -------------------------------------------------------------------------------- 1 | data Foo = Bar 2 | { foo, biz :: Baz 3 | , bar :: Bizzz 4 | } 5 | -------------------------------------------------------------------------------- /data/Test480.hs: -------------------------------------------------------------------------------- 1 | -- brittany { lconfig_columnAlignMode: { tag: ColumnAlignModeDisabled }, lconfig_indentPolicy: IndentPolicyLeft } 2 | import TestJustShortEnoughModuleNameLike hiding (abc, def, ghci, jklm) 3 | -------------------------------------------------------------------------------- /data/Test481.hs: -------------------------------------------------------------------------------- 1 | -- brittany { lconfig_columnAlignMode: { tag: ColumnAlignModeDisabled }, lconfig_indentPolicy: IndentPolicyLeft } 2 | -- Test 3 | import Data.List (nub) -- Test 4 | {- Test -} 5 | import qualified Data.List as L (foldl') {- Test -} 6 | -------------------------------------------------------------------------------- /data/Test482.hs: -------------------------------------------------------------------------------- 1 | -- brittany { lconfig_columnAlignMode: { tag: ColumnAlignModeDisabled }, lconfig_indentPolicy: IndentPolicyLeft } 2 | import Test 3 | ( abc 4 | , def 5 | -- comment 6 | ) 7 | -------------------------------------------------------------------------------- /data/Test483.hs: -------------------------------------------------------------------------------- 1 | -- brittany { lconfig_columnAlignMode: { tag: ColumnAlignModeDisabled }, lconfig_indentPolicy: IndentPolicyLeft } 2 | import Test 3 | ( abc 4 | -- comment 5 | ) 6 | -------------------------------------------------------------------------------- /data/Test484.hs: -------------------------------------------------------------------------------- 1 | -- brittany { lconfig_columnAlignMode: { tag: ColumnAlignModeDisabled }, lconfig_indentPolicy: IndentPolicyLeft } 2 | import Test 3 | ( abc 4 | -- comment 5 | , def 6 | , ghi 7 | {- comment -} 8 | , jkl 9 | -- comment 10 | ) 11 | -- Test 12 | import Test (test) 13 | -------------------------------------------------------------------------------- /data/Test485.hs: -------------------------------------------------------------------------------- 1 | -- brittany { lconfig_columnAlignMode: { tag: ColumnAlignModeDisabled }, lconfig_indentPolicy: IndentPolicyLeft } 2 | import Test 3 | ( -- comment 4 | ) 5 | -------------------------------------------------------------------------------- /data/Test486.hs: -------------------------------------------------------------------------------- 1 | -- brittany { lconfig_columnAlignMode: { tag: ColumnAlignModeDisabled }, lconfig_indentPolicy: IndentPolicyLeft } 2 | import Test (longbindingNameThatoverflowsColum) 3 | import Test (Long(List, Of, Things)) 4 | -------------------------------------------------------------------------------- /data/Test487.hs: -------------------------------------------------------------------------------- 1 | -- brittany { lconfig_columnAlignMode: { tag: ColumnAlignModeDisabled }, lconfig_indentPolicy: IndentPolicyLeft } 2 | import Test 3 | ( Thing 4 | ( With 5 | -- Comments 6 | , and 7 | -- also 8 | , items 9 | -- ! 10 | ) 11 | ) 12 | import Test 13 | ( Thing 14 | ( Item 15 | -- and Comment 16 | ) 17 | ) 18 | import Test 19 | ( Thing 20 | ( With 21 | -- Comments 22 | , and 23 | -- also 24 | , items 25 | -- ! 26 | ) 27 | ) 28 | -------------------------------------------------------------------------------- /data/Test488.hs: -------------------------------------------------------------------------------- 1 | -- brittany { lconfig_columnAlignMode: { tag: ColumnAlignModeDisabled }, lconfig_indentPolicy: IndentPolicyLeft } 2 | import VeryLongModuleNameThatCouldEvenCauseAnEmptyBindingListToExpandIntoMultipleLine 3 | () 4 | -------------------------------------------------------------------------------- /data/Test489.hs: -------------------------------------------------------------------------------- 1 | -- brittany { lconfig_columnAlignMode: { tag: ColumnAlignModeDisabled }, lconfig_indentPolicy: IndentPolicyLeft } 2 | {-# LANGUAGE BangPatterns #-} 3 | {- 4 | - Test module 5 | -} 6 | module Test 7 | ( test1 8 | -- ^ test 9 | , test2 10 | -- | test 11 | , test3 12 | , test4 13 | , test5 14 | , test6 15 | , test7 16 | , test8 17 | , test9 18 | , test10 19 | ) where 20 | -- Test 21 | import Data.List (nub) -- Test 22 | {- Test -} 23 | import qualified Data.List as L (foldl') {- Test -} 24 | -- Test 25 | import Test (test) 26 | -------------------------------------------------------------------------------- /data/Test49.hs: -------------------------------------------------------------------------------- 1 | data Foo = Bar 2 | { fooz :: Baz 3 | , bar :: Bizzz 4 | } 5 | deriving Show 6 | -------------------------------------------------------------------------------- /data/Test490.hs: -------------------------------------------------------------------------------- 1 | -- brittany { lconfig_columnAlignMode: { tag: ColumnAlignModeDisabled }, lconfig_indentPolicy: IndentPolicyLeft } 2 | func = do 3 | abc <- foo 4 | --abc 5 | return () 6 | -------------------------------------------------------------------------------- /data/Test491.hs: -------------------------------------------------------------------------------- 1 | -- brittany { lconfig_columnAlignMode: { tag: ColumnAlignModeDisabled }, lconfig_indentPolicy: IndentPolicyLeft } 2 | func = (()) 3 | -------------------------------------------------------------------------------- /data/Test492.hs: -------------------------------------------------------------------------------- 1 | -- brittany { lconfig_columnAlignMode: { tag: ColumnAlignModeDisabled }, lconfig_indentPolicy: IndentPolicyLeft } 2 | func = do 3 | let 4 | foo True = True 5 | foo _ = False 6 | return () 7 | -------------------------------------------------------------------------------- /data/Test493.hs: -------------------------------------------------------------------------------- 1 | -- brittany { lconfig_columnAlignMode: { tag: ColumnAlignModeDisabled }, lconfig_indentPolicy: IndentPolicyLeft } 2 | func = do 3 | let 4 | foo True = True 5 | foo _ = False 6 | return () 7 | -------------------------------------------------------------------------------- /data/Test494.hs: -------------------------------------------------------------------------------- 1 | -- brittany { lconfig_columnAlignMode: { tag: ColumnAlignModeDisabled }, lconfig_indentPolicy: IndentPolicyLeft } 2 | func = do 3 | let 4 | foo = True 5 | b = False 6 | return () 7 | -------------------------------------------------------------------------------- /data/Test495.hs: -------------------------------------------------------------------------------- 1 | -- brittany { lconfig_columnAlignMode: { tag: ColumnAlignModeDisabled }, lconfig_indentPolicy: IndentPolicyLeft } 2 | func = 3 | let 4 | foo = True 5 | b = False 6 | in return () 7 | -------------------------------------------------------------------------------- /data/Test496.hs: -------------------------------------------------------------------------------- 1 | -- brittany { lconfig_columnAlignMode: { tag: ColumnAlignModeDisabled }, lconfig_indentPolicy: IndentPolicyLeft } 2 | func = do 3 | s <- mGet 4 | mSet $ s { _lstate_indent = _lstate_indent state } 5 | -------------------------------------------------------------------------------- /data/Test497.hs: -------------------------------------------------------------------------------- 1 | -- brittany { lconfig_columnAlignMode: { tag: ColumnAlignModeDisabled }, lconfig_indentPolicy: IndentPolicyLeft } 2 | func = do 3 | s <- mGet 4 | mSet $ s 5 | { _lstate_indent = _lstate_indent state 6 | , _lstate_foo = _lstate_foo state 7 | } 8 | -------------------------------------------------------------------------------- /data/Test498.hs: -------------------------------------------------------------------------------- 1 | -- brittany { lconfig_columnAlignMode: { tag: ColumnAlignModeDisabled }, lconfig_indentPolicy: IndentPolicyLeft } 2 | func = do 3 | s <- mGet 4 | mSet $ s 5 | { _lstate_indent = _lstate_indent lkasdlkjalsdjlakjsdlkjasldkjalskdjlkajsd 6 | , _lstate_foo = _lstate_foo kasdlkjalsdjlakjsdlkjasldkjalskdjlkajsd 7 | } 8 | -------------------------------------------------------------------------------- /data/Test499.hs: -------------------------------------------------------------------------------- 1 | -- brittany { lconfig_columnAlignMode: { tag: ColumnAlignModeDisabled }, lconfig_indentPolicy: IndentPolicyLeft } 2 | func = Foo { _lstate_indent = _lstate_indent state } 3 | -------------------------------------------------------------------------------- /data/Test5.hs: -------------------------------------------------------------------------------- 1 | func :: (a -> a) -> a 2 | -------------------------------------------------------------------------------- /data/Test50.hs: -------------------------------------------------------------------------------- 1 | data MyRecord = MyConstructor 2 | { bar1, bar2 3 | :: Loooooooooooooooooooooooooooooooong 4 | -> Loooooooooooooooooooooooooooooooong 5 | , foo1, foo2 6 | :: Loooooooooooooooooooooooooooooooonger 7 | -> Loooooooooooooooooooooooooooooooonger 8 | } 9 | -------------------------------------------------------------------------------- /data/Test500.hs: -------------------------------------------------------------------------------- 1 | -- brittany { lconfig_columnAlignMode: { tag: ColumnAlignModeDisabled }, lconfig_indentPolicy: IndentPolicyLeft } 2 | func = Foo 3 | { _lstate_indent = _lstate_indent lkasdlkjalsdjlakjsdlkjasldkjalskdjlkajsd 4 | , _lstate_foo = _lstate_foo lkasdlkjalsdjlakjsdlkjasldkjalskdjlkajsd 5 | } 6 | -------------------------------------------------------------------------------- /data/Test501.hs: -------------------------------------------------------------------------------- 1 | -- brittany { lconfig_columnAlignMode: { tag: ColumnAlignModeDisabled }, lconfig_indentPolicy: IndentPolicyLeft } 2 | func = do 3 | Foo 4 | { _lstate_indent = _lstate_indent lkasdlkjalsdjlakjsdlkjasldkjalskdjlkajsd 5 | , _lstate_foo = _lstate_foo lkasdlkjalsdjlakjsdlkjasldkjalskdjlkajsd 6 | } 7 | -------------------------------------------------------------------------------- /data/Test502.hs: -------------------------------------------------------------------------------- 1 | -- brittany { lconfig_columnAlignMode: { tag: ColumnAlignModeDisabled }, lconfig_indentPolicy: IndentPolicyLeft } 2 | func = do 3 | -- abc 4 | -- def 5 | return () 6 | -------------------------------------------------------------------------------- /data/Test503.hs: -------------------------------------------------------------------------------- 1 | -- brittany { lconfig_columnAlignMode: { tag: ColumnAlignModeDisabled }, lconfig_indentPolicy: IndentPolicyLeft } 2 | func = do 3 | do 4 | return () 5 | -- abc 6 | -- def 7 | return () 8 | -------------------------------------------------------------------------------- /data/Test504.hs: -------------------------------------------------------------------------------- 1 | -- brittany { lconfig_columnAlignMode: { tag: ColumnAlignModeDisabled }, lconfig_indentPolicy: IndentPolicyLeft } 2 | func 3 | :: Int -- basic indentation amount 4 | -> Int -- currently used width in current line (after indent) 5 | -- used to accurately calc placing of the current-line 6 | -> LayoutDesc 7 | -> Int 8 | -------------------------------------------------------------------------------- /data/Test505.hs: -------------------------------------------------------------------------------- 1 | -- brittany { lconfig_columnAlignMode: { tag: ColumnAlignModeDisabled }, lconfig_indentPolicy: IndentPolicyLeft } 2 | func = 3 | (lkjadljasldjalskdjaldjalsdjkalsdjlaksdjlasjdlajsaldskj 4 | $ abc 5 | $ def 6 | $ ghi 7 | $ jkl 8 | ) 9 | -------------------------------------------------------------------------------- /data/Test506.hs: -------------------------------------------------------------------------------- 1 | -- brittany { lconfig_columnAlignMode: { tag: ColumnAlignModeDisabled }, lconfig_indentPolicy: IndentPolicyLeft } 2 | buildG bounds0 edges0 = accumArray (flip (:)) [] bounds0 (map reassoc edges0) 3 | where reassoc (v, e, w) = (v, (e, w)) 4 | -------------------------------------------------------------------------------- /data/Test507.hs: -------------------------------------------------------------------------------- 1 | -- brittany { lconfig_columnAlignMode: { tag: ColumnAlignModeDisabled }, lconfig_indentPolicy: IndentPolicyLeft } 2 | downloadRepoPackage = case repo of 3 | RepoLocal {..} -> return () 4 | RepoLocal { abc } -> return () 5 | RepoLocal{} -> return () 6 | -------------------------------------------------------------------------------- /data/Test508.hs: -------------------------------------------------------------------------------- 1 | -- brittany { lconfig_columnAlignMode: { tag: ColumnAlignModeDisabled }, lconfig_indentPolicy: IndentPolicyLeft } 2 | func = do 3 | let 4 | (primaryPkg, otherPkgs) = selectPrimaryLocalPackage pwd pkgs' 5 | (bproblems, x) = resolveBuildTargets primaryPkg otherPkgs utargets'' 6 | -- default local dir target if there's no given target 7 | utargets'' = "foo" 8 | return () 9 | -------------------------------------------------------------------------------- /data/Test509.hs: -------------------------------------------------------------------------------- 1 | -- brittany { lconfig_columnAlignMode: { tag: ColumnAlignModeDisabled }, lconfig_indentPolicy: IndentPolicyLeft } 2 | func = 3 | [ (thing, take 10 alts) --TODO: select best ones 4 | | (thing, _got, alts@(_ : _)) <- nosuchFooThing 5 | , gast <- award 6 | ] 7 | -------------------------------------------------------------------------------- /data/Test51.hs: -------------------------------------------------------------------------------- 1 | {-# LANGUAGE DatatypeContexts #-} 2 | data 3 | ( LooooooooooooooooooooongConstraint a 4 | , LooooooooooooooooooooongConstraint b 5 | ) => 6 | MyRecord a b 7 | = MyConstructor 8 | { foo1, foo2 9 | :: loooooooooooooooooooooooooooooooong 10 | -> loooooooooooooooooooooooooooooooong 11 | , bar :: a 12 | , bazz :: b 13 | } 14 | -------------------------------------------------------------------------------- /data/Test510.hs: -------------------------------------------------------------------------------- 1 | -- brittany { lconfig_columnAlignMode: { tag: ColumnAlignModeDisabled }, lconfig_indentPolicy: IndentPolicyLeft } 2 | func = if x 3 | then if y -- y is important 4 | then foo 5 | else bar 6 | else Nothing 7 | -------------------------------------------------------------------------------- /data/Test511.hs: -------------------------------------------------------------------------------- 1 | -- brittany { lconfig_columnAlignMode: { tag: ColumnAlignModeDisabled }, lconfig_indentPolicy: IndentPolicyLeft } 2 | wrapPatPrepend pat prepElem = do 3 | patDocs <- layoutPat pat 4 | case Seq.viewl patDocs of 5 | Seq.EmptyL -> return $ Seq.empty 6 | x1 Seq.:< xR -> do 7 | x1' <- docSeq [prepElem, return x1] 8 | return $ x1' Seq.<| xR 9 | -------------------------------------------------------------------------------- /data/Test512.hs: -------------------------------------------------------------------------------- 1 | -- brittany { lconfig_columnAlignMode: { tag: ColumnAlignModeDisabled }, lconfig_indentPolicy: IndentPolicyLeft } 2 | layoutWriteNewlineBlock 3 | :: ( MonadMultiWriter Text.Builder.Builder m 4 | , MonadMultiState LayoutState m 5 | , MonadMultiWriter (Seq String) m 6 | ) 7 | => m () 8 | -------------------------------------------------------------------------------- /data/Test513.hs: -------------------------------------------------------------------------------- 1 | -- brittany { lconfig_columnAlignMode: { tag: ColumnAlignModeDisabled }, lconfig_indentPolicy: IndentPolicyLeft } 2 | {-# LANGUAGE MultiWayIf #-} 3 | readMergePersConfig path shouldCreate conf = do 4 | exists <- liftIO $ System.Directory.doesFileExist path 5 | if 6 | | exists -> do 7 | contents <- liftIO $ ByteString.readFile path -- no lazy IO, tyvm. 8 | fileConf <- case Data.Yaml.decodeEither contents of 9 | Left e -> do 10 | liftIO 11 | $ putStrErrLn 12 | $ "error reading in brittany config from " 13 | ++ path 14 | ++ ":" 15 | liftIO $ putStrErrLn e 16 | mzero 17 | Right x -> return x 18 | return $ fileConf Semigroup.<> conf 19 | | shouldCreate -> do 20 | liftIO $ ByteString.writeFile path $ Data.Yaml.encode $ cMap 21 | (Option . Just . runIdentity) 22 | staticDefaultConfig 23 | return $ conf 24 | | otherwise -> do 25 | return conf 26 | -------------------------------------------------------------------------------- /data/Test514.hs: -------------------------------------------------------------------------------- 1 | -- brittany { lconfig_columnAlignMode: { tag: ColumnAlignModeDisabled }, lconfig_indentPolicy: IndentPolicyLeft } 2 | func = BuildReport 3 | where 4 | convertInstallOutcome = case result of 5 | Left BR.PlanningFailed -> PlanningFailed 6 | Left (BR.DependentFailed p) -> DependencyFailed p 7 | Left (BR.DownloadFailed _) -> DownloadFailed 8 | Left (BR.UnpackFailed _) -> UnpackFailed 9 | Left (BR.ConfigureFailed _) -> ConfigureFailed 10 | Left (BR.BuildFailed _) -> BuildFailed 11 | Left (BR.TestsFailed _) -> TestsFailed 12 | Left (BR.InstallFailed _) -> InstallFailed 13 | Right (BR.BuildOk _ _ _) -> InstallOk 14 | -------------------------------------------------------------------------------- /data/Test515.hs: -------------------------------------------------------------------------------- 1 | -- brittany { lconfig_columnAlignMode: { tag: ColumnAlignModeDisabled }, lconfig_indentPolicy: IndentPolicyLeft } 2 | func = BuildReport 3 | where 4 | convertInstallOutcome = case result of 5 | Left BR.PlanningFailed -> PlanningFailed 6 | Left (BR.DependentFailed p) -> DependencyFailed p 7 | Left (BR.DownloadFailed _) -> DownloadFailed 8 | Left (BR.UnpackFailed _) -> UnpackFailed 9 | Left (BR.ConfigureFailed _) -> ConfigureFailed 10 | Left (BR.BuildFailed _) -> BuildFailed 11 | Left (BR.TestsFailed _) -> TestsFailed 12 | Left (BR.InstallFailed _) -> InstallFailed 13 | Right (BR.BuildOk _ _ _) -> InstallOk 14 | -------------------------------------------------------------------------------- /data/Test516.hs: -------------------------------------------------------------------------------- 1 | -- brittany { lconfig_columnAlignMode: { tag: ColumnAlignModeDisabled }, lconfig_indentPolicy: IndentPolicyLeft } 2 | showPackageDetailedInfo pkginfo = 3 | renderStyle (style { lineLength = 80, ribbonsPerLine = 1 }) 4 | $ char '*' 5 | $+$ something 6 | [ entry "Synopsis" synopsis hideIfNull reflowParagraphs 7 | , entry 8 | "Versions available" 9 | sourceVersions 10 | (altText null "[ Not available from server ]") 11 | (dispTopVersions 9 (preferredVersions pkginfo)) 12 | , entry 13 | "Versions installed" 14 | installedVersions 15 | (altText 16 | null 17 | (if hasLib pkginfo then "[ Not installed ]" else "[ Unknown ]") 18 | ) 19 | (dispTopVersions 4 (preferredVersions pkginfo)) 20 | , entry "Homepage" homepage orNotSpecified text 21 | , entry "Bug reports" bugReports orNotSpecified text 22 | , entry "Description" description hideIfNull reflowParagraphs 23 | , entry "Category" category hideIfNull text 24 | , entry "License" license alwaysShow disp 25 | , entry "Author" author hideIfNull reflowLines 26 | , entry "Maintainer" maintainer hideIfNull reflowLines 27 | , entry "Source repo" sourceRepo orNotSpecified text 28 | , entry "Executables" executables hideIfNull (commaSep text) 29 | , entry "Flags" flags hideIfNull (commaSep dispFlag) 30 | , entry "Dependencies" dependencies hideIfNull (commaSep dispExtDep) 31 | , entry "Documentation" haddockHtml showIfInstalled text 32 | , entry "Cached" haveTarball alwaysShow dispYesNo 33 | , if not (hasLib pkginfo) 34 | then empty 35 | else text "Modules:" 36 | $+$ nest 4 (vcat (map disp . sort . modules $ pkginfo)) 37 | ] 38 | -------------------------------------------------------------------------------- /data/Test517.hs: -------------------------------------------------------------------------------- 1 | -- brittany { lconfig_columnAlignMode: { tag: ColumnAlignModeDisabled }, lconfig_indentPolicy: IndentPolicyLeft } 2 | isValidPosition position 3 | | validX && validY = Just position 4 | | otherwise = Nothing 5 | -------------------------------------------------------------------------------- /data/Test518.hs: -------------------------------------------------------------------------------- 1 | -- brittany { lconfig_columnAlignMode: { tag: ColumnAlignModeDisabled }, lconfig_indentPolicy: IndentPolicyLeft } 2 | foo = Reflex.runSpiderHost $ ReflexHost.hostApp $ do 3 | (inputEvent :: Reflex.Event Reflex.Spider String, inputFire :: String 4 | -> IO Bool) <- 5 | ReflexHost.newExternalEvent 6 | liftIO . forkIO . forever $ getLine >>= inputFire 7 | ReflexHost.performEvent_ $ fmap (liftIO . putStrLn) inputEvent 8 | -------------------------------------------------------------------------------- /data/Test519.hs: -------------------------------------------------------------------------------- 1 | -- brittany { lconfig_columnAlignMode: { tag: ColumnAlignModeDisabled }, lconfig_indentPolicy: IndentPolicyLeft } 2 | -- Test.hs 3 | module Test where 4 | data X = X 5 | -------------------------------------------------------------------------------- /data/Test52.hs: -------------------------------------------------------------------------------- 1 | {-# LANGUAGE ScopedTypeVariables #-} 2 | -- brittany { lconfig_allowSinglelineRecord: true } 3 | data MyRecord = forall a . Show a => Bar 4 | { foo :: abittoolongbutnotvery -> abittoolongbutnotvery 5 | } 6 | -------------------------------------------------------------------------------- /data/Test520.hs: -------------------------------------------------------------------------------- 1 | -- brittany { lconfig_columnAlignMode: { tag: ColumnAlignModeDisabled }, lconfig_indentPolicy: IndentPolicyLeft } 2 | foldrDesc f z = unSwitchQueue $ \q -> 3 | switch (Min.foldrDesc (f unTaggedF) z q) (Min.foldrAsc (f unTaggedF) z q) 4 | -------------------------------------------------------------------------------- /data/Test521.hs: -------------------------------------------------------------------------------- 1 | -- brittany { lconfig_columnAlignMode: { tag: ColumnAlignModeDisabled }, lconfig_indentPolicy: IndentPolicyLeft } 2 | autocheckCases = 3 | [ ("Never Deadlocks", representative deadlocksNever) 4 | , ("No Exceptions", representative exceptionsNever) 5 | , ("Consistent Result", alwaysSame) -- already representative 6 | ] 7 | -------------------------------------------------------------------------------- /data/Test522.hs: -------------------------------------------------------------------------------- 1 | -- brittany { lconfig_columnAlignMode: { tag: ColumnAlignModeDisabled }, lconfig_indentPolicy: IndentPolicyLeft } 2 | autocheckCases = 3 | [ ("Never Deadlocks", representative deadlocksNever) 4 | , ("No Exceptions", representative exceptionsNever) 5 | , ( "Consistent Result" 6 | , alwaysSame -- already representative 7 | ) 8 | ] 9 | -------------------------------------------------------------------------------- /data/Test523.hs: -------------------------------------------------------------------------------- 1 | -- brittany { lconfig_columnAlignMode: { tag: ColumnAlignModeDisabled }, lconfig_indentPolicy: IndentPolicyLeft } 2 | func = 3 | [ (abc, (1111, 1111)) 4 | , (def, (2, 2)) 5 | , foo -- comment 6 | ] 7 | -------------------------------------------------------------------------------- /data/Test524.hs: -------------------------------------------------------------------------------- 1 | -- brittany { lconfig_columnAlignMode: { tag: ColumnAlignModeDisabled }, lconfig_indentPolicy: IndentPolicyLeft } 2 | foo a b = g a b -- fooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo 3 | where g a b = b + b * a 4 | -------------------------------------------------------------------------------- /data/Test525.hs: -------------------------------------------------------------------------------- 1 | -- brittany { lconfig_columnAlignMode: { tag: ColumnAlignModeDisabled }, lconfig_indentPolicy: IndentPolicyLeft } 2 | foo a b = g a b where g a b = b + b * a -- fooooooooooooooooooooooooooooooooooo 3 | -------------------------------------------------------------------------------- /data/Test526.hs: -------------------------------------------------------------------------------- 1 | -- brittany { lconfig_columnAlignMode: { tag: ColumnAlignModeDisabled }, lconfig_indentPolicy: IndentPolicyLeft } 2 | func = do 3 | abc <- expr 4 | abcccccccccccccccccc <- expr 5 | abcccccccccccccccccccccccccccccccccccccccccc <- expr 6 | abccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc <- expr 7 | -------------------------------------------------------------------------------- /data/Test527.hs: -------------------------------------------------------------------------------- 1 | -- brittany { lconfig_columnAlignMode: { tag: ColumnAlignModeDisabled }, lconfig_indentPolicy: IndentPolicyLeft } 2 | func (MyLongFoo abc def) = 1 3 | func (Bar a d) = 2 4 | func _ = 3 5 | -------------------------------------------------------------------------------- /data/Test528.hs: -------------------------------------------------------------------------------- 1 | -- brittany { lconfig_columnAlignMode: { tag: ColumnAlignModeDisabled }, lconfig_indentPolicy: IndentPolicyLeft } 2 | parserCompactLocation = 3 | [ try 4 | $ [ ParseRelAbs (Text.Read.read digits) _ _ 5 | | digits <- many1 digit 6 | , rel1 :: Maybe (Either Int (Ratio Int)) <- optionMaybe 7 | [ case divPart of 8 | Nothing -> Left $ Text.Read.read digits 9 | Just ddigits -> 10 | Right $ Text.Read.read digits % Text.Read.read ddigits 11 | | digits <- many1 digit 12 | , divPart <- optionMaybe (string "/" *> many1 digit) 13 | ] 14 | ] 15 | ] 16 | -------------------------------------------------------------------------------- /data/Test529.hs: -------------------------------------------------------------------------------- 1 | -- brittany { lconfig_columnAlignMode: { tag: ColumnAlignModeDisabled }, lconfig_indentPolicy: IndentPolicyLeft } 2 | func = fooooooooooooooooooooooooooooooooo $ foooooooooooooooooooooooooooooooo 3 | foooooooooooooooooooooooooooooooo 4 | foooooooooooooooooooooooooooooooo 5 | -------------------------------------------------------------------------------- /data/Test53.hs: -------------------------------------------------------------------------------- 1 | {-# LANGUAGE ScopedTypeVariables #-} 2 | data MyRecord 3 | = forall a 4 | . LooooooooooooooooooooongConstraint a => 5 | LoooooooooooongConstructor 6 | { foo :: abittoolongbutnotvery -> abittoolongbutnotvery 7 | } 8 | -------------------------------------------------------------------------------- /data/Test530.hs: -------------------------------------------------------------------------------- 1 | -- brittany { lconfig_columnAlignMode: { tag: ColumnAlignModeDisabled }, lconfig_indentPolicy: IndentPolicyLeft } 2 | func = 3 | fooooooooooooooooooooooooooooooooo 4 | + foooooooooooooooooooooooooooooooo 5 | foooooooooooooooooooooooooooooooo 6 | foooooooooooooooooooooooooooooooo 7 | -------------------------------------------------------------------------------- /data/Test531.hs: -------------------------------------------------------------------------------- 1 | -- brittany { lconfig_columnAlignMode: { tag: ColumnAlignModeDisabled }, lconfig_indentPolicy: IndentPolicyLeft } 2 | func = fooooooooooooooooooooooooooooooooo + foooooooooooooooooooooooooooooooo 3 | [ foooooooooooooooooooooooooooooooo 4 | , foooooooooooooooooooooooooooooooo 5 | , foooooooooooooooooooooooooooooooo 6 | ] 7 | -------------------------------------------------------------------------------- /data/Test532.hs: -------------------------------------------------------------------------------- 1 | -- brittany { lconfig_columnAlignMode: { tag: ColumnAlignModeDisabled }, lconfig_indentPolicy: IndentPolicyLeft } 2 | parserPrim = 3 | [ r 4 | | r <- 5 | [ SGPPrimFloat $ bool id (0 -) minus $ readGnok 6 | "parserPrim" 7 | (d1 ++ d2 ++ d3 ++ d4) 8 | | d2 <- string "." 9 | , d3 <- many1 (oneOf "0123456789") 10 | , _ <- string "f" 11 | ] 12 | <|> [ SGPPrimFloat $ bool id (0 -) minus $ fromIntegral 13 | (readGnok "parserPrim" d1 :: Integer) 14 | | _ <- string "f" 15 | ] 16 | <|> [ SGPPrimInt $ bool id (0 -) minus $ fromIntegral 17 | (readGnok "parserPrim" d1 :: Integer) 18 | | _ <- string "i" 19 | ] 20 | ] 21 | -------------------------------------------------------------------------------- /data/Test533.hs: -------------------------------------------------------------------------------- 1 | -- brittany { lconfig_columnAlignMode: { tag: ColumnAlignModeDisabled }, lconfig_indentPolicy: IndentPolicyLeft } 2 | samples = (SV.unpackaaaaadat) <&> \f -> 3 | aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa 4 | -------------------------------------------------------------------------------- /data/Test534.hs: -------------------------------------------------------------------------------- 1 | -- brittany { lconfig_columnAlignMode: { tag: ColumnAlignModeDisabled }, lconfig_indentPolicy: IndentPolicyLeft } 2 | runBrittany tabSize text = do 3 | let 4 | config' = staticDefaultConfig 5 | config = config' 6 | { _conf_layout = (_conf_layout config') 7 | { _lconfig_indentAmount = coerce tabSize 8 | } 9 | , _conf_forward = forwardOptionsSyntaxExtsEnabled 10 | } 11 | parsePrintModule config text 12 | -------------------------------------------------------------------------------- /data/Test535.hs: -------------------------------------------------------------------------------- 1 | -- brittany { lconfig_columnAlignMode: { tag: ColumnAlignModeDisabled }, lconfig_indentPolicy: IndentPolicyLeft } 2 | {-# LANGUAGE TypeApplications #-} 3 | foo = bar @Baz 4 | -------------------------------------------------------------------------------- /data/Test536.hs: -------------------------------------------------------------------------------- 1 | -- brittany { lconfig_columnAlignMode: { tag: ColumnAlignModeDisabled }, lconfig_indentPolicy: IndentPolicyLeft } 2 | {-# LANGUAGE TypeApplications #-} 3 | layoutPatternBindFinal alignmentToken binderDoc mPatDoc clauseDocs = do 4 | docAlt 5 | $ -- one-line solution 6 | [ docCols 7 | (ColBindingLine alignmentToken) 8 | [ docSeq (patPartInline ++ [guardPart]) 9 | , docSeq 10 | [ appSep $ return binderDoc 11 | , docForceSingleline $ return body 12 | , wherePart 13 | ] 14 | ] 15 | | not hasComments 16 | , [(guards, body, _bodyRaw)] <- [clauseDocs] 17 | , let guardPart = singleLineGuardsDoc guards 18 | , wherePart <- case mWhereDocs of 19 | Nothing -> return @[] $ docEmpty 20 | Just [w] -> return @[] $ docSeq 21 | [ docSeparator 22 | , appSep $ docLit $ Text.pack "where" 23 | , docSetIndentLevel $ docForceSingleline $ return w 24 | ] 25 | _ -> [] 26 | ] 27 | ++ -- one-line solution + where in next line(s) 28 | [ docLines 29 | $ [ docCols 30 | (ColBindingLine alignmentToken) 31 | [ docSeq (patPartInline ++ [guardPart]) 32 | , docSeq 33 | [appSep $ return binderDoc, docForceParSpacing $ return body] 34 | ] 35 | ] 36 | ++ wherePartMultiLine 37 | | [(guards, body, _bodyRaw)] <- [clauseDocs] 38 | , let guardPart = singleLineGuardsDoc guards 39 | , Data.Maybe.isJust mWhereDocs 40 | ] 41 | ++ -- two-line solution + where in next line(s) 42 | [ docLines 43 | $ [ docForceSingleline 44 | $ docSeq (patPartInline ++ [guardPart, return binderDoc]) 45 | , docEnsureIndent BrIndentRegular $ docForceSingleline $ return 46 | body 47 | ] 48 | ++ wherePartMultiLine 49 | | [(guards, body, _bodyRaw)] <- [clauseDocs] 50 | , let guardPart = singleLineGuardsDoc guards 51 | ] 52 | -------------------------------------------------------------------------------- /data/Test537.hs: -------------------------------------------------------------------------------- 1 | -- brittany { lconfig_columnAlignMode: { tag: ColumnAlignModeDisabled }, lconfig_indentPolicy: IndentPolicyLeft } 2 | {-# LANGUAGE MultiWayIf #-} 3 | func = do 4 | let 5 | foo = if 6 | | Constuctoooooooooooooooooooooooooooooooooooor `elem` artics -- TODO 7 | -> max 8 | (defLen - 0.2) -- TODO 9 | (defLen * 0.8) 10 | | otherwise -> max (defLen - 0.05) (defLen * 0.95) -- TODO 11 | return True 12 | -------------------------------------------------------------------------------- /data/Test538.hs: -------------------------------------------------------------------------------- 1 | -- brittany { lconfig_columnAlignMode: { tag: ColumnAlignModeDisabled }, lconfig_indentPolicy: IndentPolicyLeft } 2 | foo n = case n of 3 | 1 -> True 4 | -1 -> False 5 | bar n = case n of 6 | (-2, -2) -> (-2, -2) 7 | -------------------------------------------------------------------------------- /data/Test539.hs: -------------------------------------------------------------------------------- 1 | -- brittany { lconfig_columnAlignMode: { tag: ColumnAlignModeDisabled }, lconfig_indentPolicy: IndentPolicyLeft } 2 | {-# LANGUAGE TypeApplications #-} 3 | foo = 4 | let 5 | a = b @1 6 | cccc = () 7 | in foo 8 | -------------------------------------------------------------------------------- /data/Test54.hs: -------------------------------------------------------------------------------- 1 | {-# LANGUAGE ScopedTypeVariables #-} 2 | data MyRecord 3 | = forall a b 4 | . ( Loooooooooooooooooooooooooooooooong a 5 | , Loooooooooooooooooooooooooooooooong b 6 | ) => 7 | MyConstructor 8 | { a :: a 9 | , b :: b 10 | } 11 | -------------------------------------------------------------------------------- /data/Test540.hs: -------------------------------------------------------------------------------- 1 | -- brittany { lconfig_columnAlignMode: { tag: ColumnAlignModeDisabled }, lconfig_indentPolicy: IndentPolicyLeft } 2 | record :: Record 3 | record = Record 4 | { rProperties = 5 | [ "foo" .= "bar" 6 | , "foo" .= "bar" 7 | , "foo" .= "bar" 8 | , "foo" .= "bar" 9 | , "foo" .= "bar" 10 | , "foo" .= "bar" 11 | , "foo" .= "bar" 12 | , "foo" .= "bar" 13 | ] 14 | } 15 | -------------------------------------------------------------------------------- /data/Test55.hs: -------------------------------------------------------------------------------- 1 | {-# LANGUAGE ScopedTypeVariables #-} 2 | data MyStruct 3 | = forall a b 4 | . ( Loooooooooooooooooooooooooooooooong a 5 | , Loooooooooooooooooooooooooooooooong b 6 | ) => 7 | MyConstructor (ToBriDocM BriDocNumbered) 8 | (ToBriDocM BriDocNumbered) 9 | (ToBriDocM BriDocNumbered) 10 | -------------------------------------------------------------------------------- /data/Test56.hs: -------------------------------------------------------------------------------- 1 | {-# LANGUAGE ScopedTypeVariables #-} 2 | data MyRecord 3 | = forall a b 4 | . ( Loooooooooooooooooooooooooooooooong a 5 | , Loooooooooooooooooooooooooooooooong b 6 | ) => 7 | MyConstructor 8 | { foo, foo2 9 | :: loooooooooooooooooooooooooooooooong 10 | -> loooooooooooooooooooooooooooooooong 11 | , bar :: a 12 | , bazz :: b 13 | } 14 | deriving Show 15 | -------------------------------------------------------------------------------- /data/Test57.hs: -------------------------------------------------------------------------------- 1 | data Foo = Bar 2 | { foo :: Baz 3 | , bars :: Bizzz 4 | } 5 | deriving (Show, Eq, Monad, Functor, Traversable, Foldable) 6 | -------------------------------------------------------------------------------- /data/Test58.hs: -------------------------------------------------------------------------------- 1 | data Foo = Bar 2 | { foo :: Baz 3 | , bars :: Bizzz 4 | } 5 | deriving Show 6 | deriving (Eq, Ord) 7 | deriving stock Show 8 | deriving stock (Eq, Ord) 9 | deriving anyclass Show 10 | deriving anyclass (Show, Eq, Monad, Functor) 11 | deriving newtype Show 12 | deriving newtype (Traversable, Foldable) 13 | -------------------------------------------------------------------------------- /data/Test59.hs: -------------------------------------------------------------------------------- 1 | data Foo = Bar 2 | { foo :: Baz 3 | , bars :: Bizzz 4 | } 5 | deriving ToJSON via (SomeType) 6 | deriving (ToJSON, FromJSON) via (SomeType) 7 | -------------------------------------------------------------------------------- /data/Test6.hs: -------------------------------------------------------------------------------- 1 | func :: a -> (a -> a) 2 | -------------------------------------------------------------------------------- /data/Test60.hs: -------------------------------------------------------------------------------- 1 | {-# LANGUAGE ExistentialQuantification #-} 2 | data Foo = forall a . Show a => Bar 3 | { foo :: a 4 | } 5 | -------------------------------------------------------------------------------- /data/Test61.hs: -------------------------------------------------------------------------------- 1 | {-# LANGUAGE ExistentialQuantification #-} 2 | data Foo = forall a b . (Show a, Eq b) => Bar 3 | { foo :: a 4 | , bars :: b 5 | } 6 | -------------------------------------------------------------------------------- /data/Test62.hs: -------------------------------------------------------------------------------- 1 | -- before 2 | data MyData = MyData Int 3 | -- after 4 | -------------------------------------------------------------------------------- /data/Test63.hs: -------------------------------------------------------------------------------- 1 | data MyRecord = MyRecord 2 | { a :: Int 3 | -- comment 4 | , b :: Int 5 | } 6 | -------------------------------------------------------------------------------- /data/Test64.hs: -------------------------------------------------------------------------------- 1 | data Foo = Bar -- a 2 | { foo :: Baz -- b 3 | , bars :: Bizzz -- c 4 | } -- d 5 | deriving (Show, Eq, Monad, Functor, Traversable, Foldable) -- e 6 | -------------------------------------------------------------------------------- /data/Test65.hs: -------------------------------------------------------------------------------- 1 | data Foo = Bar 2 | { -- a 3 | foo -- b 4 | :: -- c 5 | Baz -- d 6 | , -- e 7 | bars :: Bizzz 8 | } 9 | deriving (Show, Eq, Monad, Functor, Traversable, Foldable) 10 | -------------------------------------------------------------------------------- /data/Test66.hs: -------------------------------------------------------------------------------- 1 | data Foo = Bar 2 | { foo :: Baz 3 | , bars :: Bizzz 4 | } 5 | -- a 6 | deriving --b 7 | ( -- c 8 | ToJSON -- d 9 | , -- e 10 | FromJSON --f 11 | ) -- g 12 | -------------------------------------------------------------------------------- /data/Test67.hs: -------------------------------------------------------------------------------- 1 | data Foo = Bar 2 | { foo :: Baz 3 | , bars :: Bizzz 4 | } 5 | -- a 6 | deriving --a 7 | ToJSON --b 8 | via -- c 9 | ( -- d 10 | SomeType --e 11 | , -- f 12 | ABC --g 13 | ) 14 | -------------------------------------------------------------------------------- /data/Test68.hs: -------------------------------------------------------------------------------- 1 | {-# LANGUAGE ExistentialQuantification #-} 2 | data MyRecord 3 | -- test comment 4 | = forall a b 5 | . ( Loooooooooooooooooooooooooooooooong a 6 | , Loooooooooooooooooooooooooooooooong b 7 | ) => 8 | MyConstructor a b 9 | -------------------------------------------------------------------------------- /data/Test69.hs: -------------------------------------------------------------------------------- 1 | -- brittany {lconfig_indentPolicy: IndentPolicyLeft } 2 | data EnterpriseGrantsForCompanyResponse = EnterpriseGrantsForCompanyResponse 3 | Types.Company 4 | [EnterpriseGrantResponse] 5 | -------------------------------------------------------------------------------- /data/Test7.hs: -------------------------------------------------------------------------------- 1 | func :: (((((((((()))))))))) 2 | -- current output is.. funny. wonder if that can/needs to be improved.. 3 | -------------------------------------------------------------------------------- /data/Test70.hs: -------------------------------------------------------------------------------- 1 | -- brittany {lconfig_indentPolicy: IndentPolicyFree } 2 | data GrantsForCompanyResp = GrantsForCompanyResp Types.Company 3 | [EnterpriseGrantResponse] 4 | -------------------------------------------------------------------------------- /data/Test71.hs: -------------------------------------------------------------------------------- 1 | -- brittany {lconfig_indentPolicy: IndentPolicyFree } 2 | data EnterpriseGrantsForCompanyResponse = EnterpriseGrantsForCompanyResponse 3 | Types.Company 4 | [EnterpriseGrantResponse] 5 | -------------------------------------------------------------------------------- /data/Test72.hs: -------------------------------------------------------------------------------- 1 | -- brittany {lconfig_indentPolicy: IndentPolicyMultiple } 2 | data GrantsForCompanyResp = GrantsForCompanyResp Types.Company 3 | [EnterpriseGrantResponse] 4 | -------------------------------------------------------------------------------- /data/Test73.hs: -------------------------------------------------------------------------------- 1 | data XIILqcacwiuNiu = XIILqcacwiuNiu 2 | { oyyFtvbepgbOge_pebzVmuftEijwuj :: Jgtoyuh HessJvNlo 3 | , wloQsiskdoxJop_xatiKrwedOxtu :: Jgtoyuh [Inotg] 4 | , mmmJjcqtemyIyo_ovosDoreKeeoyamvove :: Jgtoyuh Eujo 5 | , mbiIatelofxOzr_uluxNngiiMjah :: Jgtoyuh HessJvNlo 6 | , obxIskfcxpkIkb_uuviTuevcSkrgo :: Jgtoyuh Int 7 | , wqrAtuvuecoHwr_ilotNxbuPleo :: Jgtoyuh Ufaxdeq 8 | , lofAfuebdhpLuv_cnekPoyFxmg :: Jgtoyuh Ufaxdeq 9 | , ouoFugtawzvUpk_oupiLzptugy :: Jgtoyuh Eujo 10 | , iqiXjtziwogNsa_uiyvSunaTtgUsf3 :: Jgtoyuh Oaivn 11 | , odbIriaqnojUlz_onotoWuunehIpuy :: Jgtoyuh Eujo 12 | , opjUxtkxzkiKse_luqjuZazt 13 | :: Jgtoyuh [(Eujo, Int, Int, Int, Int, Int, NELUxro)] 14 | -- , jcqRaqznxfhIpa_ywevMezmoYkutuwa :: Jgtoyuh () 15 | , vayOmuasyphOfd_bcsVljmvt :: Jgtoyuh Eujo 16 | , rifArahilooRax_ufikecqdImsv :: Jgtoyuh Oaivn 17 | , raqKtopcpszDwb_oqocubasZuqjcryoDojGkw :: Jgtoyuh Oaivn 18 | , mluJiilpcijUtt_gaisklifVekfeyagRmfbyzz :: Jgtoyuh Oaivn 19 | , oqhPaahjupaSmi_gamwwoovKyxznecvEayluc :: Jgtoyuh Oaivn 20 | , mazFubimwebZpa_itidehDodiDlboz :: Jgtoyuh Vrep 21 | , jeyOcuesexaYoy_vpqn :: Jgtoyuh () 22 | } 23 | -------------------------------------------------------------------------------- /data/Test74.hs: -------------------------------------------------------------------------------- 1 | func x = x 2 | -------------------------------------------------------------------------------- /data/Test75.hs: -------------------------------------------------------------------------------- 1 | x *** y = x 2 | -------------------------------------------------------------------------------- /data/Test76.hs: -------------------------------------------------------------------------------- 1 | (***) x y = x 2 | -------------------------------------------------------------------------------- /data/Test77.hs: -------------------------------------------------------------------------------- 1 | (f >=> g) k = f k >>= g 2 | -------------------------------------------------------------------------------- /data/Test78.hs: -------------------------------------------------------------------------------- 1 | (Left a <$$> Left dd) e f = True 2 | (Left a <$$> Right d ) e f = True 3 | (Right a <$$> Left d ) e f = False 4 | (Right a <$$> Right dd) e f = True 5 | -------------------------------------------------------------------------------- /data/Test79.hs: -------------------------------------------------------------------------------- 1 | func _ = x 2 | -------------------------------------------------------------------------------- /data/Test8.hs: -------------------------------------------------------------------------------- 1 | func :: () 2 | -------------------------------------------------------------------------------- /data/Test80.hs: -------------------------------------------------------------------------------- 1 | func reallyreallyreallyreallyreallyreallyreallyreallyreallyreallylongvariable = 2 | x 3 | -------------------------------------------------------------------------------- /data/Test81.hs: -------------------------------------------------------------------------------- 1 | func reallyreallyreallyreallyreallyreallyreallyreallyreallyreallylongvariable reallyreallyreallyreallyreallyreallyreallyreallyreallyreallylongvariable 2 | = x 3 | -------------------------------------------------------------------------------- /data/Test82.hs: -------------------------------------------------------------------------------- 1 | func reallyreallyreallyreallyreallyreallyreallyreallyreallyreallylongvariable a b 2 | = x 3 | -------------------------------------------------------------------------------- /data/Test83.hs: -------------------------------------------------------------------------------- 1 | func (A a) = a 2 | -------------------------------------------------------------------------------- /data/Test84.hs: -------------------------------------------------------------------------------- 1 | func (x : xr) = x 2 | -------------------------------------------------------------------------------- /data/Test85.hs: -------------------------------------------------------------------------------- 1 | func (x :+: xr) = x 2 | -------------------------------------------------------------------------------- /data/Test86.hs: -------------------------------------------------------------------------------- 1 | func (x `Foo` xr) = x 2 | -------------------------------------------------------------------------------- /data/Test87.hs: -------------------------------------------------------------------------------- 1 | func | True = x 2 | -------------------------------------------------------------------------------- /data/Test88.hs: -------------------------------------------------------------------------------- 1 | func x | x = simple expression 2 | | otherwise = 0 3 | -------------------------------------------------------------------------------- /data/Test89.hs: -------------------------------------------------------------------------------- 1 | func x 2 | | a somewhat longer guard x = "and a somewhat longer expession that does not" 3 | | otherwise = "fit without putting the guards in new lines" 4 | -------------------------------------------------------------------------------- /data/Test9.hs: -------------------------------------------------------------------------------- 1 | func 2 | :: ( lkasdlkjalsdjlakjsdlkjasldkjalskdjlkajsd 3 | -> lakjsdlkjasldkj 4 | -> lakjsdlkjasldkj 5 | ) 6 | -------------------------------------------------------------------------------- /data/Test90.hs: -------------------------------------------------------------------------------- 1 | func x 2 | | very long guard, another rather long guard that refers to x = nontrivial 3 | expression 4 | foo 5 | bar 6 | alsdkjlasdjlasj 7 | | otherwise = 0 8 | -------------------------------------------------------------------------------- /data/Test91.hs: -------------------------------------------------------------------------------- 1 | func x 2 | | very long guard, another rather long guard that refers to x 3 | = nontrivialexpression foo bar alsdkjlasdjlasj 4 | | otherwise 5 | = 0 6 | -------------------------------------------------------------------------------- /data/Test92.hs: -------------------------------------------------------------------------------- 1 | func x 2 | | very loooooooooooooooooooooooooooooong guard 3 | , another rather long guard that refers to x 4 | = nontrivial expression foo bar alsdkjlasdjlasj 5 | | otherwise 6 | = 0 7 | -------------------------------------------------------------------------------- /data/Test93.hs: -------------------------------------------------------------------------------- 1 | func = x 2 | describe "infix op" $ do 3 | -------------------------------------------------------------------------------- /data/Test94.hs: -------------------------------------------------------------------------------- 1 | func = x + x 2 | -------------------------------------------------------------------------------- /data/Test95.hs: -------------------------------------------------------------------------------- 1 | func = 2 | mweroiuxlskdfjlksjdflkjsdfljksldkjflkjsdflkj 3 | + mweroiuxlskdfjlksjdflkjsdfljksldkjflkjsdflkj 4 | -------------------------------------------------------------------------------- /data/Test96.hs: -------------------------------------------------------------------------------- 1 | func = 2 | mweroiuxlskdfjlksjdflkjsdfljksldkjflkjsdflkj 3 | + mweroiuxlskdfjlksj 4 | + mweroiuxlskdfjlksj 5 | -------------------------------------------------------------------------------- /data/Test97.hs: -------------------------------------------------------------------------------- 1 | func = 2 | mweroiuxlskdfjlksj 3 | + mweroiuxlskdfjlksj 4 | + mweroiuxlskdfjlksjdflkjsdfljksldkjflkjsdflkj 5 | -------------------------------------------------------------------------------- /data/Test98.hs: -------------------------------------------------------------------------------- 1 | func = 1 2 | func = "abc" 3 | func = 1.1e5 4 | func = 'x' 5 | func = 981409823458910394810928414192837123987123987123 6 | -------------------------------------------------------------------------------- /data/Test99.hs: -------------------------------------------------------------------------------- 1 | func = \x -> abc 2 | describe "app" $ do 3 | -------------------------------------------------------------------------------- /data/brittany.yaml: -------------------------------------------------------------------------------- 1 | conf_layout: 2 | lconfig_allowSingleLineExportList: true 3 | lconfig_importAsColumn: 60 4 | lconfig_importColumn: 60 5 | -------------------------------------------------------------------------------- /doc-svg-gen/Setup.hs: -------------------------------------------------------------------------------- 1 | import Distribution.Simple 2 | main = defaultMain 3 | -------------------------------------------------------------------------------- /doc-svg-gen/doc-svg-gen.cabal: -------------------------------------------------------------------------------- 1 | name: doc-svg-gen 2 | version: 0.1.0.0 3 | build-type: Simple 4 | cabal-version: >=1.10 5 | 6 | executable doc-svg-gen 7 | buildable: False 8 | main-is: Main.hs 9 | -- other-modules: 10 | -- other-extensions: 11 | build-depends: 12 | { base >=4.9 && <4.11 13 | , text 14 | , graphviz >=2999.19.0.0 15 | } 16 | -- hs-source-dirs: src 17 | default-language: Haskell2010 18 | default-extensions: { 19 | } 20 | ghc-options: { 21 | -Wall 22 | -fprof-auto -fprof-cafs -fno-spec-constr 23 | -j 24 | -fno-warn-unused-imports 25 | -fno-warn-orphans 26 | -rtsopts 27 | -with-rtsopts "-M2G" 28 | } 29 | -------------------------------------------------------------------------------- /doc-svg-gen/generated/.gitignore: -------------------------------------------------------------------------------- 1 | *.pdf 2 | -------------------------------------------------------------------------------- /doc/hcar/Brittany.tex: -------------------------------------------------------------------------------- 1 | % Brittany-LB.tex 2 | \begin{hcarentry}[updated]{Brittany} 3 | \report{Lennart Spitzner}%11/17 4 | \status{work in progress} 5 | \makeheader 6 | 7 | Brittany is a Haskell source code formatting tool. It is based on 8 | ghc-exactprint and thus uses the ghc parser, in contrast to tools based on 9 | haskell-src-exts such as hindent or haskell-formatter. 10 | 11 | The goals of the project are to: 12 | 13 | \begin{compactitem} 14 | \item support the full ghc-haskell syntax including syntactic extensions; 15 | \item retain newlines and comments unmodified (to the degree possible when 16 | code around them gets reformatted); 17 | \item be clever about using horizontal space while not overflowing it if it 18 | cannot be avoided; 19 | \item have linear complexity in the size of the input text / the number of 20 | syntactic nodes in the input. 21 | \item support horizontal alignments (e.g. different equations/pattern matches 22 | in the some function's definition). 23 | \end{compactitem} 24 | 25 | In contrast to other formatters brittany internally works in two steps: 26 | Firstly transforming the syntax tree into a document tree representation, 27 | similar to the document representation in general-purpose pretty-printers such 28 | as the \emph{pretty} package, but much more specialized for the specific 29 | purpose of handling a Haskell source code document. Secondly this document 30 | representation is transformed into the output text document. This approach 31 | allows to handle many different syntactic constructs in a uniform way, making 32 | it possible to attain the above goals with a manageable amount of work. 33 | 34 | Brittany is work in progress; currently only type signatures and function 35 | bindings are transformed, and not all syntactic constructs are supported. 36 | Nonetheless Brittany is safe to try/use as there are checks in place to ensure 37 | that the output is syntactically valid. 38 | 39 | Brittany requires ghc-8.*, and is available on Hackage and on Stackage. 40 | 41 | \FurtherReading 42 | \begin{compactitem} 43 | \item \url{https://github.com/lspitzner/brittany} 44 | \end{compactitem} 45 | \end{hcarentry} 46 | -------------------------------------------------------------------------------- /doc/implementation/dataflow.md: -------------------------------------------------------------------------------- 1 | # Dataflow 2 | 3 | From the program design standpoint, Brittany performes a 4 | `Config -> Text -> Text` transformation; it is not interactive in any way and 5 | it processes the whole input at once (no streaming going on). This makes for 6 | a very simple design with nice separation of IO and non-IO. 7 | 8 | Brittany makes heavy usage of mtl-on-steroids-style transformers, mostly 9 | limited to Reader, Writer and State. For this kind of task it makes a lot of 10 | sense; we do a pure transformation involving multiple steps 11 | that each requires certain local state during traversals of recursive data 12 | structures. By using MultiRWS we can even entirely avoid using lens without 13 | inducing too much boilerplate. 14 | 15 | Firstly, the topmost layer, the IO bits: 16 | 17 | 18 | 19 | The corresponding code is in these modules: 20 | 21 | - `Main` 22 | - `Language.Haskell.Brittany` 23 | 24 | The latter [contains the code to run our Reader/Writer/State stack](https://github.com/lspitzner/brittany/blob/7775812cfdc7d2596883f87b5ba9207fbf61f2b3/src/Language/Haskell/Brittany.hs#L64-L75) (well, no state yet). 25 | 26 | Note that `MultiRWS` here behaves like a nicer version of a stack like 27 | `ReaderT x (ReaderT y (WriterT w1 (WriterT2 w2 (Writer w3)..)`. 28 | The next graph zooms in on that transformation: 29 | 30 | 31 | 32 | Two places (The `BriDoc` generation and the backend) have additional local 33 | state (added to the monadic context). 34 | The following is a very simplified description of the BriDoc generation: 35 | 36 | 37 | 38 | 39 | For the `BriDoc` generation, the relevant modules are 40 | - `Language.Haskell.Brittany.Layouters.*` 41 | - `Language.Haskell.Brittany.LayouterBasics` 42 | 43 | For the `BriDoc` tree transformations, the relevant modules are 44 | - `Language.Haskell.Brittany.Transformations.*` 45 | 46 | Finally, for the backend, the relevant modules are 47 | - `Language.Haskell.Brittany.Backend` 48 | - `Language.Haskell.Brittany.BackendUtils` 49 | 50 | -------------------------------------------------------------------------------- /doc/implementation/index.md: -------------------------------------------------------------------------------- 1 | - [theory](theory.md) 2 | 3 | Explains the core idea of the formatter that makes it so cool. 4 | 5 | - [dataflow](dataflow.md) 6 | 7 | Looking at how the data is tranformed should give the reader a good 8 | idea of the high-level design, given that Brittany essentially 9 | performs a `Text -> Text` transformation. 10 | 11 | - [bridoc-design](bridoc-design.md) 12 | 13 | An explanation of the `BriDoc` datatype focussed on (potential) contributors 14 | that wish to add support for more syntactical constructs. 15 | 16 | - [bridoc-api](bridoc-api.md) 17 | 18 | Specifying the semantics of the different (smart) constructors of the 19 | `BriDoc` type. 20 | 21 | - [exactprinting](exactprinting.md) 22 | 23 | A closer look at how we achieve exactprinting, i.e. keeping comments and 24 | certain whitespace (empty lines) as they appear in the input source code. 25 | 26 | - Brittany uses the following (randomly deemed noteworthy) libraries: 27 | 28 | - [`ghc-exactprint`](https://hackage.haskell.org/package/ghc-exactprint) 29 | (and [`ghc`](https://hackage.haskell.org/package/ghc)) for parsing of haskell source; 30 | - [`uniplate`](https://hackage.haskell.org/package/uniplate) 31 | for efficient transformations on the recursive `BriDoc` datatype; 32 | this powers the main computational work done by Brittany; 33 | - [`monad-memo`](https://hackage.haskell.org/package/monad-memo) 34 | for explicit function memoization; 35 | - [`multistate`](https://hackage.haskell.org/package/multistate) 36 | as an alternative to an unwieldly transformer stack; 37 | - [`butcher`](https://github.com/lspitzner/butcher) 38 | for parsing commandline arguments (as an alternative to 39 | [`optparse-applicative`](https://hackage.haskell.org/package/optparse-applicative)) 40 | - [`yaml`](https://hackage.haskell.org/package/yaml) 41 | to handle config file; 42 | - [`safe`](https://hackage.haskell.org/package/safe) 43 | and 44 | [`unsafe`](https://hackage.haskell.org/package/unsafe) 45 | (heh). 46 | 47 | -------------------------------------------------------------------------------- /doc/implementation/output-example-01.md: -------------------------------------------------------------------------------- 1 | invocation: 2 | 3 | ~~~~ 4 | > brittany --dump-ast-full 5 | ~~~~ 6 | 7 | input (via stdin, remember ctrl-d to end-of-file): 8 | 9 | ~~~~ 10 | id :: a -> a 11 | ~~~~ 12 | 13 | output (all but the last line is stderr): 14 | 15 | ~~~~ 16 | ---- ast ---- 17 | A Just (Ann (DP (0,0)) [] [] [((G AnnEofPos),DP (1,0))] Nothing Nothing) 18 | HsModule 19 | Nothing 20 | Nothing 21 | [] 22 | [ A Just (Ann (DP (0,0)) [] [] [((G AnnDcolon),DP (0,1))] Nothing Nothing) 23 | SigD 24 | TypeSig 25 | [ A Just (Ann (DP (0,0)) [] [] [((G AnnVal),DP (0,0))] Nothing Nothing) 26 | Unqual {OccName: id} 27 | ] 28 | HsIB 29 | PlaceHolder 30 | HsWC 31 | PlaceHolder 32 | Nothing 33 | A Just (Ann (DP (0,1)) [] [] [((G AnnRarrow),DP (0,1))] Nothing Nothing) 34 | HsFunTy 35 | A Just (Ann (DP (0,0)) [] [] [] Nothing Nothing) 36 | HsAppsTy 37 | [ A Just (Ann (DP (0,0)) [] [] [] Nothing Nothing) 38 | HsAppPrefix 39 | A Just (Ann (DP (0,0)) [] [] [] Nothing Nothing) 40 | HsTyVar 41 | A Just (Ann (DP (0,0)) [] [] [((G AnnVal),DP (0,0))] Nothing Nothing) 42 | Unqual {OccName: a} 43 | ] 44 | A Just (Ann (DP (0,1)) [] [] [] Nothing Nothing) 45 | HsAppsTy 46 | [ A Just (Ann (DP (0,0)) [] [] [] Nothing Nothing) 47 | HsAppPrefix 48 | A Just (Ann (DP (0,0)) [] [] [] Nothing Nothing) 49 | HsTyVar 50 | A Just (Ann (DP (0,0)) [] [] [((G AnnVal),DP (0,0))] Nothing Nothing) 51 | Unqual {OccName: a} 52 | ] 53 | ] 54 | Nothing 55 | Nothing 56 | ---- 57 | id :: a -> a 58 | ~~~~ 59 | 60 | -------------------------------------------------------------------------------- /doc/implementation/output-example-02.md: -------------------------------------------------------------------------------- 1 | invocation: 2 | 3 | ~~~~ 4 | > brittany --dump-bridoc-raw 5 | ~~~~ 6 | 7 | input (via stdin, remember ctrl-d to end-of-file): 8 | 9 | ~~~~ 10 | x :: Maybe Int 11 | ~~~~ 12 | 13 | output (all but the last line is stderr): 14 | 15 | ~~~~ 16 | ---- bridoc raw ---- 17 | BDAlt 18 | [ BDSeq 19 | [ BDSeq [BDLit (pack "x"),BDSeparator] 20 | , BDSeq [BDLit (pack "::"),BDSeparator] 21 | , BDForceSingleline 22 | BDAlt 23 | [ BDSeq [BDForceSingleline (BDLit (pack "Maybe")),BDLit (pack " "),BDForceSingleline (BDLit (pack "Int"))] 24 | , BDPar BrIndentNone (BDLit (pack "Maybe")) (BDLines [BDEnsureIndent BrIndentRegular (BDLit (pack "Int"))]) 25 | ] 26 | ] 27 | , BDAddBaseY 28 | BrIndentRegular 29 | BDPar 30 | BrIndentNone 31 | BDLit (pack "x") 32 | BDCols 33 | ColTyOpPrefix 34 | [ BDLit (pack ":: ") 35 | , BDAddBaseY 36 | BrIndentSpecial 3 37 | BDAlt 38 | [ BDSeq [BDForceSingleline (BDLit (pack "Maybe")),BDLit (pack " "),BDForceSingleline (BDLit (pack "Int"))] 39 | , BDPar BrIndentNone (BDLit (pack "Maybe")) (BDLines [BDEnsureIndent BrIndentRegular (BDLit (pack "Int"))]) 40 | ] 41 | ] 42 | ] 43 | ---- 44 | x :: Maybe Int 45 | ~~~~ 46 | 47 | -------------------------------------------------------------------------------- /doc/implementation/output-example-03.md: -------------------------------------------------------------------------------- 1 | invocation: 2 | 3 | ~~~~ 4 | > brittany --dump-bridoc-alt --dump-bridoc-final 5 | ~~~~ 6 | 7 | input (via stdin, remember ctrl-d to end-of-file): 8 | 9 | ~~~~ 10 | x :: Maybe Int 11 | ~~~~ 12 | 13 | output (all but the last line is stderr): 14 | 15 | ~~~~ 16 | ---- bridoc post-alt ---- 17 | BDSeq [BDSeq [BDLit (pack "x"),BDSeparator],BDSeq [BDLit (pack "::"),BDSeparator],BDSeq [BDLit (pack "Maybe"),BDLit (pack " "),BDLit (pack "Int")]] 18 | ---- bridoc final ---- 19 | BDSeq [BDLit (pack "x"),BDSeparator,BDLit (pack "::"),BDSeparator,BDLit (pack "Maybe"),BDLit (pack " "),BDLit (pack "Int")] 20 | ---- 21 | x :: Maybe Int 22 | ~~~~ 23 | 24 | -------------------------------------------------------------------------------- /doc/showcases/Layout_Interactions.md: -------------------------------------------------------------------------------- 1 | # Syntactical element interaction example layouts 2 | 3 | Last updated for brittany version `0.8.0.1`. 4 | 5 | Brittany would layout the following bindings as displayed here. If you change 6 | only the layout of these bindings in some way (e.g. if some lines overflowed 7 | 80 columns) and pass it through brittany, you would again get the below 8 | versions. 9 | 10 | 11 | #### Nested ifs 12 | 13 | ~~~~.hs 14 | mybinding = if condition1 15 | then if condition2 16 | then if condition3 then 0 else 1 17 | else if condition3 then 2 else 3 18 | else 4 19 | ~~~~ 20 | 21 | #### if -> case -> do 22 | 23 | ~~~~.hs 24 | mybinding = if GHC.xopt GHC.Cpp dynFlags 25 | then case cppMode of 26 | CPPModeAbort -> do 27 | return $ Left "Encountered -XCPP. Aborting." 28 | CPPModeWarn -> do 29 | putStrErrLn 30 | $ "Warning: Encountered -XCPP." 31 | ++ " Be warned that -XCPP is not supported and that" 32 | ++ " brittany cannot check that its output is syntactically" 33 | ++ " valid in its presence." 34 | return $ Right True 35 | CPPModeNowarn -> return $ Right True 36 | else return $ Right False 37 | ~~~~ 38 | 39 | #### single line ending with start of do-block 40 | 41 | ~~~~.hs 42 | mybinding = RH.performEvent_ $ postBuild <&> \() -> liftIO $ do 43 | runMaybeT postCliInit >>= \case 44 | Nothing -> return () 45 | Just () -> do 46 | _ <- forkIO $ postCliInitAsync `catch` \(e :: SomeException) -> 47 | writeLogS LogLevelError (show e) 48 | return () 49 | ~~~~ 50 | 51 | #### record-syntax + do-block 52 | 53 | ~~~~.hs 54 | myBinding = Booh 55 | { booh_id = name 56 | , booh_parser = name 57 | , booh_query = someLongFunction name ["thingy"] $ do 58 | cps <- zu (Text.pack "thingy") 59 | SampleRate sri <- askConfig' conf_defaultSampleRate 60 | buildLinearState myBinding [cps] 61 | } 62 | ~~~~ 63 | 64 | -------------------------------------------------------------------------------- /doc/showcases/Layout_Types.md: -------------------------------------------------------------------------------- 1 | # Example type signature layouts 2 | 3 | Last updated for brittany version `0.8.0.1`. 4 | 5 | Brittany would layout the following signatures as displayed here. If you change 6 | only the layout of these signatures in some way (e.g. if you initially entered 7 | them as one-liners) and pass it through brittany, you would (again) get the 8 | below versions. 9 | 10 | ~~~~.hs 11 | docExt 12 | :: (ExactPrint.Annotate.Annotate ast) 13 | => Located ast 14 | -> ExactPrint.Types.Anns 15 | -> Bool 16 | -> ToBriDocM BriDocNumbered 17 | ~~~~ 18 | 19 | ~~~~.hs 20 | processDefault 21 | :: ( ExactPrint.Annotate.Annotate ast 22 | , MonadMultiWriter Text.Builder.Builder m 23 | , MonadMultiReader ExactPrint.Types.Anns m 24 | ) 25 | => Located ast 26 | -> m () 27 | ~~~~ 28 | 29 | ~~~~.hs 30 | linewise 31 | :: forall n t 32 | . (Ord n, R.ReflexHost t, MonadIO (R.PushM t), MonadIO (R.HostFrame t)) 33 | => ( R.Event t Text -- command string executed by user 34 | -> R.Dynamic t (Maybe Text, Int, Text) 35 | -> R.Behavior t (Seq Text) -- history 36 | -> R.Event t () -- post-shutdown 37 | -> RH.AppHost 38 | t 39 | ( R.Event t () -- shutdown trigger 40 | , R.Behavior t String -- tab-completion value 41 | , R.Dynamic t (Widget n) 42 | ) 43 | ) 44 | -> RH.AppHost t () 45 | ~~~~ 46 | 47 | ~~~~.hs 48 | linewise :: 49 | forall n t. 50 | (Ord n, R.ReflexHost t, MonadIO (R.PushM t), MonadIO (R.HostFrame t)) 51 | => (R.Event t Text -- command string executed by user 52 | -> R.Dynamic t (Maybe Text, Int, Text) -> R.Behavior t (Seq Text) -- history 53 | -> R.Event t () -- post-shutdown 54 | -> RH.AppHost t ( R.Event t () -- shutdown trigger 55 | , R.Behavior t String -- tab-completion value 56 | , R.Dynamic t (Widget n))) 57 | -> RH.AppHost t () 58 | ~~~~ 59 | 60 | ~~~~.hs 61 | processDefault :: 62 | ( ExactPrint.Annotate.Annotate ast 63 | , MonadMultiWriter Text.Builder.Builder m 64 | , MonadMultiReader ExactPrint.Types.Anns m 65 | ) 66 | => Located ast 67 | -> m () 68 | ~~~~ 69 | -------------------------------------------------------------------------------- /output/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 3 | -------------------------------------------------------------------------------- /source/executable/Main.hs: -------------------------------------------------------------------------------- 1 | import qualified Language.Haskell.Brittany.Main as BrittanyMain 2 | 3 | main :: IO () 4 | main = BrittanyMain.main 5 | -------------------------------------------------------------------------------- /source/library/Language/Haskell/Brittany.hs: -------------------------------------------------------------------------------- 1 | {-# LANGUAGE NoImplicitPrelude #-} 2 | 3 | module Language.Haskell.Brittany 4 | ( parsePrintModule 5 | , staticDefaultConfig 6 | , forwardOptionsSyntaxExtsEnabled 7 | , userConfigPath 8 | , findLocalConfigPath 9 | , readConfigs 10 | , readConfigsWithUserConfig 11 | , Config 12 | , CConfig(..) 13 | , CDebugConfig(..) 14 | , CLayoutConfig(..) 15 | , CErrorHandlingConfig(..) 16 | , CForwardOptions(..) 17 | , CPreProcessorConfig(..) 18 | , BrittanyError(..) 19 | ) where 20 | 21 | import Language.Haskell.Brittany.Internal 22 | import Language.Haskell.Brittany.Internal.Config 23 | import Language.Haskell.Brittany.Internal.Config.Types 24 | import Language.Haskell.Brittany.Internal.Types 25 | -------------------------------------------------------------------------------- /source/library/Language/Haskell/Brittany/Internal/Layouters/Expr.hs-boot: -------------------------------------------------------------------------------- 1 | {-# LANGUAGE NoImplicitPrelude #-} 2 | 3 | module Language.Haskell.Brittany.Internal.Layouters.Expr where 4 | 5 | import GHC.Hs 6 | import Language.Haskell.Brittany.Internal.Types 7 | 8 | 9 | 10 | layoutExpr :: ToBriDoc HsExpr 11 | 12 | -- layoutStmt :: ToBriDoc' (StmtLR GhcPs GhcPs (LHsExpr GhcPs)) 13 | 14 | litBriDoc :: HsLit GhcPs -> BriDocFInt 15 | 16 | overLitValBriDoc :: OverLitVal -> BriDocFInt 17 | -------------------------------------------------------------------------------- /source/library/Language/Haskell/Brittany/Internal/Layouters/Stmt.hs-boot: -------------------------------------------------------------------------------- 1 | {-# LANGUAGE NoImplicitPrelude #-} 2 | 3 | module Language.Haskell.Brittany.Internal.Layouters.Stmt where 4 | 5 | import GHC.Hs 6 | import Language.Haskell.Brittany.Internal.Types 7 | 8 | 9 | 10 | layoutStmt :: ToBriDoc' (StmtLR GhcPs GhcPs (LHsExpr GhcPs)) 11 | -------------------------------------------------------------------------------- /source/library/Language/Haskell/Brittany/Internal/PreludeUtils.hs: -------------------------------------------------------------------------------- 1 | {-# OPTIONS_GHC -fno-warn-orphans #-} 2 | 3 | module Language.Haskell.Brittany.Internal.PreludeUtils where 4 | 5 | import Control.Applicative 6 | import Control.DeepSeq (NFData, force) 7 | import Control.Exception.Base (evaluate) 8 | import Control.Monad 9 | import qualified Data.Strict.Maybe as Strict 10 | import Debug.Trace 11 | import Prelude 12 | import System.IO 13 | 14 | 15 | 16 | instance Applicative Strict.Maybe where 17 | pure = Strict.Just 18 | Strict.Just f <*> Strict.Just x = Strict.Just (f x) 19 | _ <*> _ = Strict.Nothing 20 | 21 | instance Monad Strict.Maybe where 22 | Strict.Nothing >>= _ = Strict.Nothing 23 | Strict.Just x >>= f = f x 24 | 25 | instance Alternative Strict.Maybe where 26 | empty = Strict.Nothing 27 | x <|> Strict.Nothing = x 28 | _ <|> x = x 29 | 30 | traceFunctionWith 31 | :: String -> (a -> String) -> (b -> String) -> (a -> b) -> (a -> b) 32 | traceFunctionWith name s1 s2 f x = trace traceStr y 33 | where 34 | y = f x 35 | traceStr = name ++ "\nBEFORE:\n" ++ s1 x ++ "\nAFTER:\n" ++ s2 y 36 | 37 | (<&!>) :: Monad m => m a -> (a -> b) -> m b 38 | (<&!>) = flip (<$!>) 39 | 40 | putStrErrLn :: String -> IO () 41 | putStrErrLn s = hPutStrLn stderr s 42 | 43 | putStrErr :: String -> IO () 44 | putStrErr s = hPutStr stderr s 45 | 46 | printErr :: Show a => a -> IO () 47 | printErr = putStrErrLn . show 48 | 49 | errorIf :: Bool -> a -> a 50 | errorIf False = id 51 | errorIf True = error "errorIf" 52 | 53 | errorIfNote :: Maybe String -> a -> a 54 | errorIfNote Nothing = id 55 | errorIfNote (Just x) = error x 56 | 57 | (<&>) :: Functor f => f a -> (a -> b) -> f b 58 | (<&>) = flip fmap 59 | infixl 4 <&> 60 | 61 | (.>) :: (a -> b) -> (b -> c) -> (a -> c) 62 | f .> g = g . f 63 | infixl 9 .> 64 | 65 | evaluateDeep :: NFData a => a -> IO a 66 | evaluateDeep = evaluate . force 67 | -------------------------------------------------------------------------------- /source/library/Language/Haskell/Brittany/Internal/Transformations/Indent.hs: -------------------------------------------------------------------------------- 1 | {-# LANGUAGE LambdaCase #-} 2 | {-# LANGUAGE NoImplicitPrelude #-} 3 | 4 | module Language.Haskell.Brittany.Internal.Transformations.Indent where 5 | 6 | import qualified Data.Generics.Uniplate.Direct as Uniplate 7 | import qualified GHC.OldList as List 8 | import Language.Haskell.Brittany.Internal.Prelude 9 | import Language.Haskell.Brittany.Internal.Types 10 | 11 | 12 | 13 | -- prepare layouting by translating BDPar's, replacing them with Indents and 14 | -- floating those in. This gives a more clear picture of what exactly is 15 | -- affected by what amount of indentation. 16 | transformSimplifyIndent :: BriDoc -> BriDoc 17 | transformSimplifyIndent = Uniplate.rewrite $ \case 18 | BDPar ind (BDLines lines) indented -> 19 | Just $ BDEnsureIndent ind $ BDLines $ lines ++ [indented] 20 | BDPar ind (BDCols sig cols) indented -> 21 | Just $ BDCols sig (List.init cols ++ [BDPar ind (List.last cols) indented]) 22 | BDPar BrIndentNone _ _ -> Nothing 23 | BDPar ind x indented -> 24 | Just $ BDPar BrIndentNone (BDAddBaseY ind x) (BDEnsureIndent ind indented) 25 | -- BDPar ind x indented -> 26 | -- Just $ BDLines 27 | -- [ BDAddBaseY ind x 28 | -- , BDEnsureIndent ind indented 29 | -- ] 30 | BDLines lines 31 | | any 32 | (\case 33 | BDLines{} -> True 34 | BDEmpty{} -> True 35 | _ -> False 36 | ) 37 | lines 38 | -> Just $ BDLines $ filter isNotEmpty $ lines >>= \case 39 | BDLines l -> l 40 | x -> [x] 41 | BDLines [l] -> Just l 42 | BDAddBaseY i (BDAnnotationPrior k x) -> 43 | Just $ BDAnnotationPrior k (BDAddBaseY i x) 44 | BDAddBaseY i (BDAnnotationKW k kw x) -> 45 | Just $ BDAnnotationKW k kw (BDAddBaseY i x) 46 | BDAddBaseY i (BDAnnotationRest k x) -> 47 | Just $ BDAnnotationRest k (BDAddBaseY i x) 48 | BDAddBaseY i (BDSeq l) -> 49 | Just $ BDSeq $ List.init l ++ [BDAddBaseY i $ List.last l] 50 | BDAddBaseY i (BDCols sig l) -> 51 | Just $ BDCols sig $ List.init l ++ [BDAddBaseY i $ List.last l] 52 | BDAddBaseY _ lit@BDLit{} -> Just lit 53 | 54 | _ -> Nothing 55 | -------------------------------------------------------------------------------- /source/library/Language/Haskell/Brittany/Internal/Transformations/Par.hs: -------------------------------------------------------------------------------- 1 | {-# LANGUAGE LambdaCase #-} 2 | {-# LANGUAGE NoImplicitPrelude #-} 3 | 4 | module Language.Haskell.Brittany.Internal.Transformations.Par where 5 | 6 | import Language.Haskell.Brittany.Internal.Prelude 7 | import Language.Haskell.Brittany.Internal.Types 8 | import Language.Haskell.Brittany.Internal.Utils 9 | 10 | 11 | 12 | transformSimplifyPar :: BriDoc -> BriDoc 13 | transformSimplifyPar = transformUp $ \case 14 | -- BDPar BrIndentNone line1 line2 -> Just $ BDLines [line1, line2] 15 | -- BDPar line indented -> 16 | -- Just $ BDLines [line, indented] 17 | -- BDPar ind1 (BDPar ind2 line p1) p2 | ind1==ind2 -> 18 | -- Just $ BDPar ind1 line (BDLines [p1, p2]) 19 | x@(BDPar _ (BDPar _ BDPar{} _) _) -> x 20 | BDPar ind1 (BDPar ind2 line p1) (BDLines indenteds) -> 21 | BDPar ind1 line (BDLines (BDEnsureIndent ind2 p1 : indenteds)) 22 | BDPar ind1 (BDPar ind2 line p1) p2 -> 23 | BDPar ind1 line (BDLines [BDEnsureIndent ind2 p1, p2]) 24 | BDLines lines 25 | | any 26 | (\case 27 | BDLines{} -> True 28 | BDEmpty{} -> True 29 | _ -> False 30 | ) 31 | lines 32 | -> case go lines of 33 | [] -> BDEmpty 34 | [x] -> x 35 | xs -> BDLines xs 36 | where 37 | go = (=<<) $ \case 38 | BDLines l -> go l 39 | BDEmpty -> [] 40 | x -> [x] 41 | BDLines [] -> BDEmpty 42 | BDLines [x] -> x 43 | -- BDCols sig cols | BDPar ind line indented <- List.last cols -> 44 | -- Just $ BDPar ind (BDCols sig (List.init cols ++ [line])) indented 45 | -- BDPar BrIndentNone line indented -> 46 | -- Just $ BDLines [line, indented] 47 | BDEnsureIndent BrIndentNone x -> x 48 | x -> x 49 | -------------------------------------------------------------------------------- /source/test-suite/Main.hs: -------------------------------------------------------------------------------- 1 | import qualified Control.Monad as Monad 2 | import qualified Data.List as List 3 | import qualified Language.Haskell.Brittany.Main as Brittany 4 | import qualified System.Directory as Directory 5 | import qualified System.FilePath as FilePath 6 | import qualified Test.Hspec as Hspec 7 | 8 | main :: IO () 9 | main = Hspec.hspec . Hspec.parallel $ do 10 | let directory = "data" 11 | entries <- Hspec.runIO $ Directory.listDirectory directory 12 | Monad.forM_ (List.sort entries) $ \entry -> 13 | case FilePath.stripExtension "hs" entry of 14 | Nothing -> pure () 15 | Just slug -> Hspec.it slug $ do 16 | let input = FilePath.combine directory entry 17 | expected <- readFile input 18 | let output = FilePath.combine "output" entry 19 | Directory.copyFile input output 20 | Brittany.mainWith 21 | "brittany" 22 | [ "--config-file" 23 | , FilePath.combine directory "brittany.yaml" 24 | , "--no-user-config" 25 | , "--write-mode" 26 | , "inplace" 27 | , output 28 | ] 29 | actual <- readFile output 30 | Literal actual `Hspec.shouldBe` Literal expected 31 | 32 | newtype Literal 33 | = Literal String 34 | deriving Eq 35 | 36 | instance Show Literal where 37 | show (Literal x) = x 38 | --------------------------------------------------------------------------------