Comments (3)
yeah, not worth it. (-:
it might improve the library marginally, but i decided to not spend any more time on the idea.
thanks for the helpful feedback!
from string-conversions.
Hi. :)
I'm not 100% sure but I think this wouldn't work well in practice, because of how instances are imported (or scoped) in Haskell. So if any of your transitive dependencies imports the Unsafe
module, you'll get all the unsafe instances without importing them yourself. I think.
There could be a separate type-class for safe conversions though.
Apart from that I think that I would prefer to keep the existing behavior of Data.String.Conversions
. I'm not completely against adding a Data.String.Conversions.Safe
module that only exposes safe conversions however.
To be honest, I'm not fully convinced yet that this change is worthwhile though. Do you have a concrete example of a project where you do have ByteString
s that you are tempted to convert to either String
or Text
using cs
, but where you would opt for a safer api? Or some other concrete example that motivates this change from your perspective?
from string-conversions.
No concrete use case, I just think that if there can be an error, that should be obvious from the types. If you want to make a case for using a library in security-sensitive code, it's nice if you don't have to admit that it sometimes it eats bytes from your strings when you clearly don't want it to.
You are right though, my idea was wrong. I like the extra type class. I'll think about it some more.
from string-conversions.
Related Issues (11)
- Failed to install HOT 1
- Add travis builds HOT 1
- Monomorphic helpers for standard type conversions HOT 6
- Provide strict conversion from ByteString to Text HOT 5
- JSString support HOT 6
- How does this compare to `string-conv`? HOT 3
- Put monomorphic functions into single parameter classes HOT 1
- adding functions for explicit conversions HOT 2
- Feature request: add ByteString Builder HOT 2
- Set up CI HOT 3
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 string-conversions.