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:
Griffin Smith 2020-06-28 16:43:20 -04:00 committed by glittershark
parent 20bc4aa10d
commit 6c7e14d2dc
7 changed files with 30 additions and 6 deletions

View file

@ -7,7 +7,9 @@ module Xanthous.Prelude
, module Control.Lens
, module Data.Void
, module Control.Comonad
, module Data.Witherable
, (&!)
-- * Classy-Prelude addons
, ninsertSet
@ -16,12 +18,15 @@ module Xanthous.Prelude
) where
--------------------------------------------------------------------------------
import ClassyPrelude hiding
(return, (<|), unsnoc, uncons, cons, snoc, index, (<.>), Index, say)
( return, (<|), unsnoc, uncons, cons, snoc, index, (<.>), Index, say
, catMaybes, filter, mapMaybe, hashNub, ordNub
)
import Data.Kind
import GHC.TypeLits hiding (Text)
import Control.Lens hiding (levels, Level)
import Data.Void
import Control.Comonad
import Data.Witherable
--------------------------------------------------------------------------------
ninsertSet
@ -34,3 +39,7 @@ ndeleteSet x = deleteSet x . toNullable
toVector :: (MonoFoldable (f a), Element (f a) ~ a) => f a -> Vector a
toVector = fromList . toList
infixl 1 &!
(&!) :: a -> (a -> b) -> b
(&!) = flip ($!)