
4 Sep
2010
4 Sep
'10
6:03 a.m.
On 4 September 2010 19:01, Alexander McPhail
Hi
Is there a similar ticket for GHC to not export instances in the case that other instances are explicitly specified?
module Foo ( Foo(Monad) )
instance Monad Foo where ... instance MonadState (Foo Bar) where ...
i.e. the monad instance gets exported but the MonadState one does not? This helps in maintaining opacity with respect to the package user. I may not want the user to be able to call 'get' and 'put' when using my custom monad.
No: instances are implicitly imported and exported (if the class and the type are visible, then so are any possible instances). -- Ivan Lazar Miljenovic Ivan.Miljenovic@gmail.com IvanMiljenovic.wordpress.com