First commit on new machine, some hlinting
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
{-# LANGUAGE LambdaCase #-}
|
||||
{-# LANGUAGE TupleSections #-}
|
||||
|
||||
module Dodge.Item.AmmoSlots (
|
||||
itemAmmoSlots,
|
||||
@@ -29,14 +30,15 @@ heldItemAmmoSlots = \case
|
||||
RIFLE -> singleAmmo BulletAmmo
|
||||
AUTORIFLE -> singleAmmo BulletAmmo
|
||||
BURSTRIFLE -> singleAmmo BulletAmmo
|
||||
ALTERIFLE -> IM.fromList (zip [0..1] $ repeat BulletAmmo)
|
||||
--ALTERIFLE -> IM.fromList (zip [0..1] $ repeat BulletAmmo)
|
||||
ALTERIFLE -> IM.fromList $ [0..1] <&> (,BulletAmmo)
|
||||
BANGROD -> singleAmmo BulletAmmo
|
||||
ELEPHANTGUN -> singleAmmo BulletAmmo
|
||||
AMR -> singleAmmo BulletAmmo
|
||||
AUTOAMR -> singleAmmo BulletAmmo
|
||||
SNIPERRIFLE -> singleAmmo BulletAmmo
|
||||
MINIGUNX _ -> singleAmmo BeltBulletAmmo
|
||||
VOLLEYGUN i -> IM.fromList (zip [0..i-1] $ repeat BulletAmmo)
|
||||
VOLLEYGUN i -> IM.fromList $ [0..i-1] <&> (,BulletAmmo)
|
||||
POISONSPRAYER -> singleAmmo GasAmmo
|
||||
FLAMETHROWER -> singleAmmo GasAmmo
|
||||
FLAMETORRENT -> singleAmmo GasAmmo
|
||||
|
||||
@@ -197,11 +197,12 @@ rightChildList t = foldl' f l (reverse $ t ^.. dtRight . each . dtValue . _2)
|
||||
leftRightCombine :: DTComb a -> DTComb a -> DTree a -> DTree a -> Maybe (DTree a)
|
||||
leftRightCombine f f' t1 t2 = f t1 t2 <|> checkdepth t1 t2
|
||||
where
|
||||
checkdepth t t'@(DT x ls rs) = fromMaybe (checktop t t') $ do
|
||||
--checkdepth t t'@(DT x ls rs) = fromMaybe (checktop t t') $ do
|
||||
checkdepth t t'@(DT x ls rs) = fromMaybe (f' t t') $ do
|
||||
t'' <- safeHead ls
|
||||
tx <- checkdepth t t''
|
||||
return $ Just $ DT x (tx : tail ls) rs
|
||||
checktop t t' = f' t t'
|
||||
--checktop t t' = f' t t'
|
||||
|
||||
joinItemsInList :: (a -> a -> Maybe a) -> [a] -> [a]
|
||||
joinItemsInList f = fst . h . ([],)
|
||||
|
||||
Reference in New Issue
Block a user