Skip to content

Commit 326c558

Browse files
warning cleanup 6
1 parent d22dd37 commit 326c558

File tree

7 files changed

+10
-18
lines changed

7 files changed

+10
-18
lines changed

TODO.txt

+3-3
Original file line numberDiff line numberDiff line change
@@ -270,14 +270,14 @@ DONE-handlers should return preview action
270270

271271

272272
:: RELEASE TODO ::
273-
-warning cleanup
274273
-get it working on breew
275274
-make a video
276275
-update tutorial file?
277276
-should be more intuitive to get a 1 sided line
278-
-opening file with hidden elements does not hide stuff..
277+
279278

280279
::NEWEST TODO::
280+
-opening file with hidden elements does not hide stuff..
281281
-layers improvements
282282
-shift select in layers please ;__;
283283
-selecting multiple items and hitting new folder should put those items in folder maybe
@@ -414,7 +414,7 @@ DONE-handlers should return preview action
414414
-insert vs overwrite option for freeform text
415415
-you need some kind of options object to go along side of _setPotatoDefaultParameters_sBoxType
416416

417-
417+
DONE-warning cleanup
418418
DONE-hide stuff
419419
-moving an element into a hidden folder does not hide it right away (ignore this for release)
420420
-this is becaues it gets added to superowlchanges

src/Potato/Flow/Llama.hs

+2-2
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ doCmdState cmd s = r where
6969
else Left $ ApplyLLamaError_Soft $ "Invalid canvas size operation " <> show x
7070

7171
r = case r' of
72-
Right (newState, changes) -> assert (owlPFState_isValid newState) r'
72+
Right (newState, _) -> assert (owlPFState_isValid newState) r'
7373
Left e -> Left e
7474

7575
undoCmdState :: OwlPFCmd -> OwlPFState -> Either ApplyLlamaError (OwlPFState, SuperOwlChanges)
@@ -90,7 +90,7 @@ undoCmdState cmd s = r where
9090
else Left $ ApplyLLamaError_Soft $ "Invalid canvas size operation " <> show x
9191

9292
r = case r' of
93-
Right (newState, changes) -> assert (owlPFState_isValid newState) r'
93+
Right (newState, _) -> assert (owlPFState_isValid newState) r'
9494
Left e -> Left e
9595

9696

src/Potato/Flow/Methods/LineDrawer.hs

+2-2
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ lineAnchorsForRender_reverse lafr@LineAnchorsForRender {..} = r where
160160
revgo acc ((cd,d,False):[]) = (flipCartDir cd,d,True):acc
161161
revgo _ ((_,_,True):[]) = error "unexpected subsegment starting anchor at end"
162162
revgo acc ((cd,d,False):xs) = revgo ((flipCartDir cd, d, False):acc) xs
163-
revgo _ ((_,_,True):xs) = error "TODO this does not handle midpoint subsegment starting anchors correctly (not that it needs to right now)"
163+
revgo _ ((_,_,True):_) = error "TODO this does not handle midpoint subsegment starting anchors correctly (not that it needs to right now)"
164164
revgostart [] = []
165165
revgostart ((cd,d,True):xs) = revgo [(flipCartDir cd,d,False)] xs
166166
revgostart _ = error "unexpected non-subsegment starting anchor at start"
@@ -674,7 +674,7 @@ internal_getSAutoLineLabelPosition_walk lar targetd = r where
674674
walk (x@(cd,d,_):rest) curbegin traveld = r2 where
675675
nextbegin = curbegin + cartDirWithDistanceToV2 x
676676
r2 = if traveld + d >= targetd
677-
then curbegin + cartDirWithDistanceToV2 (cd, targetd - traveld, undefined)
677+
then curbegin + cartDirWithDistanceToV2 (cd, targetd - traveld, undefined) -- why undefined -__- lol
678678
else walk rest nextbegin (traveld + d)
679679
r = walk (_lineAnchorsForRender_rest lar) (_lineAnchorsForRender_start lar) 0
680680

src/Potato/Flow/Owl.hs

+2-2
Original file line numberDiff line numberDiff line change
@@ -983,13 +983,13 @@ internal_owlTree_recalculateChildrenDepths_recursive ot rid = r_0 where
983983
sowl = owlTree_mustFindSuperOwl ot rid
984984
adjustdepthfn (oem, oitem) = (,oitem) $ oem { _owlItemMeta_depth = _owlItemMeta_depth (_superOwl_meta sowl) + 1 }
985985
r_0 = case _superOwl_elt sowl of
986-
OwlItem oinfo (OwlSubItemFolder kiddos) -> r_1 where
986+
OwlItem _ (OwlSubItemFolder kiddos) -> r_1 where
987987
-- update the depth of all its kiddos
988988
omwithadjusteddepth = foldr (\kid om -> IM.adjust adjustdepthfn kid om) (_owlTree_mapping ot) kiddos
989989
newot_0 = ot {_owlTree_mapping = omwithadjusteddepth}
990990
-- recurse
991991
r_1 = foldl (internal_owlTree_recalculateChildrenDepths_recursive) newot_0 kiddos
992-
x -> ot
992+
_ -> ot
993993

994994
-- parents allowed ONLY if all the children already exist in the tree (as orphans) or it will crash
995995
-- returns the added element for convenience but NOT its children

src/Potato/Flow/OwlState.hs

+1-3
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,6 @@ import qualified Data.IntMap.Strict as IM
1818
import Data.List.Ordered (isSortedBy)
1919
import Data.Maybe
2020
import qualified Data.Text as T
21-
import qualified Data.Sequence as Seq
22-
2321

2422

2523
-- prob not the best place for these...
@@ -115,7 +113,7 @@ owlPFState_fromCanvasCoordinates OwlPFState {..} (V2 x y) = V2 (x+sx) (y+sy) whe
115113
owlPFState_to_SuperOwlParliament :: OwlPFState -> SuperOwlParliament
116114
owlPFState_to_SuperOwlParliament OwlPFState {..} = owlParliament_toSuperOwlParliament _owlPFState_owlTree $ OwlParliament $ _owlTree_topOwls _owlPFState_owlTree
117115

118-
do_newElts :: (HasCallStack) => [(REltId, OwlSpot, OwlItem)] -> OwlPFState -> (OwlPFState, SuperOwlChanges)
116+
do_newElts :: [(REltId, OwlSpot, OwlItem)] -> OwlPFState -> (OwlPFState, SuperOwlChanges)
119117
do_newElts seltls pfs@OwlPFState {..} = r where
120118

121119
-- notably, passing in a list here rather than SuperOwlParialment allows us to add parents with children so long as everything is sorted from left to right (such that the parent/sibling exist when the child gets added)

src/Potato/Flow/OwlWorkspace.hs

-5
Original file line numberDiff line numberDiff line change
@@ -18,18 +18,13 @@ module Potato.Flow.OwlWorkspace (
1818
import Relude
1919

2020
import Potato.Flow.Llama
21-
import Potato.Flow.Math
2221
import Potato.Flow.Owl
23-
import Potato.Flow.OwlItem
2422
import Potato.Flow.OwlState
25-
import Potato.Flow.Serialization.Snake
2623
import Potato.Flow.Types
2724
import Potato.Flow.Preview
2825

2926
import Control.Exception (assert)
3027
import qualified Data.IntMap.Strict as IM
31-
import qualified Data.IntSet as IS
32-
import qualified Data.Sequence as Seq
3328

3429
-- TODO get rid of this, now needed
3530
data OwlPFWorkspace = OwlPFWorkspace {

src/Potato/Flow/RenderCache.hs

-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ import Potato.Flow.Methods.LineTypes
1313

1414

1515
import qualified Data.IntMap as IM
16-
import qualified Data.Text.IO as T
1716
import qualified Data.Vector.Unboxed as V
1817
import Control.Exception (assert)
1918

0 commit comments

Comments
 (0)