[Haskell-beginners] compilation error..

Sunil S Nandihalli sunil.nandihalli at gmail.com
Thu Aug 11 13:43:27 CEST 2011


Hello everybody,
 when I compile the file

https://github.com/sunilnandihalli/is2/blob/master/main.hs

I get
main.hs:28:64:
    Could not deduce (Enum (a, t0))
      arising from the arithmetic sequence `0 .. '
    from the context (Integral a)
      bound by the type signature for
                 plotAsString :: Integral a => [(a, a)] -> (a, a) -> String
      at main.hs:(26,1)-(38,41)
    Possible fix:
      add (Enum (a, t0)) to the context of
        the type signature for
          plotAsString :: Integral a => [(a, a)] -> (a, a) -> String
      or add an instance declaration for (Enum (a, t0))
    In the second argument of `zip', namely `[0 .. ]'
    In the first argument of `M.fromList', namely `(zip locs [0 .. ])'
    In the expression: M.fromList (zip locs [0 .. ])

main.hs:28:65:
    Could not deduce (Num (a, t0)) arising from the literal `0'
    from the context (Integral a)
      bound by the type signature for
                 plotAsString :: Integral a => [(a, a)] -> (a, a) -> String
      at main.hs:(26,1)-(38,41)
    Possible fix:
      add (Num (a, t0)) to the context of
        the type signature for
          plotAsString :: Integral a => [(a, a)] -> (a, a) -> String
      or add an instance declaration for (Num (a, t0))
    In the expression: 0
    In the second argument of `zip', namely `[0 .. ]'
    In the first argument of `M.fromList', namely `(zip locs [0 .. ])'


can somebody help?
Thanks,
Sunil.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/beginners/attachments/20110811/efeaceeb/attachment.htm>


More information about the Beginners mailing list