18 Oct 2012 10:52
haddock, instances and defining modules
Daniel Gorín <dgorin <at> dc.uba.ar>
2012-10-18 08:52:20 GMT
2012-10-18 08:52:20 GMT
Hi The haddock page for Data.Either lists an instance Functor (Either a). However, this instance doesn't get in scope when importing Data.Either. E.g., the following program fails to compile: > import Data.Either > > main = print $ fmap not $ Right "hello" AFAIK, one needs to import Control.Monad.Instances instead to get such an instance; but there is nothing in the haddock page of Data.Either that suggests it. This can be quite frustrating for beginners! It would be good if the docs could be improved here, but I'm not sure what to suggest (maybe haddock should be generating something else in these cases?)… Any thoughts? Thanks, Daniel
RSS Feed