summaryrefslogtreecommitdiffhomepage
path: root/lib/Language/Haskell/Stylish/Step/UnicodeSyntax.hs
diff options
context:
space:
mode:
authorSean Whitton <spwhitton@spwhitton.name>2020-07-26 18:40:11 -0700
committerSean Whitton <spwhitton@spwhitton.name>2020-07-26 18:40:11 -0700
commite64f6fa52d69631d90ea32cdd42d23037057d5c7 (patch)
tree27adb9aad9d09e6b2f4351d6f5b6cab774913282 /lib/Language/Haskell/Stylish/Step/UnicodeSyntax.hs
parent294cf1927fc105485bcf7043f1ae87819cb62441 (diff)
parent3621bf3aa5312fef61220e1760d9988307209c6a (diff)
downloadstylish-haskell-e64f6fa52d69631d90ea32cdd42d23037057d5c7.tar.gz
Merge tag 'v0.11.0.0'
v0.11.0.0 - 0.11.0.0 (2020-02-24) * Disable record formatting by default * Allow more customization for record formatting (by Maxim Koltsov) * Disable formatting of data types without records (by Maxim Koltsov) * Add `-r` flag to recursively find Haskell files (by Akos Marton)
Diffstat (limited to 'lib/Language/Haskell/Stylish/Step/UnicodeSyntax.hs')
-rw-r--r--lib/Language/Haskell/Stylish/Step/UnicodeSyntax.hs14
1 files changed, 7 insertions, 7 deletions
diff --git a/lib/Language/Haskell/Stylish/Step/UnicodeSyntax.hs b/lib/Language/Haskell/Stylish/Step/UnicodeSyntax.hs
index 01e29e8..266e8e5 100644
--- a/lib/Language/Haskell/Stylish/Step/UnicodeSyntax.hs
+++ b/lib/Language/Haskell/Stylish/Step/UnicodeSyntax.hs
@@ -39,12 +39,12 @@ replaceAll :: [(Int, [(Int, String)])] -> [Change String]
replaceAll = map changeLine'
where
changeLine' (r, ns) = changeLine r $ \str -> return $
- flip applyChanges str
+ applyChanges
[ change (Block c ec) (const repl)
| (c, needle) <- sort ns
, let ec = c + length needle - 1
, repl <- maybeToList $ M.lookup needle unicodeReplacements
- ]
+ ] str
--------------------------------------------------------------------------------
@@ -104,15 +104,15 @@ between (startRow, startCol) (endRow, endCol) needle =
--------------------------------------------------------------------------------
-step :: Bool -> Step
-step = makeStep "UnicodeSyntax" . step'
+step :: Bool -> String -> Step
+step = (makeStep "UnicodeSyntax" .) . step'
--------------------------------------------------------------------------------
-step' :: Bool -> Lines -> Module -> Lines
-step' alp ls (module', _) = applyChanges changes ls
+step' :: Bool -> String -> Lines -> Module -> Lines
+step' alp lg ls (module', _) = applyChanges changes ls
where
- changes = (if alp then addLanguagePragma "UnicodeSyntax" module' else []) ++
+ changes = (if alp then addLanguagePragma lg "UnicodeSyntax" module' else []) ++
replaceAll perLine
perLine = sort $ groupPerLine $
typeSigs module' ls ++