Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.haskell > #423 > unrolled thread

is applied to too many type arguments In the type signature for

Started bymeInvent bbird <jobmattcon@gmail.com>
First post2016-07-26 00:02 -0700
Last post2016-07-26 09:17 +0100
Articles 2 — 2 participants

Back to article view | Back to comp.lang.haskell


Contents

  is applied to too many type arguments In the type signature for meInvent bbird <jobmattcon@gmail.com> - 2016-07-26 00:02 -0700
    Re: is applied to too many type arguments In the type signature for Mark Carroll <mtbc@bcs.org> - 2016-07-26 09:17 +0100

#423 — is applied to too many type arguments In the type signature for

FrommeInvent bbird <jobmattcon@gmail.com>
Date2016-07-26 00:02 -0700
Subjectis applied to too many type arguments In the type signature for
Message-ID<6b42a993-74c6-4302-9807-1ac7588c9033@googlegroups.com>
[1 of 1] Compiling Main             ( trees3a.hs, interpreted )

trees3a.hs:79:25:
    `Operation' is applied to too many type arguments
    In the type signature for `getAllTreesFromList':
      getAllTreesFromList :: (Operation b, Integral a) =>
                             [b] -> [a] -> [Mree a]
Failed, modules loaded: none.



data Operation
  = MA
  | MB
    deriving Show

getAllTreesFromList :: (Operation b, Double a) => [b] -> [a] -> [Mree a]
getAllTreesFromList ys [] = []
getAllTreesFromList ys [x] = return $ Meaf x
getAllTreesFromList ys xs = do
  (left, right) <- splits xs
  guard $ not (null left) && not (null right)
  leftT <- getAllTreesFromList ys left
  rightT <- getAllTreesFromList ys right
  op <- ys
  return $ Mode leftT op rightT

[toc] | [next] | [standalone]


#424

FromMark Carroll <mtbc@bcs.org>
Date2016-07-26 09:17 +0100
Message-ID<87bn1kx17a.fsf@ixod.org>
In reply to#423
On 26 Jul 2016, meInvent bbird wrote:

> data Operation
>   = MA
>   | MB
>     deriving Show
>
> getAllTreesFromList :: (Operation b, Double a) => [b] -> [a] -> [Mree a]

Between the round parentheses one mentions typeclasses, not types.
Perhaps you meant something like,

	getAllTreesFromList :: [Operation] -> [Double] -> [Mree a]

-- Mark

[toc] | [prev] | [standalone]


Back to top | Article view | comp.lang.haskell


csiph-web