Skip to content

Commit

Permalink
fixes for GHC 9.6
Browse files Browse the repository at this point in the history
  • Loading branch information
danmatichuk committed Feb 5, 2024
1 parent 373ccaa commit 2b8e0ba
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions src/Pate/TraceTree.hs
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ import qualified Control.Monad.Reader as CMR
import qualified Control.Monad.Trans as CMT
import Control.Monad.Except
import Control.Monad.Catch
import Control.Monad (void)
import Control.Monad (void, unless, forM) -- GHC 9.6
import Control.Applicative

import qualified Prettyprinter as PP
Expand Down Expand Up @@ -377,13 +377,14 @@ resolveQuery (NodeQuery (q_outer:qs_outer) fin_outer) t_outer =
-- we need to reverse it here so the indices match up
fmap catMaybes $ forM (zip [0..] (reverse nodes')) $ \(i,(SomeTraceNode (nm :: SymbolRepr nm) lbl v, t)) -> do
Just pp <- return $ getNodePrinter @k @nm [Simplified]
let ret = return $ Just $ (QueryStringInt i (show (pp lbl v)), SomeTraceNode nm lbl v,t)
case q of
QueryInt i' | i == i' -> ret
QueryString s | isPrefixOf s (show (pp lbl v)) -> ret
QueryStringInt i' s | i == i', isPrefixOf s (show (pp lbl v)) -> ret
QueryAny -> ret
_ -> return Nothing
let matched = case q of
QueryInt i' -> i == i'
QueryString s -> isPrefixOf s (show (pp lbl v))
QueryStringInt i' s -> i == i' && isPrefixOf s (show (pp lbl v))
QueryAny -> True
case matched of
True -> return $ Just $ (QueryStringInt i (show (pp lbl v)), SomeTraceNode nm lbl v,t)
False -> return Nothing

data InteractionMode =
Interactive (IO ChoiceIdent)
Expand Down

0 comments on commit 2b8e0ba

Please sign in to comment.