Permalink
Browse files

Moved sortOn to Utils

  • Loading branch information...
1 parent b1e58c7 commit 37029794ec9e50664ef2faf45f17bc8baeb30502 @MedeaMelana committed Nov 8, 2012
Showing with 5 additions and 5 deletions.
  1. +0 −5 Engine.hs
  2. +5 −0 Utils.hs
View
@@ -15,10 +15,8 @@ import Control.Applicative ((<$>))
import Control.Monad (forever, forM_, replicateM_, when)
import Control.Monad.Trans (lift)
import Control.Monad.Writer (tell, execWriterT)
-import Data.Ord (comparing)
import Data.Label.Pure (get, set)
import Data.Label.PureM (gets, (=:))
-import Data.List (sortBy)
import Data.Maybe (catMaybes)
import Data.Traversable (for)
@@ -171,9 +169,6 @@ executeStep (EndPhase CleanupStep) = do
-sortOn :: Ord b => (a -> b) -> [a] -> [a]
-sortOn = sortBy . comparing
-
offerPriority :: Engine ()
offerPriority = do
-- TODO do this in a loop
View
@@ -8,7 +8,9 @@ import Types
import Control.Monad.State (State, execState)
import Data.Label.Pure
+import Data.List (sortBy)
import Data.Monoid
+import Data.Ord (comparing)
import Data.Set (Set)
import qualified Data.Set as Set
@@ -113,3 +115,6 @@ countCountersOfType ty o = length (filter (== ty) (get counters o))
willMoveToGraveyard :: Id -> Object -> OneShotEffect
willMoveToGraveyard i o = WillMoveObject (Battlefield, i) (Graveyard (get owner o)) o
+
+sortOn :: Ord b => (a -> b) -> [a] -> [a]
+sortOn = sortBy . comparing

0 comments on commit 3702979

Please sign in to comment.