Skip to content

Commit

Permalink
project: compile and test with lts-23
Browse files Browse the repository at this point in the history
  • Loading branch information
etorreborre committed Dec 19, 2024
1 parent 89a69d7 commit b63cd4e
Show file tree
Hide file tree
Showing 7 changed files with 26 additions and 20 deletions.
6 changes: 3 additions & 3 deletions package.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: registry
version: 0.6.2.0
version: 0.6.3.0
synopsis: data structure for assembling components

description: This library provides a "Registry" which is a data structure containing
Expand Down Expand Up @@ -75,7 +75,7 @@ tests:
dependencies:
- registry
- async < 2.3
- bytestring < 0.12
- bytestring < 0.13
- directory < 1.4
- hedgehog >= 1.0 && < 3.0
- generic-lens >= 1.0 && < 3.0
Expand All @@ -84,7 +84,7 @@ tests:
- multimap < 2
- semigroups < 0.30
- random < 2.0
- tasty < 1.5
- tasty < 1.6
- tasty-discover < 6
- tasty-hedgehog >= 1.2 && < 2.0
- tasty-th < 0.2
Expand Down
10 changes: 4 additions & 6 deletions registry.cabal
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
cabal-version: 1.12

-- This file has been generated from package.yaml by hpack version 0.36.0.
-- This file has been generated from package.yaml by hpack version 0.35.2.
--
-- see: https://github.com/sol/hpack
--
-- hash: 2a0efc6bb21e7c5e914a1968aadce02745a9842fc47f9146b2be506788fec102

name: registry
version: 0.6.1.0
version: 0.6.3.0
synopsis: data structure for assembling components
description: This library provides a "Registry" which is a data structure containing a list of functions and values representing dependencies in a directed acyclic graph. A `make` function can then be used to create a value of a specific type out of the registry.
You can start with the [README](https://github.com/etorreborre/registry/blob/master/README.md) for a full description of the library.
Expand Down Expand Up @@ -134,7 +132,7 @@ test-suite spec
MonadRandom <1
, async <2.3
, base >=4.14 && <5
, bytestring <0.12
, bytestring <0.13
, containers >=0.5 && <0.7
, directory <1.4
, exceptions >=0.8 && <0.11
Expand All @@ -151,7 +149,7 @@ test-suite spec
, resourcet >=1.1 && <2
, semigroupoids >=5.0 && <7
, semigroups <0.30
, tasty <1.5
, tasty <1.6
, tasty-discover <6
, tasty-hedgehog >=1.2 && <2.0
, tasty-th <0.2
Expand Down
1 change: 1 addition & 0 deletions src/Data/Registry/Registry.hs
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ import Data.Registry.Internal.Types
import Data.Registry.Lift
import Data.Registry.Solver
import Data.Semigroup ((<>))
import Data.Type.Equality
import Protolude as P hiding ((<>))
import Type.Reflection
import qualified Prelude (show)
Expand Down
1 change: 1 addition & 0 deletions src/Data/Registry/Solver.hs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
module Data.Registry.Solver where

import Data.Kind
import Data.Type.Equality
import GHC.TypeLits

-- | Compute the list of input types for a function
Expand Down
10 changes: 8 additions & 2 deletions src/Data/Registry/TH.hs
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,9 @@ makeTypeclassWith (TypeclassOptions typeclassNameMaker functionNameMaker) compon
qReport True ("can only generate a typeclass for a record of functions, got: " <> show other)
pure []

#if MIN_VERSION_GLASGOW_HASKELL(9,0,0,0)
#if MIN_VERSION_GLASGOW_HASKELL(9,8,0,0)
createTypeclass :: (Text -> Text) -> (Text -> Text) -> Name -> [TyVarBndr BndrVis] -> [VarBangType] -> [Dec]
#elif MIN_VERSION_GLASGOW_HASKELL(9,0,0,0)
createTypeclass :: (Text -> Text) -> (Text -> Text) -> Name -> [TyVarBndr ()] -> [VarBangType] -> [Dec]
#else
createTypeclass :: (Text -> Text) -> (Text -> Text) -> Name -> [TyVarBndr] -> [VarBangType] -> [Dec]
Expand All @@ -73,7 +75,11 @@ createTypeclass typeclassNameMaker functionNameMaker name typeVars types =

-- | Create an instance definition using a ReaderT instance
-- instance WithLogger (ReaderT (Logger m) m) where ...
#if MIN_VERSION_GLASGOW_HASKELL(9,0,0,0)
#if MIN_VERSION_GLASGOW_HASKELL(9,8,0,0)
createReadertInstance :: (Text -> Text) -> (Text -> Text) -> Name -> [TyVarBndr BndrVis] -> [VarBangType] -> DecsQ
createReadertInstance typeclassNameMaker functionNameMaker name [tvar] types =
let tvarName = case tvar of PlainTV v _ -> v; KindedTV v _ _ -> v
#elif MIN_VERSION_GLASGOW_HASKELL(9,0,0,0)
createReadertInstance :: (Text -> Text) -> (Text -> Text) -> Name -> [TyVarBndr ()] -> [VarBangType] -> DecsQ
createReadertInstance typeclassNameMaker functionNameMaker name [tvar] types =
let tvarName = case tvar of PlainTV v _ -> v; KindedTV v _ _ -> v
Expand Down
4 changes: 2 additions & 2 deletions test/Test/Data/Registry/Internal/Gens.hs
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ import Test.Data.Registry.Internal.GensRegistry
-- Hedgehog generators for the internal types
registry = normalize gensRegistry

forall :: forall a. _ => PropertyT IO a
forall = forAll $ gen @a
for_all :: forall a. _ => PropertyT IO a
for_all = forAll $ gen @a

gen :: forall a. _ => Gen a
gen = make registry
14 changes: 7 additions & 7 deletions test/Test/Data/Registry/Internal/MakeSpec.hs
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@ import Test.Tasty.Extensions
import Type.Reflection

test_make_inputs_with_cycle = prop "making inputs when there's a cycle must be detected" $ do
function <- forall @Function
target <- forall @SomeTypeRep
context' <- forall @Context
functions <- forall @Entries
specializations <- forall @Specializations
modifiers <- forall @Modifiers
values <- forall @Values
function <- for_all @Function
target <- for_all @SomeTypeRep
context' <- for_all @Context
functions <- for_all @Entries
specializations <- for_all @Specializations
modifiers <- for_all @Modifiers
values <- for_all @Values

-- put one of the input types to build already in the list of
-- types being built
Expand Down

0 comments on commit b63cd4e

Please sign in to comment.