Comments (9)
The problem with the 'see if you get the warning' is it varies strongly by build plan, and for the other, unplanned for build failures not blocked by version bounds are even worse. I
Again, the things up to free
have the lower bounds of their dependencies (mostly) so high that said dependencies are using -Wmissing-safe-haskell-mode
, or at least explicitly mention in the changelog that they are Safe
/ Trustworthy
. E.g. https://hackage.haskell.org/package/comonad-5.0.8/changelog
5.0.8 [2020.12.30]
- Explicitly mark modules as Safe or Trustworthy.
I don't see this problem much different than having explicit type-signatures or not. Bindings (modules) can change types (safedness) if other things (modules) change types (safedness), it's a good practice to add type-annotations (safe/trustworthy/unsafe annotations). IMO having an explicit declaration everywhere is a way to forward. Safe-inferred was a mistake, the paper introducing it as ones who don't use, don't need to care is just wrong, as the experience shows.
mtl
has been explicitly safe since long enough, and I hope this doesn't change.
from mtl.
Yet another safe-haskell footgun.. and folks wonder why I stopped even bothering to try to handle it.
The only way I know to safely handle safe haskell is to explicitly mark a module as Trustworthy and then forcibly import a module marked Unsafe.
That is literally the only way to get into a known state.
Everything else leads to errors and warnings as upstream packages change their trustworthiness level. It also seems directly contra the intent of the feature and risks masking any transitive leaks of unsafety.
from mtl.
The only way I know to safely handle safe haskell is to explicitly mark a module as Trustworthy and then forcibly import a module marked Unsafe.
It's not the only way.
GHC-9 has -Winferred-safe-imports
warning, so you can mark your modules as Safe and see if you get that warning and complain to the upstream. (EDIT: there is also -Wmissing-safe-haskell-mode
which is "you forgot a safety definition for your module")
That is what I did/used to the part of kmettverse up to free
IIRC, it's all explicitly Safe
(or Trustworthy
if cannot do better)
So if this issue is not fixed, when free
is updated to allow mtl-2.3
, recent GHCs will complain.
from mtl.
The problem with the 'see if you get the warning' is it varies strongly by build plan, and for the other, unplanned for build failures not blocked by version bounds are even worse. I still just want a "This module locally is at least Trustworthy and if you can infer it safe, do so and stop bothering me or all my users" flag. I've asked for it ever since safe haskell was introduced and just stopped screaming into the void, because nobody was listening.
from mtl.
IIRC, the best approach I have at present is
if impl(ghc>=8.0)
ghc-options: -Wno-trustworthy-safe
and then just putting Trustworthy wherever I want to mark the module itself as behaving as safe. This is my best notion of "TrustworthyOrBetter".
I just keep forgetting this works, because it is such an asinine way to have to solve the problem.
from mtl.
It also has the unfortunate side-effect of greatly enlarging the trusted codebase whenever I have to use it.
from mtl.
I hear you. I'm probably just grumbly that given DerivingVia
's recent change in status I expect I'm going to be rejiggering a lot of these annotations on any decently fresh code I've written, yet again, for all of the 2 users of SafeHaskell that exist.
from mtl.
@ekmett join the choir at https://gitlab.haskell.org/ghc/ghc/-/issues/19605 (or and other Safe Haskell + coerce issues.
But TBH, another direction is just abandon Safe Haskell, Data.Coerce
is way too useful to not be used. The two Safe Haskell users could cry to GHC developers. (I haven't ever met any end-user).
from mtl.
Resolved by #111.
from mtl.
Related Issues (20)
- README inaccurately mentions Control.Monad.Error Control.Monad.Except HOT 2
- "Since" information for `MonadFail` instances missing (haddock, CHANGELOG)
- Add release dates to CHANGELOG HOT 1
- Changelog for mtl-2.3 doesn't mention removal of re-export of several modules
- mtl 3.0 planning HOT 12
- `mtl-2.3` dropped `ExceptT` HOT 15
- `mtl-2.3` needs a migration guide for removal of re-exports HOT 3
- Redundant constraint Monoid w in GHC 9.4 build HOT 1
- Tag for `mtl-2.3` HOT 7
- FYI: A paper on how Hackage packages use `mtl`.
- Why not use rank 2 polymorphism for `callCC` HOT 2
- Make MonadCont instance for ContT polykinded HOT 2
- how can i help with a 2.3.1 release or the like? HOT 1
- Build error against transformers-0.6 with GHC-9.0 HOT 13
- Conversions between lazy and strict StateT
- LiftingState
- Request: Export runWriterT from Writer.CPS
- How to combine two different `r` `MonadReaders` ? HOT 1
- Windows CI Fails
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 mtl.