on master help sign in
PictureToSpans: replace specialized lens operators with more fundamental ones

This change removes -~ and +~ definitions that can conflict with those provided by Microlens, and which were just copies of what Microlens now provides. Instead of using those, this change just inlines their functionality in the right spots so that we don't have to conditionally define or import those operators depending on the version of Microlens, which just recently started to provide these. This change also goes ahead and introduces an upper bound on Microlens to avoid future issues like this.

commit8f32f8ea4c4b70b31b15cbe21ab9890108cd4765 authorJonathan Daugherty <cygnus@foobox.com> dateSun 4 Nov 2018, 07:35 (8 years ago) parent74a72ff
2 files changed+5−11
src/Graphics/Vty/PictureToSpans.hs+4−10 vty.cabal+1−1
src/Graphics/Vty/PictureToSpans.hs+4−10
@@ -298,11 +298,11 @@ addMaybeClippedJoin name skip remaining offset i0Dim i0 i1 size = do
298298 state <- get
299299 when (state^.remaining <= 0) $ fail $ name ++ " with remaining <= 0"
300300 case state^.skip of
301− s | s > size -> put $ state & skip -~ size
301+ s | s > size -> put $ state & skip %~ subtract size
302302 | s == 0 -> if state^.remaining > i0Dim
303303 then do
304304 addMaybeClipped i0
305− put $ state & offset +~ i0Dim & remaining -~ i0Dim
305+ put $ state & offset %~ (+ i0Dim) & remaining %~ subtract i0Dim
306306 addMaybeClipped i1
307307 else addMaybeClipped i0
308308 | s < i0Dim ->
@@ -311,10 +311,10 @@ addMaybeClippedJoin name skip remaining offset i0Dim i0 i1 size = do
311311 then addMaybeClipped i0
312312 else do
313313 addMaybeClipped i0
314− put $ state & offset +~ i0Dim' & remaining -~ i0Dim' & skip .~ 0
314+ put $ state & offset %~ (+ i0Dim') & remaining %~ subtract i0Dim' & skip .~ 0
315315 addMaybeClipped i1
316316 | s >= i0Dim -> do
317− put $ state & skip -~ i0Dim
317+ put $ state & skip %~ subtract i0Dim
318318 addMaybeClipped i1
319319 _ -> fail $ name ++ " has unhandled skip class"
320320
@@ -346,9 +346,3 @@ snocOp !op !row = do
346346 when (spanOpsEffectedColumns ops' > regionWidth theRegion)
347347 $ fail $ "row " ++ show row ++ " now exceeds region width"
348348 MVector.write theMrowOps row ops'
349−
350−(-~) :: Num a => ASetter s t a a -> a -> s -> t
351−l -~ n = over l (subtract n)
352−
353−(+~) :: Num a => ASetter s t a a -> a -> s -> t
354−l +~ n = over l (n +)
vty.cabal+1−1
@@ -45,7 +45,7 @@ library
4545 deepseq >= 1.1 && < 1.5,
4646 directory,
4747 filepath >= 1.0 && < 2.0,
48− microlens,
48+ microlens < 0.4.11,
4949 microlens-mtl,
5050 microlens-th,
5151 -- required for nice installation with yi