Comments (19)
The Solo
constructor has been renamed to MkSolo
in 9.6 to avoid punning.
For backwards compatibility, there's a Solo
pattern synonym. But pattern synonyms don't support linearity at the moment.
I'm not sure how to solve this, other than patching the code to use MkSolo.
from linear-base.
@aspiwack I think it's pretty unfriendly to tie people to one compiler version, or to anything Stack related.
from linear-base.
I try to avoid CPP pretty much like the plague. We have been using a cabal-based solution. See
Lines 121 to 125 in a899377
from linear-base.
@Lysxia , @guibou I've released the fix on Hackage as v0.3.1.
from linear-base.
That's very strange. Any idea what might have changed? Solo x
is surely linear, no?
from linear-base.
I think it worked with 9.6.0 alpha1, so that would narrow the possible cause. But I'm not familiar with the linear type implementation beyond that.
from linear-base.
Have you opened a GHC ticket?
from linear-base.
Damn @monoidal you beat me by a few seconds! The offending commit is 2463df2fe21b5b37ecada3df8c6726c534d24590. @tek you broke my library!
from linear-base.
@monoidal Good lort. Did they also break everything in Data.Semigroup
and Data.Monoid
and Data.Functor.Compose
and even Control.Applicative
?
from linear-base.
In theory I would prefer always supporting one version of GHC that is on Stackage. That being said, we can consider moving master to only supporting 9.6 and make a release for that. Otherwise we have a bit of infrastructure for version-dependent definitions. Maybe that's the best way to go, it's cheap, and conservative.
from linear-base.
@treeowl Pretty much every use of the Solo
data constructor in linear-base
breaks in 9.6, because it now refers to the non-linear pattern synonym. GHC's base
and related modules are unaffected since they don't expose linear functions or rely on them.
Fortunately the nonpunning list/tuple proposal introduces a pattern for MkSolo
only, so higher tuples will not be affected.
from linear-base.
@monoidal I'm just wondering about other base
types that are traditionally punned, like Const
, First
, and Compose
.
from linear-base.
Apologies, I misunderstood your question. Only Solo
was renamed. If the other types are renamed to avoid punning, they'll also pose a problem.
I'm less worried about that though. For tuples, there was pressure to remove punning because they have special syntax and they are used often (Solo
was done for consistency). For other types, the renaming is not that urgent - even if GHC gets dependent types, it'll have to support punning anyway.
from linear-base.
That's a relief. While I admit it makes sense, I've never been a big fan of the MkName
convention. I believe I first saw it in Idris 1; do you happen to know where it came from originally, or how it reached Haskell?
from linear-base.
I don't know the original source. The first GHC commit from 1996 already defines data TCE = MkTCE (UniqFM TyCon)
.
from linear-base.
This seems easy to fix while remaining compatible with old GHCs.
Otherwise we have a bit of infrastructure for version-dependent definitions.
I don't know about what infrastructure you already have, but just to give a concrete solution, I'm partial to CPP:
#if __GLASGOW_HASKELL__ < 906
#define MkSolo Solo
#endif
from linear-base.
I try to avoid CPP pretty much like the plague.
Out of curiosity, is the rationale documented somewhere?
from linear-base.
There's a Tweag blogpost: https://www.tweag.io/blog/2019-06-27-cpp-considered-harmful/
from linear-base.
I've made a very quick shim at #438 . I… uh… only need to test it with 9.6…
from linear-base.
Related Issues (20)
- Provide Ormolu via Nix HOT 6
- `linear-base` has a `streaming`-style `Stream` type. Should it have a `streaming-bytestring` style `ByteStream`? HOT 1
- Dispose with side effects HOT 9
- 0.3.1 doesn't build with GHC 9.0 HOT 3
- [Doc question] Definition of linear HOT 3
- Movable for amortized structures HOT 11
- Question: unrestricted list functions HOT 1
- Eq and Ord classes don't seem very useful HOT 3
- We're broken on master (929161943f19) HOT 7
- Remove cycle and repeat from Data.List.Linear HOT 11
- Add one or more queue/steque types HOT 5
- More natural takeWhile analogue? HOT 2
- Lazy tuple workaround HOT 6
- Lens won't work as expected due to the missing `Functor (FUN 'One a)` instance (both `Data` and `Control`) HOT 3
- How ready is Linear Haskell for real world use cases? HOT 3
- linear-base-0.1.0 build failure with GHC 9.8 HOT 7
- Word does not have instances for the Data.Num.Linear typeclasses HOT 2
- Pull array index isn't safe HOT 2
- &, T tensor HOT 10
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 linear-base.