Question:
Haskell’sTest.QuickCheck
module exports pattern Fn
, which I have been using.When I import it with:
Module ‘Test.QuickCheck’ does not export ‘Fn’
. I have also tried import Test.QuickCheck (Fun(Fn))
, but get a similar error doing that.As mentioned, the blanket import works, but here my preference is to use explicit imports so that I can easily see where each imported term came from. Is it possible to import such ‘patterns’ explicitly?
Answer:
You can’t doimport Test.QuickCheck (Fun(Fn))
because, although Fn
does construct a Fun
value, it is not actually one of the associated constructors of this type. Rather, it is a standalone pattern synonym. As such, you need the corresponding extension to explicitly import it:If you have better answer, please add a comment about this, thank you!