• python
  • javascript
  • reactjs
  • sql
  • c#
  • java
Facebook Twitter Instagram
Devs Fixed
  • python
  • javascript
  • reactjs
  • sql
  • c#
  • java
Devs Fixed
Home » Resolved: How to explicitly import ‘Fn’ pattern from Test.QuickCheck?

Resolved: How to explicitly import ‘Fn’ pattern from Test.QuickCheck?

0
By Isaac Tonny on 17/06/2022 Issue
Share
Facebook Twitter LinkedIn

Question:

Haskell’s Test.QuickCheck module exports pattern Fn, which I have been using.
When I import it with:
it works fine. However, when I import it with:
I get an error: 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 do import 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!

haskell pattern-synonyms quickcheck
Share. Facebook Twitter LinkedIn

Related Posts

Resolved: TypeScript does not recognize properties when instantiating interface array

27/03/2023

Resolved: How to make statement case insensitive when uploading a dta file with specified columns?

27/03/2023

Resolved: Sort dataframe columns value by close it to another column

27/03/2023

Leave A Reply

© 2023 DEVSFIX.COM

Type above and press Enter to search. Press Esc to cancel.