implemented getPositions

This commit is contained in:
Jonathan Lamothe committed 2020-02-11 23:37:43 -05:00
1 parent a80eaa2a40
commit 457298e565
3 files changed
+56

No files matched your search

+10
View File
@@ -23,8 +23,12 @@ module Mtlstats.Helpers.Position
( posSearch
, posSearchExact
, posCallback
, getPositions
) where
import qualified Data.Set as S
import Lens.Micro ((^.))
import Mtlstats.Types
-- | Searches the 'Database' for all the positions used
@@ -57,3 +61,9 @@ posCallback
-> Action ()
-- ^ The action to perform
posCallback = undefined
-- | Extracts a list of positions from a 'Database'
getPositions :: Database -> [String]
getPositions = do
raw <- map (^.pPosition) . (^.dbPlayers)
return $ S.toList $ S.fromList raw