[Haskell-cafe] Re: Type question in instance of a class

Jonathan Cast jonathanccast at fastmail.fm
Tue Nov 18 13:11:05 EST 2008


On Tue, 2008-11-18 at 19:05 +0100, Peter Hercek wrote:
> David Menendez wrote:
> > On Sun, Nov 16, 2008 at 7:09 PM, Luke Palmer <lrpalmer at gmail.com> wrote:
> >> On Sun, Nov 16, 2008 at 5:06 PM, Peter Hercek <phercek at gmail.com> wrote:
> >>> ... and the only value the function can return is bottom.
> >>> Is there any type system which would have more than
> >>>  one value which inhabits all types?
> >> Well something like lazy C# might; i.e. every value has a _|_
> >> (nontermination) and null (termination but undefined).
> > 
> > For that matter, Control.Exception allows you to distinguish
> > exceptional values from each other.
> > 
> 
> OK, thanks for responses. I'm not sure I understand it well
>   so I try to summarize:
> 
> Control.Exception is an extension, also it probably cannot
>   catch "error :: String -> a" since the report says so:
>   http://www.haskell.org/onlinereport/exps.html#sect3.1

I think `cannot be caught by the user' is intended to be descriptive
here; or, alternately, this is one place where GHC deviates from the
spec.  catch (error foo) h will certainly sometimes behave as h
(UserError foo).  Non-deterministically.

jcc




More information about the Haskell-Cafe mailing list