Skip to content

Being instance of Monoid is not checked

It is possible pass not only instances of Monoid to tell function and load the file with GHCi. GHCi shows type f :: (MonadWriter ((a -> b) -> [a] -> [b]) m) => t -> m ()

f _ = tell map

However, if code is

f = tell map

GHCi shows type error(no instance) as expected.

It seems very strange that type correctness depends on number of parameters for function that is not used anywhere.

Trac metadata
Trac field Value
Version 6.10.3
Type Bug
TypeOfFailure OtherFailure
Priority normal
Resolution Unresolved
Component Compiler (Type checker)
Test case
Differential revisions
BlockedBy
Related
Blocking
CC
Operating system
Architecture
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information