Comments (1)
I think this looks much nicer
{-# language TypeApplications #-} ... , constant "+" ((+) @Int)
That's a good suggestion. I have added a note on the README mentioning this.
In favour of backwards compatibility, I usually try to stay away from language extensions where possible when writing libraries. Speculate does work on GHCs down to version 7.8 and I suspect it could be backported further to 7.6 and 7.4 with minor changes. (cf. TypeApplications started exiting in GHC 7.8)
the "proxy" role could be made more clear by writing
undefined::N
, or byProxy :: Proxy N
, but I think this would be best:
The first option, undefined :: N
is the one I use most frequently in the examples folder. I'm aware of Proxy
but ended up deciding to go for a more "old-school" solution.
Incidentally: I'm from the time before TypeApplications, I even created a LeanCheck module with a "DSL of sorts" for type binding. The original example would become:
, constant "+" ((+) -:> int)
But of course, in today's times, it is better to use the more widely known TypeApplications pragma. This is more of a curiosity now.
from speculate.
Related Issues (12)
- Test build failure on stackage nightly HOT 3
- output of theorems should be lazy, but is not, because of alignment HOT 2
- Basic `Listable` instances for composite types HOT 1
- stackage nightly - speculate-0.4.14 - test build fails HOT 2
- Speculate on DejaFu: `speculate: could not find Listable Thread D1 D1`
- Incorrect equations when size limit is increased. HOT 1
- Does not find Functor Composition Law HOT 2
- Provide module for treating functions as test values. HOT 1
- Grading functions HOT 2
- Do newtypes need special handling? HOT 4
- document what instances must be given HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from speculate.