3 abstract class fn
<a
,b
,r
> {
4 public abstract r
apply (a x
,b y
);
7 class fn1
<a
> : fn
<lis
<a
>,lis
<a
>,lis
<a
>>
9 public override lis
<a
> apply (lis
<a
> x
,lis
<a
> y
)
11 return M
.RevAppend (x
,y
);
16 public static b FoldLeft
<a
, b
> (a x
, b acc
, fn
<a
, b
, b
> f
)
18 return f
.apply (x
, acc
);
21 public static lis
<a
> RevAppend
<a
> (lis
<a
> x
, lis
<a
> y
) {
25 public static lis
<lis
<a
>> Concat
<a
> (lis
<lis
<a
>> l
)
27 return FoldLeft
<lis
<lis
<a
>>, lis
<lis
<a
>>> (l
, new lis
<lis
<a
>> (), new
31 public static void Main ()
33 M
.Concat (new lis
<lis
<string>> ());