@@ -50,7 +50,7 @@ import Data.Typeable hiding (typeOf)
50
50
import Data.Void
51
51
import Language.CQL.Collage (Collage (.. ), assembleGens , attsFrom , fksFrom , typeOf )
52
52
import Language.CQL.Common (elem' , fromListAccum , section , toMapSafely , Deps (.. ), Err , Kind (INSTANCE ), MultiTyMap , TyMap , type (+ ))
53
- import Language.CQL.Instance.Algebra (Algebra (.. ), aAtt , down1 , evalSchTerm , evalSchTerm' , nf , nf'' , repr'' )
53
+ import Language.CQL.Instance.Algebra (Algebra (.. ), aAtt , Carrier , down1 , evalSchTerm , evalSchTerm' , nf , nf'' , repr'' , TalgGen ( .. ) )
54
54
import qualified Language.CQL.Instance.Algebra as A (simplify )
55
55
import Language.CQL.Instance.Presentation (Presentation (.. ))
56
56
import qualified Language.CQL.Instance.Presentation as IP (toCollage , typecheck , Presentation (eqs ))
@@ -198,13 +198,6 @@ saturatedInstance sch (Presentation gens sks eqs) = do
198
198
---------------------------------------------------------------------------------------------------------------
199
199
-- Initial algebras
200
200
201
- -- | The carrier for the initial algebra of an instance; they are just terms.
202
- -- Made into a separate type so this could be changed; cql-java for example just uses natural numbers as the carrier.
203
- type Carrier en fk gen = Term Void Void Void en fk Void gen Void
204
-
205
- -- | The generating labelled nulls for the type algebra of the associated instance.
206
- newtype TalgGen en fk att gen sk = MkTalgGen (Either sk (Carrier en fk gen , att ))
207
-
208
201
-- | Computes an initial instance (minimal model of a presentation).
209
202
-- Actually, computes the cannonical term model, where the underlying elements
210
203
-- of the carriers are equivalence class of terms modulo provable equality
@@ -264,17 +257,6 @@ assembleSks col ens' = unionWith Set.union sks' $ fromListAccum gens'
264
257
instance NFData InstanceEx where
265
258
rnf (InstanceEx x) = rnf x
266
259
267
- instance TyMap NFData '[en , fk , att , gen , sk ] => NFData (TalgGen en fk att gen sk ) where
268
- rnf (MkTalgGen x) = rnf x
269
-
270
- instance TyMap Show '[en , fk , att , gen , sk ] => Show (TalgGen en fk att gen sk ) where
271
- show (MkTalgGen (Left x)) = show x
272
- show (MkTalgGen (Right x)) = show x
273
-
274
- deriving instance TyMap Ord '[en , fk , att , gen , sk ] => Ord (TalgGen en fk att gen sk )
275
-
276
- deriving instance TyMap Eq '[fk , att , gen , sk ] => Eq (TalgGen en fk att gen sk )
277
-
278
260
-- TODO move to Collage? Algebra?
279
261
-- TODO move to Collage? Algebra?
280
262
-- TODO move to Collage? Algebra?
0 commit comments