Comments (11)
I propose to close this as wontfix for following reasons:
- vector exports a lot of memory unsafe functions
- History of bugs (#188, #257) shows that even safe functions aren't all that safe
- Safe extension didn't get much traction
from vector.
Yeah, I'm not wild about marking vector trustworthy.
I think what might be best is to separate out Unsafe modules, which contain unsafeFoo. Those are marked unsafe. Then the normal modules could export just the things that do bounds checking, and can be declared trustworthy.
I'm actually not a great fan of unsafeFoo vs. foo. But I guess I'll create a new ticket to talk about that issue.
from vector.
that's a great idea!
If the spec on safe haskell
on the wiki is up to date, i think Safe
inferred might be impossible without someone actually putting in the time to do a nontrivial refactoring, though TrustWorthy
might be possible
RULES: As they can change the behaviour of trusted code in unanticipated ways, violating semantic consistency they are restricted in function. Specifically any RULES defined in a module M compiled with -XSafe are dropped. RULES defined in trustworthy modules that M imports are still valid and will fire as usual.
from vector.
basically: i think the only option is marking things trusworthy, at least for the "safe" modules, because we need the rewrite rules to work
from vector.
What about specific Data.Vector.???.Safe modules, marked as Trustworthy, that only reexport safe methods?
from vector.
it probably makes the most sense to just mark vector as trust worthy wholesale. Honestly no part of vector is truly safe unless you build with bounds checks enabled :)
from vector.
But since vector export unsafe* functions it's not exactly trustworthy.
from vector.
true :)
in some sense, the only way to make it trustworthy would be to add bounds checks to all the unsafe code, right?
from vector.
I'm onboard with @Shimuuar here, for all the same reasons.
from vector.
from vector.
Closing. Anyone feel free to reopen if a new argument arises for needing this.
from vector.
Related Issues (20)
- High level documentation? HOT 1
- overlaps for Data.Vector.Mutable behaves oddly for empty vectors HOT 2
- Performance issues with `foldl'` and large tuples HOT 3
- Add a variant unfoldrExactN, returning the resulting generator HOT 3
- Vector tests take more than 4GB memory to build HOT 3
- `Data.Vector.Fusion.Bundle.Size.Size` fields are not strict HOT 1
- Why is `Data.Vector.Generic.New.New` not a newtype? HOT 2
- Question: Is there a reason why `Unbox a => Maybe (Unbox a)` doesn't exist? HOT 1
- Is `vector` susceptible to the same fusion problems as `text`? HOT 2
- Improve compilation time HOT 3
- Split generic tests into separate package HOT 5
- Tests fail when built against QuickCheck-2.14.3 HOT 2
- New version vector 0.14? HOT 11
- Support `primitive-0.9` HOT 1
- Semantics and implementation of move for SoA vectors
- API using Applicative (traverse et.al.)
- Add total counterparts to partial functions, such as `head`. HOT 25
- catMaybes HOT 2
- Add strict boxed vectors HOT 12
- Data.Vector.Generic.New.unstream (and others) can't be specialized 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 vector.