diff options
author | Tom Smeding <tom@tomsmeding.com> | 2024-09-26 22:51:51 +0200 |
---|---|---|
committer | Tom Smeding <tom@tomsmeding.com> | 2024-09-26 22:51:51 +0200 |
commit | a87b1a8eb1f659fc15060b6215eb9a6706dfdccd (patch) | |
tree | 78cceaeda64df285b0a680bc82465833c3aec4e2 /src/Array.hs | |
parent | dd16337adb2cd93b808a41e95ae0d0946ac91395 (diff) |
The size of the empty shape is 1, not 0
Diffstat (limited to 'src/Array.hs')
-rw-r--r-- | src/Array.hs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/Array.hs b/src/Array.hs index c48e442..c939419 100644 --- a/src/Array.hs +++ b/src/Array.hs @@ -27,7 +27,7 @@ deriving instance Show (Index n) deriving instance Eq (Index n) shapeSize :: Shape n -> Int -shapeSize ShNil = 0 +shapeSize ShNil = 1 shapeSize (ShCons sh n) = shapeSize sh * n fromLinearIndex :: Shape n -> Int -> Index n |