[Haskell-cafe] Question, re: type class syntax.
capn.freako at gmail.com
Sun Aug 30 00:30:35 UTC 2015
Maybe I’ve got the syntax all wrong, but my intent is just to constrain the type ’t’ to be of class 'LogTree2 a’.
On Aug 29, 2015, at 5:27 PM, William Yager <will.yager at gmail.com> wrote:
> 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
> class (Show a, Num a) => LogTree2 a t where
> On Sat, Aug 29, 2015 at 6:45 PM, David Banas <capn.freako at gmail.com> wrote:
> Hi all,
> I can’t figure out why this is invalid:
> class (Show a, Num a) => LogTree2 a where
> evaluator :: (LogTree2 a) t => t -> SizedVector a -> SizedVector a
> 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’
> Can anyone help me understand?
> Haskell-Cafe mailing list
> Haskell-Cafe at haskell.org
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Haskell-Cafe