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/APIv1.hs | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/CHAD/APIv1.hs') diff --git a/src/CHAD/APIv1.hs b/src/CHAD/APIv1.hs index 73d1580..ef9b685 100644 --- a/src/CHAD/APIv1.hs +++ b/src/CHAD/APIv1.hs @@ -117,6 +117,7 @@ jvp term STI64 -> EVar ext (STScal STI64) (IS IZ) STBool -> EVar ext (STScal STBool) (IS IZ) ezipDN STAccum{} = error "jvp: Accumulators not supported in source program" + ezipDN STUser{} = error "User types not yet supported in forward AD" eunzipDN :: forall env t'. STy t' -> Ex (DN t' : env) (TPair t' (Tan t')) eunzipDN STNil = EPair ext (ENil ext) (ENil ext) @@ -153,6 +154,7 @@ jvp term STI64 -> EPair ext (EVar ext (STScal STI64) IZ) (ENil ext) STBool -> EPair ext (EVar ext (STScal STBool) IZ) (ENil ext) eunzipDN STAccum{} = error "jvp: Accumulators not supported in source program" + eunzipDN STUser{} = error "User types not yet supported in forward AD" -- | Interpret an expression in a given environment. interpret :: KnownEnv env => SList Value env -> Ex env t -> Rep t -- cgit v1.2.3-70-g09d2