
On Jul 10, 2006, at 8:44 AM, Johan Grönqvist wrote:
"deriving Show" is impossible as Func is not instance of Show. Can I make it instance of Show? I just want to define something like ... and I am not interested in actually displaying any information about the function, ...
Were you interested in "seeing" the function, you could do so, at least for finite, total functions (you can also enumerate them, compare them for equality, etc.). See my haskell-cafe message at http://www.haskell.org/pipermail/haskell-cafe/2006-April/015197.html. By way of example, and quoting a sample interaction from that message:
not == not True not == id False id == (not . not) True fromEnum not 1 not == toEnum 1 True not (\x -> case x of False -> True; True -> False) not == (\x -> case x of False -> True; True -> False) True id :: Bool -> Bool (\x -> case x of False -> False; True -> True) const True :: Bool -> Bool (\x -> case x of False -> True; True -> True)
-- Fritz