Hello!

On Thu, Mar 11, 1999 at 12:13:21PM -0800, Craig Dickson wrote:
> [...]

> Absolutely not. It sounds like you're thinking you can call foo, have it
> generate a list of unknown type but known length, and then assign a type
> afterwards. You can't do that.

Yes you can, as there IS a value that is member of all types: bottom.

i.e.
foo n :: (Num a) => a -> [b]
foo n = take n (repeat bottom)
  where
    bottom = bottom -- or undefined or error "bottom" or any other
                    -- concrete way to express bottom

Regards, Felix.


Reply via email to