monad-bayes icon indicating copy to clipboard operation
monad-bayes copied to clipboard

DerivingVia

Open reubenharry opened this issue 2 years ago • 1 comments

Use DerivingVia to avoid repetition of lifting instances in Class.hs.

reubenharry avatar Sep 13 '22 13:09 reubenharry

Got a bit of a scary bug:

instance MonadSample m => MonadSample (Id m) where
  type Real (Id m) = Real m
  random = lift random

deriving via Id m instance MonadSample m => MonadSample (IdentityT m)

" /Users/reubencohn-gordon/Dropbox/Reuben/Programming/monad-bayes/src/Control/Monad/Bayes/Class.hs:359:40: error:ghc-9.2.2: panic! (the 'impossible' happened) (GHC version 9.2.2: No skolem info: [k_aY7N] Call stack: CallStack (from HasCallStack): callStackDoc, called at compiler/GHC/Utils/Panic.hs:181:37 in ghc:GHC.Utils.Panic pprPanic, called at compiler/GHC/Tc/Errors.hs:2912:17 in ghc:GHC.Tc.Errors

Please report this as a GHC bug: https://www.haskell.org/ghc/reportabug "

reubenharry avatar Sep 14 '22 03:09 reubenharry