From 89b7655bac0e0ff8ac9a2f6f23bcff9f77a151af Mon Sep 17 00:00:00 2001
From: Lennart Spitzner <hexagoxel@hexagoxel.de>
Date: Sun, 29 Sep 2019 21:43:47 +0200
Subject: [PATCH] Fix support for ghc-8.8

---
 .travis.yml                                              | 1 -
 ChangeLog.md                                             | 3 +--
 src/Language/Haskell/Brittany/Internal/Layouters/Expr.hs | 5 +++--
 3 files changed, 4 insertions(+), 5 deletions(-)

diff --git a/.travis.yml b/.travis.yml
index 1a26676..4651e64 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -114,7 +114,6 @@ matrix:
   #- env: BUILD=cabal GHCVER=head  CABALVER=head HAPPYVER=1.19.5 ALEXVER=3.1.7
   - env: BUILD=stack ARGS="--resolver nightly"
   - env: BUILD=stack ARGS=""
-  - env: BUILD=canew GHCVER=8.8.1 CABALVER=3.0 HAPPYVER=1.19.5 ALEXVER=3.1.7
 
 before_install:
 # Using compiler above sets CC to an invalid value, so unset it
diff --git a/ChangeLog.md b/ChangeLog.md
index c1328c3..8254a36 100644
--- a/ChangeLog.md
+++ b/ChangeLog.md
@@ -2,12 +2,11 @@
 
 ## 0.12.1.0 -- September 2019
 
+* Support ghc-8.8
 * Support for OverloadedLabels extension
   (thanks to Evan Rutledge Borden @eborden)
 * Support for Implicit Params extension (thanks to pepe iborra @pepeiborra)
 * Add flag `--no-user-config` to enable only using manually passed config
-* Theoretically support ghc-8.8 (brittany itself now compiles with 8.8, but
-  you need certain patched dependencies)
 * Disable the performance test suite by default to prevent spurious failures
   on certain CI setups. The github/travis brittany CI still has all tests
   enabled. See the `brittany-test-perf` flag in the cabal file.
diff --git a/src/Language/Haskell/Brittany/Internal/Layouters/Expr.hs b/src/Language/Haskell/Brittany/Internal/Layouters/Expr.hs
index dac10c9..60be59f 100644
--- a/src/Language/Haskell/Brittany/Internal/Layouters/Expr.hs
+++ b/src/Language/Haskell/Brittany/Internal/Layouters/Expr.hs
@@ -1,4 +1,5 @@
 {-# LANGUAGE DataKinds #-}
+{-# LANGUAGE ViewPatterns #-}
 
 module Language.Haskell.Brittany.Internal.Layouters.Expr
   ( layoutExpr
@@ -112,8 +113,8 @@ layoutExpr lexpr@(L _ expr) = do
           -- by wrapping it in docSeq below. We _could_ add alignments for
           -- stuff like lists-of-lambdas. Nothing terribly important..)
           let shouldPrefixSeparator = case p of
-                (L _ LazyPat{}) -> isFirst
-                (L _ BangPat{}) -> isFirst
+                (ghcDL -> L _ LazyPat{}) -> isFirst
+                (ghcDL -> L _ BangPat{}) -> isFirst
                 _               -> False
           patDocSeq <- layoutPat p
           fixed <- case Seq.viewl patDocSeq of