bug in report? empty datatypes
we can now say:
data T
for an empty datatype what about:
data T deriving (Show) -- or Eq, Ord, ...
personally I think this should be legal. the actual semantics are irrelevant, as far as I can tell, since you won't ever have something of type T other than _|_ and so you could simply define the derived instance of equals to be something like:
instance Eq T where { (==) = undefined }
though
instance Eq T where { _ (==) _ = True }
seems also to be resonable. this isn't a big deal, but i'd like it fixed. ghc panics when you try to derive something. hugs gives you a syntax error and i can't get nhc to accept empty datatypes at all... - hal -- Hal Daume III "Computer science is no more about computers | hdaume@isi.edu than astronomy is about telescopes." -Dijkstra | www.isi.edu/~hdaume
participants (1)
-
Hal Daume III