-
Notifications
You must be signed in to change notification settings - Fork 30
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Mapping over PairRDD using Tuple2 results in GHC bug - makeStatic #119
Comments
Yes, that's right. I got hit myself by this earlier last week. If you'd like to push your change as a PR, I can cut a new point release pronto. Thanks for the bug report! FWIW, GHC 8.4 should have much better diagnostics. |
I should clarify - in my case it was a missing |
Fixes tweag#119 This is caused by https://ghc.haskell.org/trac/ghc/ticket/14204 + withStatic TH macro used to create instances in PairRDD module. The bug results in `static` being allowed to be used with Tuple2 constructor without a compile-time error, which instead leads to a run-time one. For example, swapPair :: Tuple2 a b -> Tuple2 b a swapPair (Tuple2 a b) = Tuple2 b a mapSwap :: ( Static (Reify a), Static (Reify b) , Static (Reflect a), Static (Reflect b) , Typeable a, Typeable b) => PairRDD a b -> IO (PairRDD b a) mapSwap rdd = PairRDD.fromRDD =<< RDD.map (closure (static swapPair)) =<< PairRDD.toRDD rdd fails with sparkle-worker: GHC bug - makeStatic: Unresolved static form at line 107, column 1. CallStack (from HasCallStack): error, called at libraries/base/GHC/StaticPtr/Internal.hs:26:5 in base:GHC.StaticPtr.Internal
Thanks, I opened a PR. There's no rush to make a new release – I'm fine using Git version, plus I have more changes coming. |
When trying to map a function that swaps
Tuple2
members over aPairRDD a b
to getPairRDD b a
, I'm seeing this:Here's a minimal example: MailOnline@4191d4f
If I add
StaticPointers
pragma toPairRDD
module, it works as expected (MailOnline@6708a2a). Any ideas as to what is exactly happening here? Is this a combination of https://ghc.haskell.org/trac/ghc/ticket/14204 +withStatic
inPairRDD
?The text was updated successfully, but these errors were encountered: