On 10 Mar, Steve Frampton wrote:
> My function looks sort of like this:
>
>foo :: Int -> [a]
>foo 0 = []
>foo x = ['1'] ++ foo(x - 1)
Since Haskell can infer types most of the time, try
>foo 0 = []
>foo x = ['1'] ++ foo(x - 1)
with this loaded into hugs you can then try
Steve Frampton wrote:
Steve --
Try this:
foo :: Int -> [Char]
leaving the rest as it is. On my copy of Hugs, (Hugs98 on Linux running with
the -98 option), it works fine.
Good luck!
-- Seth
> Hello:
>
> Okay, I'm [damn] confused regarding type-casting in Haskell. I'm trying
> to write a
Steve Frampton wrote:
> I'm having a lot of problems with "Declared type too general", "Type error
> in application", etc. depending on what I try.
Well, it *is* too general. :)
> My function looks sort of like this:
>
> foo :: Int -> [a]
> foo 0 = []
> foo x = ['1'] ++ foo(x - 1)
Accord
Steve Frampton wrote:
>Okay, I'm [damn] confused regarding type-casting in Haskell.
Because there isn't any?
>I'm trying
>to write a function that accepts an integer and then returns a set (in
>this case, a set of characters).
>
>I'm having a lot of problems with "Declared type too general", "T
Simon Peyton-Jones proposes:
> A Haskell 98 addendum
[ ... ]
> Well, the bits are frozen, but I propose to regard this as a gross
> "typo" and add it to the typos page.
[ ... ]
> So the "typo" fix I propose is
[ ... ]
> Any objections?
Call it Haskell 1.6 ;-)
Best,
W