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

@ -28,7 +28,7 @@ module Xanthous.Messages.Template
where
--------------------------------------------------------------------------------
import Xanthous.Prelude hiding
(many, concat, try, elements, some, parts)
(many, concat, try, elements, some, parts, Filter)
--------------------------------------------------------------------------------
import Test.QuickCheck hiding (label)
import Test.QuickCheck.Instances.Text ()
@ -113,7 +113,7 @@ instance Eq Template where
instance Arbitrary Template where
arbitrary = sized . fix $ \gen n ->
let leaves = [ Literal . filter (`notElem` ['\\', '{']) <$> arbitrary
let leaves = [ Literal . pack . filter (`notElem` ['\\', '{']) <$> arbitrary
, Subst <$> arbitrary
]
subtree = gen $ n `div` 2