Skip to content

Commit

Permalink
locli-latex: snapshot for Arnaud
Browse files Browse the repository at this point in the history
The error messages changed, but this should convey the idea.
This may be related to haskell/aeson#1059
The commit history is still very messy, but in any event:

src/Cardano/Report.hs:341:30: error:
    • Could not deduce (ToJSON (CDFList f1 (DataDomain I SlotNo)))
        arising from a use of ‘renderAnalysisCDFs’
      from the context: (&) KnownCDF ToJSON1 f
        bound by a pattern with constructor:
                   SomeSummary :: forall (cls :: (* -> *) -> Constraint)
                                         (f :: * -> *).
                                  cls f =>
                                  Summary f -> SomeSummary cls,
                 in an equation for ‘generate'’
        at src/Cardano/Report.hs:279:21-51
      or from: KnownCDF f1
        bound by a pattern with constructor:
                   SomeBlockProp :: forall (f :: * -> *).
                                    KnownCDF f =>
                                    BlockProp f -> SomeBlockProp,
                 in an equation for ‘generate'’
        at src/Cardano/Report.hs:279:65-99
    • In the expression:
        renderAnalysisCDFs
          anchor (dFields bpFieldsControl) OfInterCDF Nothing renderConfig bp
      In an equation for ‘anomalyRendering’:
          anomalyRendering anchor
            = renderAnalysisCDFs
                anchor (dFields bpFieldsControl) OfInterCDF Nothing renderConfig bp
      In an equation for ‘generate'’:
          generate'
            baseline@(SomeSummary (summ :: Summary f), cp :: cpt,
                      SomeBlockProp (bp :: BlockProp bpt))
            rest
            = do ctx <- getReport
                          metas
                          (last restTmpls & trManifest & getComponent "cardano-node"
                             & ciVersion)
                 time <- getCurrentTime
                 _ <- pure
                        $ mkTmplEnv ctx (liftTmplRun summ)
                            $ fmap ((\ (SomeSummary ss) -> liftTmplRun ss) . fst3) rest
                 ....
            where
                resourceText = unlines resourceLines
                anomalyText = unlines anomalyLines
                forgingText = unlines forgingLines
                peersText = unlines peersLines
                ....
    |
341 |    anomalyRendering anchor = renderAnalysisCDFs anchor (dFields bpFieldsControl) OfInterCDF Nothing renderConfig bp
    |                              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

src/Cardano/Report.hs:341:30: error:
    • Could not deduce (ToJSON (f1 a))
        arising from a use of ‘renderAnalysisCDFs’
      from the context: (&) KnownCDF ToJSON1 f
        bound by a pattern with constructor:
                   SomeSummary :: forall (cls :: (* -> *) -> Constraint)
                                         (f :: * -> *).
                                  cls f =>
                                  Summary f -> SomeSummary cls,
                 in an equation for ‘generate'’
        at src/Cardano/Report.hs:279:21-51
      or from: KnownCDF f1
        bound by a pattern with constructor:
                   SomeBlockProp :: forall (f :: * -> *).
                                    KnownCDF f =>
                                    BlockProp f -> SomeBlockProp,
                 in an equation for ‘generate'’
        at src/Cardano/Report.hs:279:65-99
      or from: ToJSON a
        bound by a quantified context at src/Cardano/Report.hs:1:1
    • In the expression:
        renderAnalysisCDFs
          anchor (dFields bpFieldsControl) OfInterCDF Nothing renderConfig bp
      In an equation for ‘anomalyRendering’:
          anomalyRendering anchor
            = renderAnalysisCDFs
                anchor (dFields bpFieldsControl) OfInterCDF Nothing renderConfig bp
      In an equation for ‘generate'’:
          generate'
            baseline@(SomeSummary (summ :: Summary f), cp :: cpt,
                      SomeBlockProp (bp :: BlockProp bpt))
            rest
            = do ctx <- getReport
                          metas
                          (last restTmpls & trManifest & getComponent "cardano-node"
                             & ciVersion)
                 time <- getCurrentTime
                 _ <- pure
                        $ mkTmplEnv ctx (liftTmplRun summ)
                            $ fmap ((\ (SomeSummary ss) -> liftTmplRun ss) . fst3) rest
                 ....
            where
                resourceText = unlines resourceLines
                anomalyText = unlines anomalyLines
                forgingText = unlines forgingLines
                peersText = unlines peersLines
                ....
    |
341 |    anomalyRendering anchor = renderAnalysisCDFs anchor (dFields bpFieldsControl) OfInterCDF Nothing renderConfig bp
    |                              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Error: cabal: Failed to build locli-1.34 (which is required by exe:locli from
locli-1.34).
  • Loading branch information
NadiaYvette committed Mar 5, 2024
1 parent 2b8804f commit 8f8c69e
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 8 deletions.
18 changes: 14 additions & 4 deletions bench/locli/src/Cardano/Util.hs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{-# LANGUAGE CPP #-}
{-# LANGUAGE DeriveAnyClass #-}
{-# LANGUAGE DeriveFunctor #-}
{-# LANGUAGE DerivingStrategies #-}
{-# LANGUAGE GeneralisedNewtypeDeriving #-}
{-# OPTIONS_GHC -Wno-orphans #-}
{-# OPTIONS_GHC -Wno-incomplete-patterns #-}
Expand Down Expand Up @@ -72,17 +73,26 @@ import Ouroboros.Consensus.Util.Time
import Cardano.Ledger.BaseTypes (StrictMaybe (..), fromSMaybe)


deriving instance Generic1 I
deriving newtype instance FromJSON a => (FromJSON (I a))
deriving anyclass instance FromJSON1 I
deriving newtype instance ToJSON a => (ToJSON (I a))
deriving anyclass instance ToJSON1 I

-- * Data.IntervalMap.FingerTree.Interval
--
deriving instance Generic1 Interval
deriving instance FromJSON a => FromJSON (Interval a)
deriving instance FromJSON1 Interval
-- deriving instance AE.GFromJSON AE.One Interval
-- deriving instance AE.GToJSON' Value AE.One Interval
instance FromJSON a => FromJSON (Interval a) where
parseJSON = AE.genericParseJSON AE.defaultOptions
instance FromJSON1 Interval where
liftParseJSON = AE.genericLiftParseJSON AE.defaultOptions
deriving instance Functor Interval
deriving instance ToJSON a => ToJSON (Interval a)
deriving instance ToJSON1 Interval
instance ToJSON a => ToJSON (Interval a) where
toJSON = AE.genericToJSON AE.defaultOptions
instance ToJSON1 Interval where
liftToJSON = AE.genericLiftToJSON AE.defaultOptions
deriving instance NFData a => NFData (Interval a)

unionIntv, intersectIntv :: Ord a => [Interval a] -> Interval a
Expand Down
19 changes: 15 additions & 4 deletions bench/locli/src/Data/DataDomain.hs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{-# LANGUAGE DeriveAnyClass #-}
{-# LANGUAGE DeriveFunctor #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE QuantifiedConstraints #-}
{-# LANGUAGE UndecidableInstances #-}
{-# OPTIONS_GHC -Wno-orphans -Wno-partial-fields #-}
Expand All @@ -11,6 +12,7 @@ where
import Cardano.Prelude

import Witherable qualified as Wither
-- import Data.Aeson qualified as AE
import Data.List.NonEmpty qualified as NE

import Cardano.Util
Expand All @@ -32,10 +34,19 @@ deriving instance (forall b. FromJSON b => FromJSON (f b), FromJSON a) => From
deriving instance (forall b. ToJSON b => ToJSON (f b), ToJSON a) => ToJSON (DataDomain f a)
deriving instance (forall b. NFData b => NFData (f b), NFData a) => NFData (DataDomain f a)
deriving instance (forall b. Show b => Show (f b), Show a) => Show (DataDomain f a)
deriving instance (forall a. FromJSON a => FromJSON (f a), FromJSON1 f) => FromJSON1 (DataDomain f)
deriving instance FromJSON1 f => FromJSON1 (DataDomain f)
deriving instance (forall a. ToJSON a => ToJSON (f a), ToJSON1 f) => ToJSON1 (DataDomain f)
deriving instance ToJSON1 f => ToJSON1 (DataDomain f)

-- instance {-# OVERLAPPABLE #-} (forall a. FromJSON a => FromJSON (f a)) => FromJSON1 (DataDomain f) where
-- liftParseJSON = AE.genericLiftParseJSON AE.defaultOptions
-- deriving instance {-# OVERLAPPABLE #-} FromJSON1 f => FromJSON1 (DataDomain f)

-- instance {-# OVERLAPPABLE #-} (forall a. ToJSON a => ToJSON (f a)) => ToJSON1 (DataDomain f) where
-- liftToJSON = AE.genericLiftToJSON AE.defaultOptions
-- deriving instance {-# OVERLAPPABLE #-} ToJSON1 f => ToJSON1 (DataDomain f)

-- instance {-# OVERLAPPABLE #-} (FromJSON1 f, FromJSON a) => FromJSON (f a) where
-- parseJSON = AE.parseJSON1
-- instance {-# OVERLAPPABLE #-} (ToJSON1 f, ToJSON a) => ToJSON (f a) where
-- toJSON = AE.toJSON1

-- | Key decision of DataDomain merging policy.
data DataDomainComb
Expand Down

0 comments on commit 8f8c69e

Please sign in to comment.