Skip to content
Snippets Groups Projects
Commit e210397e authored by beekmannju85374's avatar beekmannju85374 :writing_hand:
Browse files

Merge branch 'master' into 'main'

cleaned up saveToFile

See merge request !15
parents 15d08055 6e7f438e
No related branches found
No related tags found
1 merge request!15cleaned up saveToFile
......@@ -105,14 +105,13 @@ generateSchedules rooms startDay endDay professors = groups
saveToFile :: [[Presentation]] -> FilePath -> IO ()
saveToFile presentations filename = do
let content = init . unlines $ map (unlines . map detailedPrint) presentations -- init removes the trailing \n
writeFile filename content
let str = init . unlines $ map (unlines . map detailedPrint) presentations -- init removes the trailing \n
writeFile filename str
loadFromFile :: FilePath -> IO [[Presentation]]
loadFromFile filename = do
content <- readFile filename
let presentations = map (map read . lines) (splitOn "\n\n" content)
return presentations
str <- readFile filename
return $ map (map read . lines) (splitOn "\n\n" str)
-- a presentationgroup should have 3 to 5 projects each
......
No preview for this file type
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment