From 6527a9d5d61f0396b9396f8e8f962d9180109605 Mon Sep 17 00:00:00 2001 From: Eitan Chatav Date: Mon, 15 Jan 2024 03:05:00 -0800 Subject: [PATCH] printDVD --- src/Control/Monad/Trans/Indexed/Free.hs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/Control/Monad/Trans/Indexed/Free.hs b/src/Control/Monad/Trans/Indexed/Free.hs index f03ef23..893fe93 100644 --- a/src/Control/Monad/Trans/Indexed/Free.hs +++ b/src/Control/Monad/Trans/Indexed/Free.hs @@ -68,6 +68,15 @@ swap dvd = Indexed.do return dvd' :} +>>> import Control.Monad.Trans +>>> :{ +printDVD :: IxFree free => free (IxMap DVDCommand) 'True 'True IO () +printDVD = Indexed.do + dvd <- eject + insert dvd + lift $ putStrLn dvd +:} + -} class ( forall f. IxFunctor f => IndexedMonadTrans (free f)