feat(xan): Use Witherable in the prelude
Install the witherable library, expose it in the prelude, and update all call sites that are broken by that change. This is a really nice library, and basically the ideal abstraction layer for what it does. Change-Id: I640e099318c1ecce0ad483bc336c379698bdab88 Reviewed-on: https://cl.tvl.fyi/c/depot/+/725 Reviewed-by: glittershark <grfn@gws.fyi>
This commit is contained in:
parent
20bc4aa10d
commit
6c7e14d2dc
7 changed files with 30 additions and 6 deletions
|
|
@ -35,6 +35,7 @@ newtype VectorBag a = VectorBag (Vector a)
|
|||
, Semigroup
|
||||
, Arbitrary
|
||||
, CoArbitrary
|
||||
, Filterable
|
||||
)
|
||||
makeWrapped ''VectorBag
|
||||
|
||||
|
|
@ -59,6 +60,11 @@ instance AsEmpty (VectorBag a) where
|
|||
(VectorBag Empty) -> Just ()
|
||||
_ -> Nothing
|
||||
|
||||
instance Witherable VectorBag where
|
||||
wither f (VectorBag v) = VectorBag <$> wither f v
|
||||
witherM f (VectorBag v) = VectorBag <$> witherM f v
|
||||
filterA p (VectorBag v) = VectorBag <$> filterA p v
|
||||
|
||||
{-
|
||||
TODO:
|
||||
, Ixed
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue