Comments (3)
Is GH the appropriate forum to ask newbie questions?
Sure! Bad documentation is a bug after all...
Which part of this is the QC test and which part is the core implementation? I'm guessing these lines are the core implementation of the ticket dispenser, right?
That's right.
Looking at the way the core implementation has been written, and what's written in the README as well, i.e. a datatype of commands;, does it basically mean that the app needs to be structured like an Elm/React app?
I've never seen an Elm or React app, but the library should not force you to structure your program in any particular way -- if you feel that it does then please report a bug.
I'm assuming this is the simplified model against which the real model is being tested, right?
That's right.
What is the phantom type refs for?
The library has built in support for reference-like constructs -- that's what refs
is for. The ticket dispenser example doesn't use any reference-like constructs and hence doesn't use refs
, but if you look at for example the mutable reference example you'll see how refs
can be used...
Why is a complicated GADT required for the app-wide Action data model? Is it because an Action is conceptually a representation of a function call which can accept any data-type and return any data-type?
Yes, in this case it's a representation of a function call.
Which also brings me to the next question, what if TakeTicket could accept the number of tickets the user wants to take? What would the Action type look like, in that case?
TakeTicket :: Int -> Action refs ('Response Int)
Any further explanation of what the type signature of semantics means and why is it so complicated?
I will open a PR where I add some more comments to that function during the day, I'll cc you.
from quickcheck-state-machine.
@saurabhnanda: We made a big refactor of the API in PR #129, could you please revisit the example and check if you find it any easier to understand now? Cheers.
from quickcheck-state-machine.
Closing; feel free to reopen if you got further questions!
from quickcheck-state-machine.
Related Issues (20)
- `forAllCommands` generating fewer commands than expected HOT 3
- Exception while generating shrink-list
- simplify: impossible, because of the structure of linearise. HOT 7
- Use dot for visualization of counter examples HOT 13
- simplify: impossible, because of the structure of linearise HOT 2
- shrinking optimizations HOT 5
- Property Result in case of exceptions HOT 8
- Fix CI HOT 15
- Improve garbage-collection/cleaning-up HOT 20
- Add pretty print for CounterExample and improve test output HOT 1
- Use Dot drawing for sequential programs
- Convenient way for manually writing examples HOT 5
- Drop lts-11 and add lts-14 to Travis CI HOT 5
- Fix CI HOT 2
- New Release? HOT 3
- Use a generator to init models HOT 4
- Mock mismatch with semantics HOT 1
- Event as defined in Labelling is misleading HOT 1
- Read instance for Commands HOT 2
- Lower bound on text in latest revision 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 quickcheck-state-machine.