From 20f7d7be13cd7869b338f98d1ab3fd33e8bbfb3e Mon Sep 17 00:00:00 2001 From: Tom Smeding Date: Thu, 27 Nov 2025 21:30:17 +0100 Subject: WIP user-specified custom types The big roadblock encountered is that accumulation wants addition of monoids to be elementwise float addition; this fundamentally clashes with the concept of a user type with a custom zero and plus. --- src/CHAD/AST/Count.hs | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src/CHAD/AST/Count.hs') diff --git a/src/CHAD/AST/Count.hs b/src/CHAD/AST/Count.hs index 46173d2..8923e13 100644 --- a/src/CHAD/AST/Count.hs +++ b/src/CHAD/AST/Count.hs @@ -880,6 +880,16 @@ occCountX initialS topexpr k = case topexpr of EError _ t msg -> k OccEnd $ \_ -> EError ext (applySubstruc s t) msg + + EUser _ t e -> + occCountX SsFull e $ \env1 mke -> + k env1 $ \env' -> + projectSmallerSubstruc SsFull s $ EUser ext t (mke env') + + EUnUser _ e -> + occCountX SsFull e $ \env1 mke -> + k env1 $ \env' -> + projectSmallerSubstruc SsFull s $ EUnUser ext (mke env') where s = simplifySubstruc (typeOf topexpr) initialS -- cgit v1.2.3-70-g09d2