Re: Help needed with compilation error
Andrew Phillips <[email protected]> Sat, 22 Oct 2016 13:07:09 -0700 (PDT)
| Newsgroups | gmane.comp.lang.scala |
|---|---|
| Message-ID | <[email protected]> |
------=_Part_755_498969717.1477166829969
Content-Type: multipart/alternative;
boundary="----=_Part_756_1514042039.1477166829969"
------=_Part_756_1514042039.1477166829969
Content-Type: text/plain; charset=UTF-8
Hi Abdul
I suspect this may be more of a question for scala-user, but from a quick
look, and without much investigation, it seems the problem is that the
compiler interprets the expression accumulate[T, O, O](a => a)(to) as if
you were trying to pass explicit arguments for the implicit parameters of
the method accumulate. The method takes *two* implicit parameters, but the
first argument list we are providing contains only one (a => a), so the
compiler complains.
The following variants, which help the compiler understand that we are
*first* trying to "create a version" of the accumulate method with the type
parameters bound to T, O and O, *then* apply the arguments "a => a" and
"to" to it, both work for me:
scala> def reduce[T[_]: Traversable, O: Monoid]: T[O] => O = to => {
| val accumulateFun: (O => O) => T[O] => O = accumulate _
| accumulateFun(a => a)(to)
| }
warning: there was one feature warning; re-run with -feature for details
reduce: [T[_], O](implicit evidence$1: Traversable[T], implicit evidence$2:
Mono
id[O])T[O] => O
scala> def reduce[T[_]: Traversable, O: Monoid]: T[O] => O = to =>
accumulate[
T, O, O].apply(a => a)(to)
warning: there was one feature warning; re-run with -feature for details
reduce: [T[_], O](implicit evidence$1: Traversable[T], implicit evidence$2:
Mono
id[O])T[O] => O
Note that both variants result in a warning on 2.11.6:
<console>:10: warning: higher-kinded type should be enabled
by making the implicit value scala.language.higherKinds visible.
This can be achieved by adding the import clause 'import
scala.language.higherKi
nds'
or by setting the compiler option -language:higherKinds.
See the Scala docs for value scala.language.higherKinds for a discussion
why the feature should be explicitly enabled.
See http://scalapuzzlers.com/#pzzlr-044 for a related code sample.
Regards
ap
On Saturday, 22 October 2016 15:31:24 UTC-4,
Abdul Rahman Sattar wrote:
>
> Hi,
>
> up vote
> down votefavorite
> <http://stackoverflow.com/questions/40195799/what-is-wrong-with-the-method-definition#>
>
> Below are my method signatures and definitions in scala
>
> def accumulate[T[_]: Traversable, O: Monoid, A]: (A => O) => T[A] => O =
> fao => ta =>
> (implicitly[Traversable[T]].traverse[({type f[X] = Acc[O, X]})#f, A, O](ta)(a => Acc(fao(a)))).value
>
> def reduce[T[_]: Traversable, O: Monoid]: T[O] => O = to => accumulate[T, O, O](a => a)(to)
>
> However I get the following error for my definition of reduce
>
> Error:(160, 82) not enough arguments for method accumulate: (implicit evidence$7: Traversable[T], implicit evidence$8: Monoid[O])(O => O) => (T[O] => O).Unspecified value parameter evidence$8.
> def reduce[T[_]: Traversable, O: Monoid]: T[O] => O = to => accumulate[T, O, O](a => a)(to)
> ^
>
> Not sure where I am going wrong. Any help would be appreciated.
>
> Thanks!
>
--
You received this message because you are subscribed to the Google Groups "scala-language" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
For more options, visit https://groups.google.com/d/optout.
------=_Part_756_1514042039.1477166829969
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
<div dir=3D"ltr">Hi Abdul<div><br></div><div>I suspect this may be more of =
a question for scala-user, but from a quick look, and without much investig=
ation, it seems the problem is that the compiler interprets the expression=
=C2=A0<span style=3D"font-family: Consolas, Menlo, Monaco, "Lucida Con=
sole", "Liberation Mono", "DejaVu Sans Mono", &quo=
t;Bitstream Vera Sans Mono", "Courier New", monospace, sans-=
serif; white-space: inherit; background-color: rgb(239, 240, 241); color: r=
gb(48, 51, 54);">accumulate</span><span style=3D"font-family: Consolas, Men=
lo, Monaco, "Lucida Console", "Liberation Mono", "=
DejaVu Sans Mono", "Bitstream Vera Sans Mono", "Courier=
New", monospace, sans-serif; white-space: inherit; background-color: =
rgb(239, 240, 241); color: rgb(48, 51, 54);">[</span><span style=3D"font-fa=
mily: Consolas, Menlo, Monaco, "Lucida Console", "Liberation=
Mono", "DejaVu Sans Mono", "Bitstream Vera Sans Mono&q=
uot;, "Courier New", monospace, sans-serif; white-space: inherit;=
background-color: rgb(239, 240, 241); color: rgb(48, 51, 54);">T</span><sp=
an style=3D"font-family: Consolas, Menlo, Monaco, "Lucida Console"=
;, "Liberation Mono", "DejaVu Sans Mono", "Bitstre=
am Vera Sans Mono", "Courier New", monospace, sans-serif; wh=
ite-space: inherit; background-color: rgb(239, 240, 241); color: rgb(48, 51=
, 54);">,</span><span style=3D"font-family: Consolas, Menlo, Monaco, "=
Lucida Console", "Liberation Mono", "DejaVu Sans Mono&q=
uot;, "Bitstream Vera Sans Mono", "Courier New", monosp=
ace, sans-serif; white-space: inherit; background-color: rgb(239, 240, 241)=
; color: rgb(48, 51, 54);"> O</span><span style=3D"font-family: Consolas, M=
enlo, Monaco, "Lucida Console", "Liberation Mono", &quo=
t;DejaVu Sans Mono", "Bitstream Vera Sans Mono", "Couri=
er New", monospace, sans-serif; white-space: inherit; background-color=
: rgb(239, 240, 241); color: rgb(48, 51, 54);">,</span><span style=3D"font-=
family: Consolas, Menlo, Monaco, "Lucida Console", "Liberati=
on Mono", "DejaVu Sans Mono", "Bitstream Vera Sans Mono=
", "Courier New", monospace, sans-serif; white-space: inheri=
t; background-color: rgb(239, 240, 241); color: rgb(48, 51, 54);"> O</span>=
<span style=3D"font-family: Consolas, Menlo, Monaco, "Lucida Console&q=
uot;, "Liberation Mono", "DejaVu Sans Mono", "Bits=
tream Vera Sans Mono", "Courier New", monospace, sans-serif;=
white-space: inherit; background-color: rgb(239, 240, 241); color: rgb(48,=
51, 54);">](</span><span style=3D"font-family: Consolas, Menlo, Monaco, &q=
uot;Lucida Console", "Liberation Mono", "DejaVu Sans Mo=
no", "Bitstream Vera Sans Mono", "Courier New", mo=
nospace, sans-serif; white-space: inherit; background-color: rgb(239, 240, =
241); color: rgb(48, 51, 54);">a </span><span style=3D"font-family: Consola=
s, Menlo, Monaco, "Lucida Console", "Liberation Mono", =
"DejaVu Sans Mono", "Bitstream Vera Sans Mono", "C=
ourier New", monospace, sans-serif; white-space: inherit; background-c=
olor: rgb(239, 240, 241); color: rgb(48, 51, 54);">=3D></span><span styl=
e=3D"font-family: Consolas, Menlo, Monaco, "Lucida Console", &quo=
t;Liberation Mono", "DejaVu Sans Mono", "Bitstream Vera=
Sans Mono", "Courier New", monospace, sans-serif; white-spa=
ce: inherit; background-color: rgb(239, 240, 241); color: rgb(48, 51, 54);"=
> a</span><span style=3D"font-family: Consolas, Menlo, Monaco, "Lucida=
Console", "Liberation Mono", "DejaVu Sans Mono", =
"Bitstream Vera Sans Mono", "Courier New", monospace, s=
ans-serif; white-space: inherit; background-color: rgb(239, 240, 241); colo=
r: rgb(48, 51, 54);">)(</span><span style=3D"font-family: Consolas, Menlo, =
Monaco, "Lucida Console", "Liberation Mono", "Deja=
Vu Sans Mono", "Bitstream Vera Sans Mono", "Courier New=
", monospace, sans-serif; white-space: inherit; background-color: rgb(=
239, 240, 241); color: rgb(48, 51, 54);">to</span><span style=3D"font-famil=
y: Consolas, Menlo, Monaco, "Lucida Console", "Liberation Mo=
no", "DejaVu Sans Mono", "Bitstream Vera Sans Mono"=
;, "Courier New", monospace, sans-serif; white-space: inherit; ba=
ckground-color: rgb(239, 240, 241); color: rgb(48, 51, 54);">)</span>=C2=A0=
as if you were trying to pass explicit arguments for the implicit parameter=
s of the method accumulate. The method takes <i>two</i>=C2=A0implicit param=
eters, but the first argument list we are providing contains only one (a =
=3D> a), so the compiler complains.</div><div><br></div><div>The followi=
ng variants, which help the compiler understand that we are <i>first</i> tr=
ying to "create a version" of the accumulate method with the type=
parameters bound to T, O and O, <i>then</i>=C2=A0apply the arguments "=
;a =3D> a" and "to" to it, both work for me:</div><div><b=
r></div><div><div><font face=3D"courier new, monospace" size=3D"2">scala>=
; =C2=A0 def reduce[T[_]: Traversable, O: Monoid]: T[O] =3D> O =3D to =
=3D> {</font></div><div><font face=3D"courier new, monospace" size=3D"2"=
>=C2=A0 =C2=A0 =C2=A0| =C2=A0 =C2=A0 val accumulateFun: (O =3D> O) =3D&g=
t; T[O] =3D> O =3D accumulate _</font></div><div><font face=3D"courier n=
ew, monospace" size=3D"2">=C2=A0 =C2=A0 =C2=A0| =C2=A0 =C2=A0 accumulateFun=
(a =3D> a)(to)</font></div><div><font face=3D"courier new, monospace" si=
ze=3D"2">=C2=A0 =C2=A0 =C2=A0| =C2=A0 }</font></div><div><font face=3D"cour=
ier new, monospace" size=3D"2">warning: there was one feature warning; re-r=
un with -feature for details</font></div><div><font face=3D"courier new, mo=
nospace" size=3D"2">reduce: [T[_], O](implicit evidence$1: Traversable[T], =
implicit evidence$2: Mono</font></div><div><font face=3D"courier new, monos=
pace" size=3D"2">id[O])T[O] =3D> O</font></div><div><font face=3D"courie=
r new, monospace" size=3D"2"><br></font></div><div><font face=3D"courier ne=
w, monospace" size=3D"2">scala> =C2=A0 def reduce[T[_]: Traversable, O: =
Monoid]: T[O] =3D> O =3D to =3D> accumulate[<br></font></div><div><fo=
nt face=3D"courier new, monospace" size=3D"2">T, O, O].apply(a =3D> a)(t=
o)</font></div><div><font face=3D"courier new, monospace" size=3D"2">warnin=
g: there was one feature warning; re-run with -feature for details</font></=
div><div><font face=3D"courier new, monospace" size=3D"2">reduce: [T[_], O]=
(implicit evidence$1: Traversable[T], implicit evidence$2: Mono</font></div=
><div><font face=3D"courier new, monospace" size=3D"2">id[O])T[O] =3D> O=
</font></div><br>Note that both variants result in a warning on 2.11.6:</di=
v><div><br></div><div><font face=3D"courier new, monospace"><console>=
:10: warning: higher-kinded type should be enabled</font></div><div><font f=
ace=3D"courier new, monospace">by making the implicit value scala.language.=
higherKinds visible.</font></div><div><font face=3D"courier new, monospace"=
>This can be achieved by adding the import clause 'import scala.languag=
e.higherKi</font></div><div><font face=3D"courier new, monospace">nds'<=
/font></div><div><font face=3D"courier new, monospace">or by setting the co=
mpiler option -language:higherKinds.</font></div><div><font face=3D"courier=
new, monospace">See the Scala docs for value scala.language.higherKinds fo=
r a discussion</font></div><div><font face=3D"courier new, monospace">why t=
he feature should be explicitly enabled.</font></div><div><br></div><div>Se=
e http://scalapuzzlers.com/#pzzlr-044 for a related code sample.</div><div>=
<br></div><div>Regards</div><div><br></div><div>ap</div><div><br></div><div=
><br></div><div>On Saturday, 22 October 2016 15:31:24 UTC-4,=C2=A0</div><di=
v><br></div><div>Abdul Rahman Sattar wrote:<blockquote class=3D"gmail_quot=
e" style=3D"margin: 0;margin-left: 0.8ex;border-left: 1px #ccc solid;paddin=
g-left: 1ex;"><div dir=3D"ltr">Hi,=C2=A0<div><br></div><div><table style=3D=
"border-collapse:collapse;color:rgb(36,39,41);font-family:Arial,"Helve=
tica Neue",Helvetica,sans-serif"><tbody><tr><td style=3D"padding-right=
:15px;vertical-align:top"><div style=3D"text-align:center;min-width:46px"><=
a title=3D"This question shows research effort; it is useful and clear" sty=
le=3D"margin-right:auto;margin-bottom:2px;margin-left:auto;font-size:1px;co=
lor:rgb(0,119,204);background-image:url("img/sprites.svg?v=3D8c1c8cba2=
42e"),none;background-repeat:no-repeat;overflow:hidden;display:block;w=
idth:40px;min-height:30px;background-position:0px -170px">up vote</a><span =
style=3D"margin-top:8px;margin-bottom:8px;font-size:20px;display:block;colo=
r:rgb(106,115,124)"><br></span><a title=3D"This question does not show any =
research effort; it is unclear or not useful" style=3D"margin-right:auto;ma=
rgin-bottom:10px;margin-left:auto;font-size:1px;color:rgb(0,119,204);backgr=
ound-image:url("img/sprites.svg?v=3D8c1c8cba242e"),none;backgroun=
d-repeat:no-repeat;overflow:hidden;display:block;width:40px;min-height:30px=
;background-position:0px -220px">down vote</a><a href=3D"http://stackoverfl=
ow.com/questions/40195799/what-is-wrong-with-the-method-definition#" title=
=3D"Click to mark as favorite question (click again to undo)" style=3D"marg=
in-right:auto;margin-bottom:2px;margin-left:auto;font-size:1px;color:rgb(0,=
119,204);background-image:url("img/sprites.svg?v=3D8c1c8cba242e")=
,none;background-repeat:no-repeat;overflow:hidden;display:block;width:40px;=
min-height:30px;background-position:0px -120px" target=3D"_blank" rel=3D"no=
follow" onmousedown=3D"this.href=3D'http://www.google.com/url?q\x3dhttp=
%3A%2F%2Fstackoverflow.com%2Fquestions%2F40195799%2Fwhat-is-wrong-with-the-=
method-definition%23\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNEgYxxz9JM9WGaI=
J7K80_il-Wx6Eg';return true;" onclick=3D"this.href=3D'http://www.go=
ogle.com/url?q\x3dhttp%3A%2F%2Fstackoverflow.com%2Fquestions%2F40195799%2Fw=
hat-is-wrong-with-the-method-definition%23\x26sa\x3dD\x26sntz\x3d1\x26usg\x=
3dAFQjCNEgYxxz9JM9WGaIJ7K80_il-Wx6Eg';return true;">favorite</a><div><s=
pan style=3D"color:rgb(106,115,124)"></span></div></div></td><td style=3D"v=
ertical-align:top"><div style=3D"margin-bottom:5px;font-size:15px;width:660=
px;word-wrap:break-word;line-height:1.3"><p style=3D"margin-bottom:1em;clea=
r:both">Below are my method signatures and definitions in scala</p><pre sty=
le=3D"margin-bottom:1em;padding:5px;font-size:13px;width:auto;max-height:60=
0px;overflow:auto;font-family:Consolas,Menlo,Monaco,"Lucida Console&qu=
ot;,"Liberation Mono","DejaVu Sans Mono","Bitstrea=
m Vera Sans Mono","Courier New",monospace,sans-serif;backgro=
und-color:rgb(239,240,241);color:rgb(57,51,24);word-wrap:normal"><code styl=
e=3D"font-family:Consolas,Menlo,Monaco,"Lucida Console","Lib=
eration Mono","DejaVu Sans Mono","Bitstream Vera Sans M=
ono","Courier New",monospace,sans-serif;white-space:inherit"=
><span style=3D"color:rgb(48,51,54)"> </span><span style=3D"color:rgb(16,1=
6,148)">def</span><span style=3D"color:rgb(48,51,54)"> accumulate</span><sp=
an style=3D"color:rgb(48,51,54)">[</span><span style=3D"color:rgb(48,51,54)=
">T</span><span style=3D"color:rgb(48,51,54)">[</span><span style=3D"color:=
rgb(48,51,54)">_</span><span style=3D"color:rgb(48,51,54)">]:</span><span s=
tyle=3D"color:rgb(48,51,54)"> </span><span style=3D"color:rgb(43,145,175)">=
Traversable</span><span style=3D"color:rgb(48,51,54)">,</span><span style=
=3D"color:rgb(48,51,54)"> O</span><span style=3D"color:rgb(48,51,54)">:</sp=
an><span style=3D"color:rgb(48,51,54)"> </span><span style=3D"color:rgb(43,=
145,175)">Monoid</span><span style=3D"color:rgb(48,51,54)">,</span><span st=
yle=3D"color:rgb(48,51,54)"> A</span><span style=3D"color:rgb(48,51,54)">]:=
</span><span style=3D"color:rgb(48,51,54)"> </span><span style=3D"color:rgb=
(48,51,54)">(</span><span style=3D"color:rgb(48,51,54)">A </span><span styl=
e=3D"color:rgb(48,51,54)">=3D></span><span style=3D"color:rgb(48,51,54)"=
> O</span><span style=3D"color:rgb(48,51,54)">)</span><span style=3D"color:=
rgb(48,51,54)"> </span><span style=3D"color:rgb(48,51,54)">=3D></span><s=
pan style=3D"color:rgb(48,51,54)"> T</span><span style=3D"color:rgb(48,51,5=
4)">[</span><span style=3D"color:rgb(48,51,54)">A</span><span style=3D"colo=
r:rgb(48,51,54)">]</span><span style=3D"color:rgb(48,51,54)"> </span><span =
style=3D"color:rgb(48,51,54)">=3D></span><span style=3D"color:rgb(48,51,=
54)"> O </span><span style=3D"color:rgb(48,51,54)">=3D</span><span style=3D=
"color:rgb(48,51,54)">
fao </span><span style=3D"color:rgb(48,51,54)">=3D></span><span styl=
e=3D"color:rgb(48,51,54)"> ta </span><span style=3D"color:rgb(48,51,54)">=
=3D></span><span style=3D"color:rgb(48,51,54)">
</span><span style=3D"color:rgb(48,51,54)">(</span><span style=3D"col=
or:rgb(48,51,54)">implicitly</span><span style=3D"color:rgb(48,51,54)">[</s=
pan><span style=3D"color:rgb(43,145,175)">Traversable</span><span style=3D"=
color:rgb(48,51,54)">[</span><span style=3D"color:rgb(48,51,54)">T</span><s=
pan style=3D"color:rgb(48,51,54)">]].</span><span style=3D"color:rgb(48,51,=
54)">tr<wbr>averse</span><span style=3D"color:rgb(48,51,54)">[({</span><spa=
n style=3D"color:rgb(16,16,148)">type</span><span style=3D"color:rgb(48,51,=
54)"> f</span><span style=3D"color:rgb(48,51,54)">[</span><span style=3D"co=
lor:rgb(48,51,54)">X</span><span style=3D"color:rgb(48,51,54)">]</span><spa=
n style=3D"color:rgb(48,51,54)"> </span><span style=3D"color:rgb(48,51,54)"=
>=3D</span><span style=3D"color:rgb(48,51,54)"> </span><span style=3D"color=
:rgb(43,145,175)">Acc</span><span style=3D"color:rgb(48,51,54)">[</span><sp=
an style=3D"color:rgb(48,51,54)">O</span><span style=3D"color:rgb(48,51,54)=
">,</span><span style=3D"color:rgb(48,51,54)"> X</span><span style=3D"color=
:rgb(48,51,54)">]})#</span><span style=3D"color:rgb(48,51,54)">f</span><spa=
n style=3D"color:rgb(48,51,54)">,</span><span style=3D"color:rgb(48,51,54)"=
> A</span><span style=3D"color:rgb(48,51,54)">,</span><span style=3D"color:=
rgb(48,51,54)"> O</span><span style=3D"color:rgb(48,51,54)">](</span><span =
style=3D"color:rgb(48,51,54)">ta</span><span style=3D"color:rgb(48,51,54)">=
)(</span><span style=3D"color:rgb(48,51,54)">a </span><span style=3D"color:=
rgb(48,51,54)">=3D></span><span style=3D"color:rgb(48,51,54)"> </span><s=
pan style=3D"color:rgb(43,145,175)">Acc</span><span style=3D"color:rgb(48,5=
1,54)">(</span><span style=3D"color:rgb(48,51,54)">fao</span><span style=3D=
"color:rgb(48,51,54)">(</span><span style=3D"color:rgb(48,51,54)">a</span><=
span style=3D"color:rgb(48,51,54)">)))).</span><span style=3D"color:rgb(48,=
51,54)">value
</span><span style=3D"color:rgb(16,16,148)">def</span><span style=3D"colo=
r:rgb(48,51,54)"> reduce</span><span style=3D"color:rgb(48,51,54)">[</span>=
<span style=3D"color:rgb(48,51,54)">T</span><span style=3D"color:rgb(48,51,=
54)">[</span><span style=3D"color:rgb(48,51,54)">_</span><span style=3D"col=
or:rgb(48,51,54)">]:</span><span style=3D"color:rgb(48,51,54)"> </span><spa=
n style=3D"color:rgb(43,145,175)">Traversable</span><span style=3D"color:rg=
b(48,51,54)">,</span><span style=3D"color:rgb(48,51,54)"> O</span><span sty=
le=3D"color:rgb(48,51,54)">:</span><span style=3D"color:rgb(48,51,54)"> </s=
pan><span style=3D"color:rgb(43,145,175)">Monoid</span><span style=3D"color=
:rgb(48,51,54)">]:</span><span style=3D"color:rgb(48,51,54)"> T</span><span=
style=3D"color:rgb(48,51,54)">[</span><span style=3D"color:rgb(48,51,54)">=
O</span><span style=3D"color:rgb(48,51,54)">]</span><span style=3D"color:rg=
b(48,51,54)"> </span><span style=3D"color:rgb(48,51,54)">=3D></span><spa=
n style=3D"color:rgb(48,51,54)"> O </span><span style=3D"color:rgb(48,51,54=
)">=3D</span><span style=3D"color:rgb(48,51,54)"> to </span><span style=3D"=
color:rgb(48,51,54)">=3D></span><span style=3D"color:rgb(48,51,54)"> acc=
umulate</span><span style=3D"color:rgb(48,51,54)">[</span><span style=3D"co=
lor:rgb(48,51,54)">T</span><span style=3D"color:rgb(48,51,54)">,</span><spa=
n style=3D"color:rgb(48,51,54)"> O</span><span style=3D"color:rgb(48,51,54)=
">,</span><span style=3D"color:rgb(48,51,54)"> O</span><span style=3D"color=
:rgb(48,51,54)">](</span><span style=3D"color:rgb(48,51,54)">a </span><span=
style=3D"color:rgb(48,51,54)">=3D></span><span style=3D"color:rgb(48,51=
,54)"> a</span><span style=3D"color:rgb(48,51,54)">)(</span><span style=3D"=
color:rgb(48,51,54)">to</span><span style=3D"color:rgb(48,51,54)">)</span><=
/code></pre><p style=3D"margin-bottom:1em;clear:both">However I get the fol=
lowing error for my definition of reduce</p><pre style=3D"margin-bottom:1em=
;padding:5px;font-size:13px;width:auto;max-height:600px;overflow:auto;font-=
family:Consolas,Menlo,Monaco,"Lucida Console","Liberation Mo=
no","DejaVu Sans Mono","Bitstream Vera Sans Mono",=
"Courier New",monospace,sans-serif;background-color:rgb(239,240,2=
41);color:rgb(57,51,24);word-wrap:normal"><code style=3D"font-family:Consol=
as,Menlo,Monaco,"Lucida Console","Liberation Mono",&quo=
t;DejaVu Sans Mono","Bitstream Vera Sans Mono","Courier=
New",monospace,sans-serif;white-space:inherit"><span style=3D"color:r=
gb(43,145,175)">Error</span><span style=3D"color:rgb(48,51,54)">:(</span><s=
pan style=3D"color:rgb(125,39,39)">160</span><span style=3D"color:rgb(48,51=
,54)">,</span><span style=3D"color:rgb(48,51,54)"> </span><span style=3D"co=
lor:rgb(125,39,39)">82</span><span style=3D"color:rgb(48,51,54)">)</span><s=
pan style=3D"color:rgb(48,51,54)"> not enough arguments </span><span style=
=3D"color:rgb(16,16,148)">for</span><span style=3D"color:rgb(48,51,54)"> me=
thod accumulate</span><span style=3D"color:rgb(48,51,54)">:</span><span sty=
le=3D"color:rgb(48,51,54)"> </span><span style=3D"color:rgb(48,51,54)">(</s=
pan><span style=3D"color:rgb(16,16,148)">implicit</span><span style=3D"colo=
r:rgb(48,51,54)"> evidence$7</span><span style=3D"color:rgb(48,51,54)">:</s=
pan><span style=3D"color:rgb(48,51,54)"> </span><span style=3D"color:rgb(43=
,145,175)">Traversable</span><span style=3D"color:rgb(48,51,54)">[</span><s=
pan style=3D"color:rgb(48,51,54)">T</span><span style=3D"color:rgb(48,51,54=
)">],</span><span style=3D"color:rgb(48,51,54)"> </span><span style=3D"colo=
r:rgb(16,16,148)">implicit</span><span style=3D"color:rgb(48,51,54)"> evide=
nce$8</span><span style=3D"color:rgb(48,51,54)">:</span><span style=3D"colo=
r:rgb(48,51,54)"> </span><span style=3D"color:rgb(43,145,175)">Monoid</span=
><span style=3D"color:rgb(48,51,54)">[</span><span style=3D"color:rgb(48,51=
,54)">O</span><span style=3D"color:rgb(48,51,54)">])(</span><span style=3D"=
color:rgb(48,51,54)">O </span><span style=3D"color:rgb(48,51,54)">=3D></=
span><span style=3D"color:rgb(48,51,54)"> O</span><span style=3D"color:rgb(=
48,51,54)">)</span><span style=3D"color:rgb(48,51,54)"> </span><span style=
=3D"color:rgb(48,51,54)">=3D></span><span style=3D"color:rgb(48,51,54)">=
</span><span style=3D"color:rgb(48,51,54)">(</span><span style=3D"color:rg=
b(48,51,54)">T</span><span style=3D"color:rgb(48,51,54)">[</span><span styl=
e=3D"color:rgb(48,51,54)">O</span><span style=3D"color:rgb(48,51,54)">]</sp=
an><span style=3D"color:rgb(48,51,54)"> </span><span style=3D"color:rgb(48,=
51,54)">=3D></span><span style=3D"color:rgb(48,51,54)"> O</span><span st=
yle=3D"color:rgb(48,51,54)">).</span><span style=3D"color:rgb(48,51,54)">
</span><span style=3D"color:rgb(43,145,175)">Unspecified</span><span style=
=3D"color:rgb(48,51,54)"> value parameter evidence$8</span><span style=3D"c=
olor:rgb(48,51,54)">.</span><span style=3D"color:rgb(48,51,54)">
</span><span style=3D"color:rgb(16,16,148)">def</span><span style=3D"colo=
r:rgb(48,51,54)"> reduce</span><span style=3D"color:rgb(48,51,54)">[</span>=
<span style=3D"color:rgb(48,51,54)">T</span><span style=3D"color:rgb(48,51,=
54)">[</span><span style=3D"color:rgb(48,51,54)">_</span><span style=3D"col=
or:rgb(48,51,54)">]:</span><span style=3D"color:rgb(48,51,54)"> </span><spa=
n style=3D"color:rgb(43,145,175)">Traversable</span><span style=3D"color:rg=
b(48,51,54)">,</span><span style=3D"color:rgb(48,51,54)"> O</span><span sty=
le=3D"color:rgb(48,51,54)">:</span><span style=3D"color:rgb(48,51,54)"> </s=
pan><span style=3D"color:rgb(43,145,175)">Monoid</span><span style=3D"color=
:rgb(48,51,54)">]:</span><span style=3D"color:rgb(48,51,54)"> T</span><span=
style=3D"color:rgb(48,51,54)">[</span><span style=3D"color:rgb(48,51,54)">=
O</span><span style=3D"color:rgb(48,51,54)">]</span><span style=3D"color:rg=
b(48,51,54)"> </span><span style=3D"color:rgb(48,51,54)">=3D></span><spa=
n style=3D"color:rgb(48,51,54)"> O </span><span style=3D"color:rgb(48,51,54=
)">=3D</span><span style=3D"color:rgb(48,51,54)"> to </span><span style=3D"=
color:rgb(48,51,54)">=3D></span><span style=3D"color:rgb(48,51,54)"> acc=
umulate</span><span style=3D"color:rgb(48,51,54)">[</span><span style=3D"co=
lor:rgb(48,51,54)">T</span><span style=3D"color:rgb(48,51,54)">,</span><spa=
n style=3D"color:rgb(48,51,54)"> O</span><span style=3D"color:rgb(48,51,54)=
">,</span><span style=3D"color:rgb(48,51,54)"> O</span><span style=3D"color=
:rgb(48,51,54)">](</span><span style=3D"color:rgb(48,51,54)">a </span><span=
style=3D"color:rgb(48,51,54)">=3D></span><span style=3D"color:rgb(48,51=
,54)"> a</span><span style=3D"color:rgb(48,51,54)">)(</span><span style=3D"=
color:rgb(48,51,54)">to</span><span style=3D"color:rgb(48,51,54)">)</span><=
span style=3D"color:rgb(48,51,54)">
=
</span><span style=3D"color:rgb(48,51,54)">^</span></code></pre><p st=
yle=3D"margin-bottom:1em;clear:both">Not sure where I am going wrong. Any h=
elp would be appreciated.</p><p style=3D"margin-bottom:1em;clear:both">Than=
ks!</p></div></td></tr></tbody></table></div></div></blockquote></div></div=
>
<p></p>
-- <br />
You received this message because you are subscribed to the Google Groups &=
quot;scala-language" group.<br />
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to <a href=3D"mailto:[email protected]">scal=
[email protected]</a>.<br />
For more options, visit <a href=3D"https://groups.google.com/d/optout">http=
s://groups.google.com/d/optout</a>.<br />
------=_Part_756_1514042039.1477166829969--
------=_Part_755_498969717.1477166829969--