Dear all,
I was playing around recently with translating the dependency injection idea
(http://martinfowler.com/articles/injection.html) into Haskell, and got to
the following code:
{-# LANGUAGE TypeFamilies, FlexibleContexts #-}
data Movie = Movie { getDirector :: String }
data (MovieFinder
Hello Dmitry,
Sunday, January 10, 2010, 7:09:33 PM, you wrote:
-- Cannot remove the type signature here
createLister :: (MovieFinder f) = (FinderResultMonad f) (MovieLister f)
createLister = fmap MovieLister createFinder
it's a Monomorphism Restriction of Haskell'98, disabled with
Oh, I see... Thank you, it works now with NoMonomorphismRestriction. The
error message is extremely misleading though... And so is the type signature
inferred by the compiler.
2010/1/10 Bulat Ziganshin bulat.zigans...@gmail.com
it's a Monomorphism Restriction of Haskell'98, disabled with
Am Sonntag 10 Januar 2010 17:09:33 schrieb Dmitry Tsygankov:
Dear all,
I was playing around recently with translating the dependency injection
idea (http://martinfowler.com/articles/injection.html) into Haskell, and
got to the following code:
{-# LANGUAGE TypeFamilies, FlexibleContexts #-}
Daniel Fischer wrote:
(Note: Surprisingly (?), if you load a module with
{-# LANGUAGE NoMonomorphismRestriction #-}
, the monomorphsm restriction is still enabled at the ghci prompt, so we
have to disable it for that again - or we could have loaded the module with
$ ghci
Am Montag 11 Januar 2010 05:08:30 schrieb Dmitry Tsygankov:
2010/1/10 Yitzchak Gale
IMHO, the monomorphism restriction does not make sense at the
GHCi prompt in any case, no matter what you have or haven't
loaded, and no matter what your opinion of MR in general.
Looks reasonable to me,