Comments (2)
Obviously, this doesn't account for division by zero though: it might be necessary to have some way to express that a value is non-zero in the type system, such as through dependent types.
Yeah, this was more my point. I see you've resisted the common cheat of making Zero - Succ(Zero) == Zero
, I was wondering what you have in mind to prevent zero divisions. They do feel like something a dependent type system can tackle. However, I've never seen in implemented, hence the question.
Cheers, and great work!
from tao.
For reals, division is already total. For integers, there are two options:
- Have the output type of division be
Real
(there is already precedent for this, negation on aNat
yields anInt
) - Have the output type be
(Nat, Nat)
(i.e: integer division + remainder)
I think I'd tend towards the former as the more natural option, with the latter as an independent function.
Obviously, this doesn't account for division by zero though: it might be necessary to have some way to express that a value is non-zero in the type system, such as through dependent types.
Ideas are welcome!
from tao.
Related Issues (7)
- Explain Syntax HOT 15
- License HOT 8
- Where is the code that does the parsing of the actual text? HOT 1
- Foreign function interface HOT 3
- Website link not working HOT 1
- Concatenative languages - Quark HOT 8
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 tao.