[Haskell-cafe] Comparing functions
Vlatko Basic
vlatko.basic at gmail.com
Thu Jul 11 19:33:38 CEST 2013
Hello Cafe,
I have
data CmpFunction a = CF (a -> a -> Bool)
that contains comparing functions, like ==, <, > ..., and I'm trying to declare
the Show instance for it like this
instance Show (CmpFunction a) where
show (CF (==)) = "== " -- no good
show f = case f of -- no good also
CBF (==) -> "=="
_ -> "Other"
but compiler complains for both with
This binding for `==' shadows the existing binding
imported from `Prelude' at src/Main.hs:6:8-11
(and originally defined in `ghc-prim:GHC.Classes')
Is it possible at all to compare two functions or how to solve this problem, to
show some string for a specific function?
br,
vlatko
More information about the Haskell-Cafe
mailing list