[Haskell-cafe] Overriding a Prelude function?

Miguel Mitrofanov miguelimo38 at yandex.ru
Thu Apr 23 15:34:33 EDT 2009


On 23 Apr 2009, at 23:07, Claus Reinke wrote:

>> *Main> :t rollDie ~>> (rollDie ~>> rollDie)
>> rollDie ~>> (rollDie ~>> rollDie) :: Seed -> (Int, Seed)
>> This is a function. How exactly do you want ghci to show it? When  
>> you figure that out, feel free to make an instance of Show for it.
>
> Just because user programs can't show function internals (they can
> show parts of in/out tables, and with sufficient overloading they can
> even show approximations of representation) that does not mean
> that the language implementation can't show function internals.

Well, than, what would you expect from this:

let {f x = g x;
       g 0 = 0;
       g n = f (n-1)}
in show f

?



More information about the Haskell-Cafe mailing list