diff options
Diffstat (limited to 'users')
6 files changed, 24 insertions, 11 deletions
diff --git a/users/glittershark/xanthous/default.nix b/users/glittershark/xanthous/default.nix index 8dfd0bce4bd0..0b89a50afb9e 100644 --- a/users/glittershark/xanthous/default.nix +++ b/users/glittershark/xanthous/default.nix @@ -2,9 +2,6 @@ , lib ? pkgs.lib , ... }: -(pkgs.haskell.lib.failOnAllWarnings ( +pkgs.haskell.lib.failOnAllWarnings ( pkgs.haskellPackages.callPackage (import ./pkg.nix { inherit pkgs; }) {} -)) // { - # TODO(grfn): Get this passing (see https://buildkite.com/tvl/depot/builds/3055) - meta.ci = false; -} +) diff --git a/users/glittershark/xanthous/package.yaml b/users/glittershark/xanthous/package.yaml index e954374f88d9..e8cda59692a4 100644 --- a/users/glittershark/xanthous/package.yaml +++ b/users/glittershark/xanthous/package.yaml @@ -65,6 +65,7 @@ dependencies: - raw-strings-qq - reflection - Rasterific +- splitmix - streams - stache - semigroupoids diff --git a/users/glittershark/xanthous/src/Xanthous/Game/Arbitrary.hs b/users/glittershark/xanthous/src/Xanthous/Game/Arbitrary.hs index a1eb789a33c9..1b15ad4ffa64 100644 --- a/users/glittershark/xanthous/src/Xanthous/Game/Arbitrary.hs +++ b/users/glittershark/xanthous/src/Xanthous/Game/Arbitrary.hs @@ -16,6 +16,7 @@ import qualified Xanthous.Data.EntityMap as EntityMap import Xanthous.Entities.Entities () import Xanthous.Entities.Character import Xanthous.Game.State +import Xanthous.Orphans () import Xanthous.Util.QuickCheck (GenericArbitrary(..)) -------------------------------------------------------------------------------- diff --git a/users/glittershark/xanthous/src/Xanthous/Messages/Template.hs b/users/glittershark/xanthous/src/Xanthous/Messages/Template.hs index 2998db7f7bf9..5176880355f4 100644 --- a/users/glittershark/xanthous/src/Xanthous/Messages/Template.hs +++ b/users/glittershark/xanthous/src/Xanthous/Messages/Template.hs @@ -28,7 +28,7 @@ module Xanthous.Messages.Template where -------------------------------------------------------------------------------- import Xanthous.Prelude hiding - (many, concat, try, elements, some, parts, Filter) + (many, concat, try, elements, some, parts) -------------------------------------------------------------------------------- import Test.QuickCheck hiding (label) import Test.QuickCheck.Instances.Text () diff --git a/users/glittershark/xanthous/src/Xanthous/Orphans.hs b/users/glittershark/xanthous/src/Xanthous/Orphans.hs index 39821150ef97..1fe9708edbe0 100644 --- a/users/glittershark/xanthous/src/Xanthous/Orphans.hs +++ b/users/glittershark/xanthous/src/Xanthous/Orphans.hs @@ -18,7 +18,8 @@ import Graphics.Vty.Attributes import Brick.Widgets.Edit import Data.Text.Zipper.Generic (GenericTextZipper) import Brick.Widgets.Core (getName) -import System.Random (StdGen) +import System.Random.Internal (StdGen (..)) +import System.Random.SplitMix (SMGen ()) import Test.QuickCheck import "quickcheck-instances" Test.QuickCheck.Instances () import Text.Megaparsec (errorBundlePretty) @@ -304,8 +305,15 @@ instance forall t name. (NFData t, Monoid t, NFData name) => NFData (Editor t name) where rnf ed = getName @_ @name ed `deepseq` getEditContents ed `deepseq` () -deriving via (ReadShowJSON StdGen) instance ToJSON StdGen -deriving via (ReadShowJSON StdGen) instance FromJSON StdGen +deriving via (ReadShowJSON SMGen) instance ToJSON SMGen +deriving via (ReadShowJSON SMGen) instance FromJSON SMGen + +instance ToJSON StdGen where + toJSON = toJSON . unStdGen + toEncoding = toEncoding . unStdGen + +instance FromJSON StdGen where + parseJSON = fmap StdGen . parseJSON -------------------------------------------------------------------------------- @@ -326,6 +334,12 @@ instance forall t n. (CoArbitrary t, CoArbitrary n, Monoid t) instance CoArbitrary StdGen where coarbitrary = coarbitrary . show +instance Function StdGen where + function = functionMap unStdGen StdGen + +instance Function SMGen where + function = functionShow + -------------------------------------------------------------------------------- deriving newtype instance (Arbitrary s, CoArbitrary (m (a, s))) diff --git a/users/glittershark/xanthous/src/Xanthous/Prelude.hs b/users/glittershark/xanthous/src/Xanthous/Prelude.hs index 9bec777de7b1..4d79b026f14a 100644 --- a/users/glittershark/xanthous/src/Xanthous/Prelude.hs +++ b/users/glittershark/xanthous/src/Xanthous/Prelude.hs @@ -7,7 +7,7 @@ module Xanthous.Prelude , module Control.Lens , module Data.Void , module Control.Comonad - , module Data.Witherable + , module Witherable , fail , (&!) @@ -27,7 +27,7 @@ import GHC.TypeLits hiding (Text) import Control.Lens hiding (levels, Level) import Data.Void import Control.Comonad -import Data.Witherable +import Witherable import Control.Monad.Fail (fail) -------------------------------------------------------------------------------- |