!       !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~      !"#$%&'()*+,-./01234 5 6 7 8 9 : ; < = > ? @ A B C D E F G H I J K L M N O P Q R S T U VWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~ SafeU    None777dovinjA phase or step in a turn. Phases and steps are not distinguished between because haven't seen a need to.JdovinTarget a player, use ` to construct.KdovinTarget a card, use a to construct.$"! #%&'()*+6543210/.-,7DCBA@?>=<;:98EFGHIKJLMPONQWVUTSRXYZ\[]^_`abtuvwxyz{|}~^]Z\[YXQWVUTSRLMPON_IKJ`aHGEF7DCBA@?>=<;:98*+6543210/.-,()&'%$"! #b{zyxwvut~}|NonemNonedovin0Return a card name suffixed by the given number.##NoneX!!None> 5 None+dovin'Perform action as the specified player.dovinAdd an attribute to the created card, as identified by a string. Attributes with that special meaning to Dovin built-ins (such as flying) are defined in Dovin.Attributes.dovinHelper version of + for adding multiple attributes at a time.dovin"Add an effect to the created card.dovin5Set the number of +1/+1 counters of the created card.dovin5Set the number of -1/-1 counters of the created card.dovinBA matcher that must apply to this card for this affect to apply.  matchInPlay is a typical value.dovinYGiven the current card, return a matcher that matches cards that this affect applies to.dovin"Apply an effect to the given card.None+dovinAdd mana to actor's mana pool.  addMana "2RG"  ValidatesMana specification is valid. EffectsMana pool is increased. dovin$Casts a card from actor's hand. See   for specification. cast "R" "Shock"  ValidatesCard exists in hand. dovinMove a card to the stack, spending the specified mana. If not tracking mana, use the empty string to cast for no mana. Typically you will want to ? after casting. For the common case of casting from hand, see  . See (- for additional mana validations and effects. 7castFromLocation "1B" "Oathsworn Vampire" >> resolveTop  ValidatesCard exists in location.$If not an instant or has flash, see . for extra validations. EffectsCard moved to top of stack.Counter  incremented if card has  or  attribute. dovinRemove a spell from the stack. counter "Shock"  ValidatesCard is on stack.-Card is not a triggered or activated ability. Effects!Card is moved to graveyard. (See  for alternate effects.) dovinNCast a card from actor's graveyard, exiling it when it leaves the stack. See   for further specification. flashback "R" "Shock"yDoes not validate whether the card actually has a flashback cost. If important, use a wrapper function in your solution: rflashbackSnapped mana castName = do validate (matchAttribute "snapcastered") castName flashback mana castName   ValidatesCard is in actor's graveyard. Effects Card gains . dovinCast a card from active player's graveyard, discarding a card in addition to its mana cost, exiling it when it leaves the stack. See   for further specification.  jumpstart "R" "Mountain" "Shock"  ValidatesCard is in actor's graveyard. Discard card is in actor's hand. Effects Card gains . Discard card moved to graveyard.dovinResolves a card on the stack. #cast "R" "Shock" >> resolve "Shock"  ValidatesStack is not empty.Card is on top of stack.EffectsSee .dovinResolves the top card of the stack. Use this for simple cast-and-resolve scenarios. For more complicated stack states, prefer = with a named spell to ensure the expected one is resolving.  ValidatesStack is not empty.Effects*If spell, move card to graveyard of owner..If permanent, move card to play area of owner.If trigger, remove card.See @ for possible alternate effects, depending on card attributes.dovinSacrifice a permanent. sacrifice "Soldier"  Validates&Permanent controlled by current actor.Permanent is in play. Effects Card is moved to graveyard. See  for possible alternate effects.dovin5Splices a spell on to a previously cast arcane spell. 5splice "Goryo's Vengeance" "2RR" "Through the Breach"  ValidatesTarget spell is arcane.Target spell is on stack.Spliced spell is in hand.See ( for additional validations. EffectsSee ( for additional effects.dovinCombination of ) and , see them for specification.dovin'Transition to a new game phase or step. transitionTo DeclareAttackers  ValidatesCThe new phase would occur after the current phase in a normal turn. EffectsEmpty the mana pool.Transition to new phase.dovinEquivalent to  except it skips all validation. Useful when an effect has modified the normal order of phases, such as adding an extra combat step.dovin>Triggers an effect of a permanent. Typically you will want to  after triggering. 0trigger "Draw Card" "Dawn of Hope" >> resolveTop  ValidatesCard is in play or graveyard.Card is cotrolled by actor. Effects A card with  is added to stack.dovin(Helper function to provide a scoped let. -with "Angel" $ \cn -> target cn >> destroy cndovin)Move a card from one location to another. ,move (Opponent, Play) (Active, Play) "Angel"  ValidatesCard exists in source location. Destination is not stack (use a   variant instead)."Destination does not match source. If card has X attribute, source is in play. (Removing token once they have left play is handled by 1.) If card has Z attribute, source is the stack. (Removing token once they have left play is handled by 1.)Effects#Card moved to destination location.NIf card is leaving play, remove all damage, counters, and gained attributes. If card has ' attribute, move to exile and remove  instead. If card has  , is moving from play to graveyard, and has no +1/+1 counters, add a +1/+1 counter instead. (Note: undying should move card to graveyard then back to play for owner, but since neither triggers nor owner tracking are implemented, this simplification is valid.)5If card is entering play or changing controller, add  attribute.dovinTarget a permanent.  ValidatesCard is in play.+If card belongs to opponent, does not have .dovin%Target a card in a non-play location.  ValidatesCard is in zone.dovin(Activate an ability of a permanent. See (J for additional mana validations and effects. Typically you will want to  after activating. ;activate "Create Soldier" "3W" "Dawn of Hope" >> resolveTop  ValidatesCard is in play or graveyard.Card is controlled by actor. Effects A card with  is added to stack.dovinJActivate a loyalty ability of a planeswalker. Typically you will want to  after activating. KactivatePlaneswalker2 "Get a card" (-1) "Karn, Scion of Urza" >> resolveTop  ValidatesCard is in play.Card has enough loyalty. EffectsCard loyalty is adjusted.See ( for additional validations and effects.dovin)Start an attack with the given creatures. "attackWith ["Fanatical Firebrand"]  ValidatesCards are in play. Cards have  attribute.Cards either have  or are missing .Cards do not have . Effects&Cards become tapped, unless they have . Cards gain  attribute.Transitions to = step.dovinApply combat damage between an attacker and blockers, using a simple damage assignment algorithm. For more complex assignments, use  directly. -combatDamage ["Spirit 1", "Spirit 2"] "Angel"See # for other validations and effects.  ValidatesAttacker has attribute ."Attacker and blockers are in play.%Attacker controlled by current actor.Blockers have attribute . EffectsgDamage is dealt to blockers in order given, with the final blocker receiving any left over damage.3If no blockers, damage is dealt to opposing player.If attacker has 8, any remaining damage is dealt to opposing player.dovin5Copy a spell on the stack, adding it to top of stack. copySpell "Snap Copy" "Snap"  ValidatesCard is on stack. EffectsNew card is on top of stack.dovin)Applies damage from a source to a target. 0damage (const 2) (targetPlayer Opponent) "Shock"  ValidatesSource exists.Damage is not less than zero.WIf targeting a card, target is in play and is either a creature or a planeswalker. EffectsAdds damage to the target.=If target is a planeswalker, remove loyalty counters instead.If source has ; and target is a creature and damage is non-zero, add  attribute to target.If source has =, controller of source gains life equal to damage dealt.Note 1P handles actual destruction (if applicable) of creatures and planeswalkers. dovinDestroy a permanent.  ValidatesCard is in play. Card is not  Effects Card is moved to graveyard. See  for possible alternate effects.!dovin-Discard a card from the active player's hand. discard "Mountain"  Validates$Card exists in active player's hand. EffectsCard moved to graveyard."dovinOExert a card. Works best when card has an associated effect that applies when  attribute is present. QwithAttributes [flying] $ withEffect (matchInPlay <> matchAttribute exerted) ( matchLocation . view cardLocation <> const (matchAttribute creature) ) (pure . over cardStrengthModifier (mkStrength (1, 1) <>)) $ addCreature (2, 2) "Tah-Crop Elite" attackWith ["Tah-Crop Elite"] exert "Tah-Crop Elite"  Validates Card has  attribute. Effects Card gains  attribute.#dovinMove a card to the Exile zone. exile "Bridge from Below"See & for validations and effects.$dovin=Have one card fight another (each deals damage to the other).  ValidatesCard is in play.Card is a creature. EffectsEach card has damage dealt to it equal to the other's power. A creature fighting itself will take twice its power in damage.Note 1> handles actual destruction (if applicable) of creatures.%dovin[Modify the strength of a card in play. It will be reset to base when the card leaves play. !modifyStrength (-2, -2) "Soldier"  ValidatesCard is in play.Card is a creature. Effects+Changes the strength modifier for the card.&dovin+Move card to location with same controller. moveTo Graveyard "Forest"  Validates Card exists.EffectsCard is moved to location.See 2 for possible alternate effects, depending on card(dovinRemove mana from the pool. Colored mana will be removed first, then extra mana of any type will be removed to match the colorless required. spendMana "2RG"  ValidatesMana specification is valid.Sufficient mana exists in pool.EffectsMana pool is reduced.)dovin Taps a card.  ValidatesCard is in play.Card is not tapped.*If creature, is not summoned or has haste. EffectsCard gains tapped attribute.*dovinUntaps a card.  ValidatesCard is in play.Card is tapped. EffectsCard loses tapped attribute.+dovin'Validate that a card matches a matcher. 8validate (matchAttribute "pirate") "Angrath's Marauders"  ValidatesCard matches matcher.,dovinqValidates that a card is no longer present in the game. Particularly helpful for checking destruction of tokens. validateRemoved "Angel"  ValidatesName does not refer to a card.-dovin1Validates that the game is in a particular phase. validatePhase BeginCombat  ValidatesGame is in the given phase..dovin,Validates that a sorcery is able to be cast.  ValidatesStack is empty.In a main phase./dovin-Validates a player has a specific life total. validateLife 0 Opponent  ValidatesPlayer life equals amount.0dovin^Pause running of state-based actions for the duration of the action, running them at the end.1dovin'Run state-based actions. These include:If a creature does not have ., and has damage exceeding toughess or  attribute, destroy it.If a card is a  and is not in play, remove it.If a card is a $ and is not on the stack, remove it.,These are run implicitly at the end of each 2H, so it's not usually needed to call this explicitly. Even then, using 0 is usually preferred.Running state-based actions can in turn trigger more state-based actions. This method loops until no more are generated, which has the potential for non-termination for pathological game states.2dovinDefine a high-level step in the proof. A proof typically consists on multiple steps. Each step is a human-readable description, then a definition of that step using actions. If a step fails, no subsequent steps will be run. 17 is implicitly called at the end of each step. Nested 2e invocations execute the nested action but have no other effects - generally they should be avoided.3dovinrBranch off a labeled alternative line. Steps inside the fork will be reported at the end of the main line output.dovinPA function that returns the amount of damage to apply, given the source card.dovinTarget to apply damage todovin Source card,      !"#$%&'()*+,-./0123,23      !"#$%&+./-,10'()* None݈456789456789 None:dovin'Validate that a card matches a matcher. 8validate "Angrath's Marauders" $ matchAttribute "pirate"  ValidatesCard matches matcher.;dovin-Validates a player has a specific life total. validateLife Opponent 0  ValidatesPlayer life equals amount.<dovin%Set the location of the created card.# !"$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abtuvwxyz{|}~      !"#$%&'()*,-.012456789:;<=><      !"#$%&'()*,-.012:;<=>None# !"$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abtuvwxyz{|}~      !"#$%&'()*+,-./01234567945679None# !"$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abtuvwxyz{|}~      !"#$%&'()*+,-./012345679 Safe4 None ?@ABCDEFGHIJ ?@ABCDEFGHIJ None!KLMNOPQRKLMNOPQR NoneSTUSTUNoneVWXVWXNone3YZ[YZ[None\]\]None^_`^_`NoneababNone[cdecdeNonefgfgNonehijhijNone=klmklmNonenopqnopqNonersturstuNone7vwxyzvwxyzNone{|}~{|}~NoneNoneQNone!"#!"$!%&!'()*+,-.,/0,12,13,45,46,47,48)*9:;<<=>?@AABCDEEFGHIJKLMNOOPPQQRSTUVWXYZ[\]^_`abcdefghijkklmnopqqrstuvwxyz{|}~      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVW X Y Z [ W \ O S ) > 9 ] ^ _ ` a b c d e f g h i j ] k l ^ m ` ] ^ `]`n]o`]`]p`]`]`q]`]^`]^`r]^`s]^`]`t^uu]^`vw]x`yz{]^`| } ~       dovin-0.2-HHudJj4CZoe4sQpz8kZiIS Dovin.Prelude Dovin.Types Dovin.MonadDovin.Attributes Dovin.HelpersDovin.Formatting Dovin.Builder Dovin.Actions Dovin.DumpDovin.V1Solutions.ChannelFireballSolutions.Core19_9Solutions.Dominaria5Solutions.Example"Solutions.ExplorersOfIxalanContestSolutions.GuildsOfRavnica1Solutions.GuildsOfRavnica3Solutions.GuildsOfRavnica8Solutions.GuildsOfRavnica9Solutions.GuildsOfRavnicaPre2Solutions.RavnicaAllegiance3Solutions.RavnicaAllegiance4Solutions.RavnicaAllegiance5Solutions.RavnicaAllegiance7Solutions.RavnicaAllegiancePre2Solutions.RivalsOfIxalan7Solutions.UltimateMastersSolutions.WarOfTheSpark2 SolutionsDovin.V2Dovin Paths_dovinbase Control.MonadunlessfoldM Data.FoldableforM_GHC.Basewhen mtl-2.2.2Control.Monad.Error.Class throwError"lens-4.17.1-GjSMQ2I3MoU63aIbR3DWuiControl.Lens.AtatControl.Lens.IsononControl.Lens.GetteruseviewControl.Lens.Setter modifyingassignsetover catchError Formatter GameMonadStep_stepId _stepLabel _stepStateStepIdentifierEnv _envTemplate_envSBAEnabled _envActorBoard_cards_stack_deck _counters_life _manaPool_phase _currentStep EffectName CardMatcherBaseCardCard _cardName _location_cardDefaultAttributes_cardAttributes _cardStrength_cardStrengthModifier _cardDamage _cardLoyalty _cardEffects_cardPlusOneCounters_cardMinusOneCountersPhaseUntapUpkeepDrawStep FirstMain BeginCombatDeclareAttackersDeclareBlockersFirstStrikeDamage CombatDamage EndCombat SecondMainEndStepWon CardStrengthCardAttributes CardLocationTarget TargetPlayer TargetCard CardEffect_effectEnabled _effectFilter _effectActionLocationHand GraveyardPlayStackExileDeck ManaStringManaPoolPlayerActiveOpponent CardAttributeCardNamemkEffect targetPlayer targetCard incrementStep$fHashablePlayer$fShowCardStrength$fEqCard $fShowCard $fShowPlayer $fEqPlayer$fGenericPlayer $fOrdPlayer$fShowLocation $fEqLocation $fOrdLocation$fEqCardStrength $fShowPhase $fEqPhase $fOrdPhase$fShowBaseCard $fEqBaseCardcardscounters currentStepdecklifemanaPoolphasestackcardAttributes cardDamagecardDefaultAttributes cardEffects cardLoyaltycardMinusOneCounterscardNamecardPlusOneCounters cardStrengthcardStrengthModifierlocation effectAction effectEnabled effectFilterenvActor envSBAEnabled envTemplatestepId stepLabel stepStatestepFork stepNumbermkStep cardLocation cardOwner cardPower cardToughness manaPoolFor_manaPoolForTypingemptyEnv mkStrength emptyCardmkCardopposing emptyBoard$fMonoidCardStrength$fSemigroupCardStrength$fMonoidCardMatcher$fSemigroupCardMatcher$fShowCardMatcherrunMonad execMonadnumbered activatedarcane attackingauraartifactcopycreature deathtouch deathtoucheddefender doublestrike enchantmentexertedexileWhenLeaveStack firststrikeflashflyinghasteindestructibleinstanthexproofland legendarylifelink planeswalkersorcerystormsummonedundyingtappedtokentrample triggered vigilanceapplyMatcherWithDesc hasAttributemanaSpec parseMana requireCard applyEffectsallCardsmodifyCardDeprecated modifyCard matchDamage matchLoyaltymatchPlusOneCountersmatchMinusOneCounters matchLocation matchInPlaymatchAttributematchAttributes matchNamematchOtherCreaturesmatchControllermatchLesserPowermatchToughnessmissingAttributematchOrinvert labelMatch applyMatcher loseAttributeremoveAttribute gainAttribute setAttributeforCards gameFinished FormatMonadblankFormatterattributeFormatterstackFormatter cardFormatter formatCards formatCardboardFormatter attribute countLife countValue countCards countManaPooladdCardaddAura addArtifact addCreatureaddPlaneswalkeraddEnchantment addInstantaddLandaddLands addSorceryas withAttributewithAttributes withEffect withLocationwithPlusOneCounterswithMinusOneCountersaddManacastcastFromLocationcounter flashback jumpstartresolve resolveTop sacrificesplice tapForMana transitionTotransitionToForcedtriggerwithmovetargettargetInLocationactivateactivatePlaneswalker attackWith combatDamage copySpelldamagedestroydiscardexertexilefightmodifyStrengthmoveToremove spendManatapuntapvalidatevalidateRemoved validatePhasevalidateCanCastSorcery validateLifewithStateBasedActionsrunStateBasedActionsstepfork triggerMentorgainLifeloseLifesetLiferunsolution attributesplayExLandFormatter formatter spellCounterhighTideCounteraetherfluxTriggerNamesnapped withTriggerstapForManaWithTideresolveAetherfluxflashbackSnapped spellCountcastWithTriggersmatchPowerstonesmatchArtifactMana manaSources manaFormatterdamageFormatter whenMatch triggerStormtapWithFreyalise unblockableresolveHarpyTriggerblockedcopyAttributessacrificeToAltar manaAttribute oldFormatterdinosaurtrickedallversion getBinDir getLibDir getDynLibDir getDataDir getLibexecDir getSysconfDirgetDataFileName