module RPGEngine.Parse ( parse ) where import RPGEngine.Data ( Game ) import RPGEngine.Parse.StructureToGame ( structureToGame ) import GHC.IO (unsafePerformIO) import Text.Parsec.String (parseFromFile) import RPGEngine.Parse.TextToStructure ( gameFile ) ------------------------------ Exported ------------------------------ parse :: FilePath -> Game parse filename = structureToGame struct where (Right struct) = unsafePerformIO io io = parseFromFile gameFile filename