Hi!
I've noticed that sometimes, the function concatArray in Semigroup.py receives a list and a tuple to concat, which results in the following error:
TypeError: can only concatenate tuple (not "list") to tuple
In my local copy of the library, I've changed it to this just to get things working:
def concatArray(xs):
def _1(ys):
foo = tuple(xs)
bar = tuple(ys)
return bar if not foo else foo if not bar else foo + bar
return _1
But that feels a bit off.
Is there a general policy for tuples vs lists in python-land? For example, in Data.Functor in the prelude, I see that tuple is used, but in Data.Array I see that list is used.
If tuples and lists can be used interchangeably, then I'd make sure that the concat operator is changed to something like the code above.
Hi!
I've noticed that sometimes, the function
concatArrayinSemigroup.pyreceives alistand atupleto concat, which results in the following error:In my local copy of the library, I've changed it to this just to get things working:
But that feels a bit off.
Is there a general policy for tuples vs lists in python-land? For example, in
Data.Functorin the prelude, I see that tuple is used, but inData.ArrayI see thatlistis used.If tuples and lists can be used interchangeably, then I'd make sure that the concat operator is changed to something like the code above.