<html><head><meta http-equiv="Content-Type" content="text/html charset=windows-1252"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;">Thank you, both, for responding.<div>What I was trying to express was that the particular type of LogTree2, t, would determine the type of SizedVector, a, apropos to the ‘evaluator’ function, for a particular instance. It looks like functional dependencies is the right way to achieve this, because this type checks:</div><div><br></div><div><div><font face="Menlo">class LogTree2 t a | t -> a where</font></div><div><font face="Menlo">    evaluator :: LogTree2 t a => t -> SizedVector a -> SizedVector a</font></div><div><br></div><div>-db</div><div><br></div><div><div>On Aug 29, 2015, at 5:39 PM, William Yager <<a href="mailto:will.yager@gmail.com">will.yager@gmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div dir="ltr">Hey David,<div><br></div><div>I think there might be a bit of confusion here. When you say "LogTree2 a", that means "a" is an instance of "LogTree2". Maybe you want something like this?</div><div><br></div><div>evaluator :: LogTree2 a => a -> SizedVector a -> SizedVector a</div><div><br></div><div>Some context might help us to understand what you're going for.</div><div><br></div><div>--Will</div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Sat, Aug 29, 2015 at 7:30 PM, David Banas <span dir="ltr"><<a href="mailto:capn.freako@gmail.com" target="_blank">capn.freako@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word">Thanks, Will.<div>Maybe I’ve got the syntax all wrong, but my intent is just to constrain the type ’t’ to be of class 'LogTree2 a’.</div><div>-db</div><div><br><div><div>On Aug 29, 2015, at 5:27 PM, William Yager <<a href="mailto:will.yager@gmail.com" target="_blank">will.yager@gmail.com</a>> wrote:</div><br><blockquote type="cite"><div dir="ltr"><div>If you want the "LogTree2" typeclass to have multiple type arguments (which it looks like you do, from the definition of "evaluator"), you need to define it as </div><div><br></div><div><span style="font-family:Menlo;font-size:13px">class (Show a, Num a) => LogTree2 a t where</span><br></div><div><span style="font-family:Menlo;font-size:13px"><br></span></div><div>--Will<span style="font-family:Menlo;font-size:13px"><br></span></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Sat, Aug 29, 2015 at 6:45 PM, David Banas <span dir="ltr"><<a href="mailto:capn.freako@gmail.com" target="_blank">capn.freako@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word">Hi all,<div><br></div><div>I can’t figure out why this is invalid:</div><div><br></div><div><div><font face="Menlo">class (Show a, Num a) => LogTree2 a where</font></div><div><span style="font-family:Menlo">    evaluator :: (LogTree2 a) t => t -> SizedVector a -> SizedVector a</span></div><div><font face="Menlo"><br></font></div></div><div><font face="Menlo">error| ‘LogTree2’ is applied to too many type arguments In the type ‘(LogTree2 a) t => t -> SizedVector a -> SizedVector a’ In the class declaration for ‘LogTree2’</font></div><div><br></div><div>Can anyone help me understand?</div><div><br></div><div>Thanks,</div><div>-db</div><div><br></div></div><br>_______________________________________________<br>
Haskell-Cafe mailing list<br>
<a href="mailto:Haskell-Cafe@haskell.org" target="_blank">Haskell-Cafe@haskell.org</a><br>
<a href="http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe" rel="noreferrer" target="_blank">http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe</a><br>
<br></blockquote></div><br></div>
</blockquote></div><br></div></div></blockquote></div><br></div>
</blockquote></div><br></div></body></html>