Partial refactor of bullet weapon effect chain
This commit is contained in:
@@ -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..]
|
||||
|
||||
Reference in New Issue
Block a user