Commit Graph

98 Commits

Author SHA1 Message Date
cdcc1fbbdd types: list: remove unused imports 2022-07-22 00:08:53 -07:00
72a66dbff4 types: enum: buff up tests 2022-07-21 23:50:57 -07:00
27c1523b0c types: Enum: make the DiscriminantCodable type a bit more usable
previously we couldn't *create* a discriminant, only edit it.
doing things this way is useful for the material code.
2022-07-21 23:02:33 -07:00
491f863aea types: enumerated: fix compile errors 2022-07-21 22:51:26 -07:00
fcc735765c types: Enum: simplify the internally_discriminanted constructor
we don't actually need to enforce the discriminant codability in the
constructor.
if the conditions aren't met, the user just won't be able to operate on
the enum.
2022-07-21 22:21:35 -07:00
55e58f630c coremem_types: Enum: fix a typo in the DiscriminantCodable docs 2022-07-21 22:15:52 -07:00
f2bb16eb5b coremem_types: Enum: add constructors 2022-07-21 22:11:48 -07:00
19b1df4919 coremem_types: Enum: add tests for the internal discriminant case 2022-07-21 21:58:41 -07:00
72b18d378f coremem_types: Enum: add a method to set the enum to a specific variant 2022-07-21 21:46:33 -07:00
65f90d0654 coremem_types: Enum: implement mutable dispatch 2022-07-21 21:35:15 -07:00
e96f0db11a coremem_types: enum: verify that setting the discriminant works as expected 2022-07-21 21:16:43 -07:00
c889ec6d09 coremem_types: enum: simplify the discriminant trait impls 2022-07-21 21:08:41 -07:00
3541ab14c1 coremem_types: Enum: add a basic test 2022-07-21 20:35:30 -07:00
b8a36c87a6 coremem_types: enum: add helpers to encode a new discriminant
not used yet: i'll have to add a mutator-based dispatcher in order
to set the new variant's value when the discriminant is updated.
2022-07-21 18:40:09 -07:00
fba85c5ae3 coremem_types: list: add a set method 2022-07-21 18:36:11 -07:00
960804598a coremem_types: enums don't require their variant to be Copy
this is safe because the variant is necessarily not ZST.
if it was ZST it could just be stored explicitly instead of folding it
into the first element, and that case should still be OK.
2022-07-21 18:31:31 -07:00
9153dfbb7a coremem_types: enumerated: allow folding the enum into the first element 2022-07-21 18:28:20 -07:00
b15bad434e coremem_types: remove unused ElementAt type alias from list 2022-07-21 17:05:20 -07:00
f448f9200e implement an Enum type
right now the user has to define the method to extract the discriminant
from the enum.
i'll work to integrate the discriminant into the enum itself in future
patches.
2022-07-21 17:02:57 -07:00
d6ebf968b2 coremem_types: list: simplify the IntoList trait 2022-07-21 14:11:42 -07:00
90127e3f02 coremem_types: list: rename tuple_direct -> flat 2022-07-21 14:05:55 -07:00
8ce64ecc73 coremem_types: implement a List type which uses direct indexing, without consuming the whole list in the process
it's ugly, but it works and avoids spirv's ZST bugs.
i can clean it up a bit later (and rename it, since it's not actually
using tuples, directly).
2022-07-21 02:32:21 -07:00
86fb7f018d coremem_types: implement a linked-list based List type
it doesn't quite get us where we want to be, as it requires padding to
handle ZSTs in spirv. i think we HAVE to use a flat list (combined with
a copy method, instead of reference-based) to handle ZSTs without
forced padding.
2022-07-21 02:32:08 -07:00
2e3021b875 coremem_types: move list into a submodule so i can toy with alternate implementations 2022-07-20 23:51:58 -07:00
b555ee93f0 coremem_types: DiscrMat2: implement in terms of compound::list::List
i'm not happy AT ALL with this implementation,
but it's the first way i've found which works around ZST limitations.
2022-07-20 16:20:09 -07:00
d034453970 coremem_types: list: implement core::ops::Index 2022-07-20 14:48:52 -07:00
5b5085829d coremem_types: list: remove the dynamic indexing ops
trying to restructure this stuff specifically to aid the material needs.
2022-07-20 14:39:33 -07:00
7dd4b09faf coremem_types: list: remove unused test helpers 2022-07-20 14:37:54 -07:00
24b0b3d680 coremem_types: list: minor test refactoring 2022-07-20 14:37:08 -07:00
d0ae25e28b coremem_types: list: switch to parameter-based indexing; add apply method 2022-07-20 14:31:20 -07:00
e029c8b3d9 coremem_types: list: make the types public
in the future we can hopefully expose only a subset of the types.
2022-07-20 14:30:43 -07:00
5ddd6fef74 coremem_types: list: rename LLNode -> Node 2022-07-20 13:47:43 -07:00
0ce862b614 coremem_types: list: implement List building via a Chomp trait
it's simpler, and lets the user always do `(args...).into_list()`
on ANY `List<(Args...)>` alias type.
2022-07-20 13:46:17 -07:00
415ffb9c4d coremem_types: list: switch to 'head'/'tail' terminology 2022-07-20 13:10:14 -07:00
dfe27c9b56 coremem_types: list: add a way to construct the full list in one-go 2022-07-20 12:47:20 -07:00
00ae71a6eb coremem_types: add List::set, List::get_mut methods 2022-07-20 12:15:09 -07:00
3a235fe47e coremem_types: list: allow Peano-based index operation 2022-07-20 03:49:39 -07:00
159fa1b9a1 coremem_types: list: rename apply -> apply_all 2022-07-20 02:50:27 -07:00
8be90cca01 coremem_types: add Next type to Peano numbers 2022-07-20 02:48:59 -07:00
5ad6af8f8b coremem_types: add Peano numbers
not used yet, but will be by list/enum operations
2022-07-20 02:47:15 -07:00
2afb3f63d4 coremem_types: move compound to its own subdirectory
i'm going to start adding enums and such, in a separate file.
2022-07-20 02:38:08 -07:00
04def2149d coremem_types: compound: extend List constructor to 8 elements 2022-07-20 02:35:33 -07:00
79ac2c0a0d coremem: compound: add a List helper constructor 2022-07-20 02:32:40 -07:00
e14674f5b6 coremem_types: compound: allow LLNode::apply_at to return a value 2022-07-20 02:10:39 -07:00
a56cdabf5e coremem_types: List: add an apply_at method 2022-07-20 01:57:19 -07:00
f8930fd6ea coremem_types: compound: better docs 2022-07-20 01:46:24 -07:00
225d1d7f3a coremem_types: implement a list type wherein we can hope to implement enum-like types on gpu 2022-07-20 01:37:33 -07:00
7954d341fc rename 'Discriminable' => 'DisciminantCodable' 2022-07-19 14:14:54 -07:00
f8fccd957a coremem_types: IsomorphicConductor, AnisomorphicConductor are now used by both spirv and cpu impls 2022-07-19 02:08:22 -07:00
78f7e2be45 coremem_types: Conductor: make inner member private
this must mean the type's not being used, as it's now unconstructable.
2022-07-18 18:25:07 -07:00