From a00234388d1b4e14481067d030bf90031258b756 Mon Sep 17 00:00:00 2001 From: Tom Smeding Date: Wed, 26 Mar 2025 15:11:48 +0100 Subject: D2[Array] now has a Maybe instead of zero-size for zero Remaining problem: 'add' in Compile doesn't use the D2 stuff --- src/Interpreter/Rep.hs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'src/Interpreter') diff --git a/src/Interpreter/Rep.hs b/src/Interpreter/Rep.hs index f84f4e7..be2a4cc 100644 --- a/src/Interpreter/Rep.hs +++ b/src/Interpreter/Rep.hs @@ -29,8 +29,7 @@ type family RepAc t where RepAc (TPair a b) = IORef (Maybe (RepAc a, RepAc b)) RepAc (TEither a b) = IORef (Maybe (Either (RepAc a) (RepAc b))) RepAc (TMaybe t) = IORef (Maybe (RepAc t)) - -- TODO: an empty array is invalid for a zero-dimensional array, so zero-dimensional arrays don't actually have an O(1) zero. - RepAc (TArr n t) = IORef (Array n (RepAc t)) -- empty array is zero + RepAc (TArr n t) = IORef (Maybe (Array n (RepAc t))) RepAc (TScal sty) = RepAcScal sty RepAc (TAccum t) = TypeError (Text "RepAcSparse: Nested accumulators") -- cgit v1.2.3-70-g09d2