You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Ergonomically, I find that I write a lot of boilerplate code that deals with casing between Lists and Tables. For instance, appending items and adding new type instances.
I wonder if it makes sense to have List be a type class of some sort? For instance, often I want constants like [1, 4] to be lists (as with Strings), to do b <> c with two tables (knowing the return is a list), or to have for i. a.i work where a is a list (and potentially the return is a list).
This is all doable currently but many functions have to pack and unpack. My current strategy is to type things as List if they collapse a dimension (since that works for either, and you can cast), but that feels wrong since it restricts the collapsed dimension to be of (Fin ) type.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Ergonomically, I find that I write a lot of boilerplate code that deals with casing between Lists and Tables. For instance, appending items and adding new type instances.
I wonder if it makes sense to have List be a type class of some sort? For instance, often I want constants like [1, 4] to be lists (as with Strings), to do
b <> c
with two tables (knowing the return is a list), or to havefor i. a.i
work wherea
is a list (and potentially the return is a list).This is all doable currently but many functions have to pack and unpack. My current strategy is to type things as
List
if they collapse a dimension (since that works for either, and you can cast), but that feels wrong since it restricts the collapsed dimension to be of (Fin ) type.Beta Was this translation helpful? Give feedback.
All reactions