aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorTom Smeding <tom@tomsmeding.com>2025-10-08 20:51:13 +0200
committerTom Smeding <tom@tomsmeding.com>2025-10-08 20:51:13 +0200
commitfaa1f68aad68f9f7125cb665d44e07d24d590eae (patch)
tree18f0b77acc15d02f21ee589862bdabb34325a94a /src
parentf6b5850f949eb671f0c7038db6dff80ca23ed946 (diff)
Code style
Diffstat (limited to 'src')
-rw-r--r--src/AST/Count.hs12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/AST/Count.hs b/src/AST/Count.hs
index 8cd0192..f055164 100644
--- a/src/AST/Count.hs
+++ b/src/AST/Count.hs
@@ -228,12 +228,6 @@ instance Semigroup a => Semigroup (Some (OccEnv a env)) where
instance Semigroup a => Monoid (Some (OccEnv a env)) where
mempty = Some OccEnd
-onehotOccEnv :: Monoid a => Idx env t -> a -> Substruc t t' -> Some (OccEnv a env)
-onehotOccEnv IZ v s = Some (OccPush OccEnd v s)
-onehotOccEnv (IS i) v s
- | Some env' <- onehotOccEnv i v s
- = Some (OccPush env' mempty SsNone)
-
instance Occurrence a => Occurrence (Some (OccEnv a env)) where
Some OccEnd <||> e = e
e <||> Some OccEnd = e
@@ -242,6 +236,12 @@ instance Occurrence a => Occurrence (Some (OccEnv a env)) where
scaleMany (Some OccEnd) = Some OccEnd
scaleMany (Some (OccPush e o s)) = withSome (scaleMany (Some e)) $ \e2 -> Some (OccPush e2 (scaleMany o) s)
+onehotOccEnv :: Monoid a => Idx env t -> a -> Substruc t t' -> Some (OccEnv a env)
+onehotOccEnv IZ v s = Some (OccPush OccEnd v s)
+onehotOccEnv (IS i) v s
+ | Some env' <- onehotOccEnv i v s
+ = Some (OccPush env' mempty SsNone)
+
occEnvPop :: OccEnv a (t : env) (t' : env') -> (OccEnv a env env', Substruc t t')
occEnvPop (OccPush e _ s) = (e, s)
occEnvPop OccEnd = (OccEnd, SsNone)