Skip to content

Commit

Permalink
Ideas
Browse files Browse the repository at this point in the history
  • Loading branch information
ivanjermakov committed Nov 22, 2024
1 parent 9e9ade9 commit 2d32340
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 6 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
## Taste of Nois

```rust
use std::{ math::pi, iter::MapAdapter }
use std::math

trait Area {
area = fn(self): Float
Expand All @@ -26,7 +26,7 @@ impl Area for Shape {
area = fn(self): Float {
match self {
Rect(width, height) { width * height }
Circle(radius) { pi * radius ^ 2. }
Circle(radius) { math::pi * radius ^ 2. }
}
}
}
Expand Down
13 changes: 9 additions & 4 deletions ideas.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
- Block is a valid expression
- std::test
- noisdoc
Documentation testing: https://doc.rust-lang.org/rust-by-example/testing/doc_testing.html
- Explicit type args on constructors Option<Int>::Some(value: 5)
Requires changes to the parser
documentation testing: https://doc.rust-lang.org/rust-by-example/testing/doc_testing.html
- orphan instances: https://wiki.haskell.org/index.php?title=Orphan_instance
should impls be allowed only when at least one of (A, B) (in impl A for B) is defined in the current package?
possible solutions:
* disallow, throw error when detected in impl definition
* allow, throw error when two dependency packages provide conflicting impls
* allow, give an interface to prioritize one conflicting impl over another
* allow, make orphan impls local to the current package
- causes coherence problems: https://xnning.github.io/papers/coherence-class.pdf

0 comments on commit 2d32340

Please sign in to comment.