Skip to content

Conversation

@ana-pantilie
Copy link
Contributor

Part of #1037


Reviewer checklist
  • Test coverage: stack test --coverage
  • Public API documentation: stack haddock

@ana-pantilie ana-pantilie marked this pull request as ready for review September 11, 2020 18:17
Copy link
Contributor

@ttuegel ttuegel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you also remove MultiOr.extractPatterns and replace it with toList? It seems weird to have a function extractPatterns for MultiOr, when the thing inside the MultiOr might not be a pattern at all.

Comment on lines 383 to 391
traverseLogic
:: Ord child2
=> TopBottom child2
=> Monad m
=> (child1 -> m child2)
-> MultiOr child1
-> m (MultiOr child2)
traverseLogic f multiOr = observeAllT $ Logic.scatter multiOr >>= lift . f
{-# INLINE traverseLogic #-}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do we need this? It seems exactly the same as traverse.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I didn't end up using it, but left it in case anyone would want to run effects with LogicT instead of using the traverse instance on lists.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But, there's no reason to do that. The only reason to use LogicT is if you want to run multiple traversals in sequence and build up the results lazily. There's no reason to use LogicT here because we immediately call observeAllT.

By the way, I just remembered: traverse should have a prominent warning that it should not be used with LogicT.

@ana-pantilie ana-pantilie merged commit a65726e into runtimeverification:master Sep 16, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants