Partial refactor of bullet weapon effect chain

This commit is contained in:
2024-09-16 13:05:59 +01:00
parent 6f372109d9
commit abc0dd1106
23 changed files with 655 additions and 510 deletions
+5
View File
@@ -20,6 +20,8 @@ module ListHelp
, foldrWhileArb
, wordsBy
, findWithIx
) where
import Data.List
import Data.Ord
@@ -117,3 +119,6 @@ wordsBy x xs = case dropWhile (==x) xs of
xs' -> w : wordsBy x xs''
where
(w,xs'') = break (==x) xs'
findWithIx :: (a -> Bool) -> [a] -> Maybe (Int,a)
findWithIx t = find (t . snd) . zip [0..]