Created
May 7, 2013 19:03
-
-
Save Tener/5535184 to your computer and use it in GitHub Desktop.
Haskell datatype for holding any type implementing a typeclass
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{-# LANGUAGE GADTs #-} | |
module Main where | |
import Prelude hiding (print, putStr, putStrLn) | |
import GenericGameExperiments | |
import GenericGame | |
import AgentGeneric | |
import ThreadLocal | |
import Data.List(tails) | |
data Ag where Ag :: (Agent2 a) => a -> Ag | |
main :: IO () | |
main = runThrLocMainIO $ do | |
agRnd <- mkAgent () :: IO AgentRandom | |
agMTCs <- mapM (\ d -> mkTimed ("mtcs_" ++ show d) d :: IO (AgentTrace AgentMCTS)) [5,10,15,30,100,1000] | |
let agents = ((Ag agRnd) : (map Ag agMTCs)) | |
sequence_ [do | |
printTL (agentName ag1, agentName ag2) | |
reportWin ag1 ag2 P1 | |
| ((Ag ag1):ag'rest) <- tails agents, (Ag ag2) <- ag'rest] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment