Bill Allombert on Tue, 08 Jul 2014 14:14:54 +0200

[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

Re: concat([])

On Mon, Jul 07, 2014 at 08:14:47PM -0400, Max Alekseyev wrote:
> Hi Jack,
> I believe the general purpose of concat() is to concatenate vectors,
> while strings are viewed as a special type of vectors (of characters).
> >From this perspective, the default type of concat result is 'vector',
> unless it is specifically asked to concatenate strings (in which case
> result type is 'string').
> That's why I think concat([]) should not be much different from
> ? concat([[]])
> %3 = []

What about
? concat([[]~])
%1 = []~

Really, concat([]) should return the zero element of your monoid.
But there is absolutly no way for GP to know which monoid you meant.