 --Use the item i on the target t use :: Item -> TargetableUnit -> TargetableUnit use i t = case (itemEffect i) of (Restore hp' mp') -> t {hp = hp t + hp', mp = mp t + mp'} (Cure rList) -> let newStatus = filter (\s -> s `notElem` rList) <$> (status t) in case newStatus of (Just []) -> t {status = Nothing} _ -> t {status = newStatus} 