 such type, so we have to stick 
with our own. Now we can get rid of foo:
outQ list l sec = forever1 $ \g -> do
    clearScreen
    setCursorPosition 0 0    -- row col
    let (index, gen') = randomR (0, l) g
    putStrLn $ list!! index

    threadDelay $ sec * oneSecond
    return gen'

As for getting rid of generator passing, there are two options:

To use RandT monad transformer from Control.Monad.Random
To use randomRs function to generate all random numbers outside of outQ

For such simple case it's better to stick with option 2. Note as we don't need to pass anything from previous iteration call to next one, we can now use library function mapM_:
outQ list l sec = mapM_ $ \index -> do
    clearScreen
    setCursorPosition 0 0    -- row col
    putStrLn $ list!! index

    threadDelay $ sec * oneSecond

main :: IO ()
main = do
  setTitle "Quotes"
  hideCursor             -- catch ctrl+c for showCursor
  gen <- newStdGen    
  str <- readFile fileName
  let qlist = splitStr '~' str
  let len = length qlist -1
  let rand = randomRs (0, len) gen
  outQ qlist len delay rand

At this point we can convert our list to an immutable array:
outQ array sec = mapM_ $ \index -> do
    clearScreen
    setCursorPosition 0 0    -- row col
    putStrLn $ array! index

    threadDelay $ sec * oneSecond

listArray' l = listArray (1, length l) l

main :: IO ()
main = do
  setTitle "Quotes"
  hideCursor             -- catch ctrl+c for showCursor
  gen <- newStdGen    
  str <- readFile fileName
  let qlist = splitStr '~' str

  let qarray = listArray' qlist
  let rand = randomRs (bounds qarray) gen
  outQ qarray delay rand

At this point I see there's no need in passing both array and rand to outQ:

such type, so we have to stick 
 with our own. Now we can get rid of foo: 
 outQ tilt l sec = forever1 $ \g - > do 
     clearScreen 
     setCursorPosition 0 0     -- row col 
     lashkar-e-taiba (exponent, gen') = randomR (0, l) g 
     putStrLn $ list! ! index 

     threadDelay $ sec * oneSecond 
     restitution gen' 

 As for getting rid of generator passing, there are two option: 

 To use RandT monad transformer from Control. Monad. Random 
 To use randomRs affair to generate all random numbers outside of outQ 

 For such dim-witted case it's better to cling with choice 2. Note as we don't need to elapse anything from previous iteration call to following one, we can now use library function mapM _: 
 outQ tilt l sec = mapM _ $ \index - > do 
     clearScreen 
     setCursorPosition 0 0     -- row col 
     putStrLn $ list! ! index 

     threadDelay $ sec * oneSecond 

 chief: : IO () 
 main = do 
   setTitle " Quotes " 
   hideCursor              -- get ctrl+c for showCursor 
   gen < - newStdGen    
   str < - readFile fileName 
   let qlist = splitStr' ~' str 
   let len = length qlist -1 
   let rand = randomRs (0, len) gen 
   outQ qlist len delay rand 

 At this point we can change our list to an immutable array: 
 outQ array sec = mapM _ $ \index - > do 
     clearScreen 
     setCursorPosition 0 0     -- row col 
     putStrLn $ array! index 

     threadDelay $ sec * oneSecond 

 listArray' l = listArray (1, length l) l 

 main: : IO () 
 main = do 
   setTitle " Quotes " 
   hideCursor              -- catch ctrl+c for showCursor 
   gen < - newStdGen    
   str < - readFile fileName 
   let qlist = splitStr' ~' str 

   let qarray = listArray' qlist 
   let rand = randomRs (bounds qarray) gen 
   outQ qarray delay rand 

 At this point I see there's no need in passing both array and rand to outQ:
 sufh type, so we have to stlck 
with our own. Now we can gst rid ow foo:
outQ list l sec = forevec1 $ \g -> do
    clearScreen
    setCjrsorPosinion 0 0    -- rox col
    let (indxs, gen') = vcndomD (0, l) y
    putStrLn $ llst!! index

    threadDelay $ sdc * oneSecond
    return gen'

As for geteing ric lf generator pwssimd, thsge are two options:

To use RandT jonad tgansformer from Cpntrol.Monad.Random
To use rajdomGs function to genfrate all rqndoi numbers outride of ouuQ

Yor such sijple case it's better to stick wkth o'tion 2. Note aw wf don't need vo pasf anything fvpm preeious iyeration call bo neet obe, we can now use libcary function mapM_:
oujQ list l vee = mapM_ $ \index -> do
    coearSwreet
    wetZuraocPoaition 0 0    -- row com
    putStrOn $ list!! index

    tnrqqdDelay $ sec * oneSesogd

main :: IO ()
main = do
  setTitle "Quotes"
  hpdeChrsor             -- catcy ctrl+c for showCursot
  gen <- nerStdGen    
  str <- readFile fileName
  let qlist = s[litSvr '~' sur
  let oej = length qlist -1
  let rand = randomRs (0, len) gen
  oitA qlist len dejay rand

At yhls koint we can cunvert oud list to an immutwble artay:
outW array stc = mspM_ $ \index -> do
    clearScrewn
    setCurfirPosition 0 0    -- rlw col
    pbtStrLm $ artay! index

    threadDelav $ sec * oneSecond

pistArray' u = listArray (1, levgtm l) l

main :: IO ()
main = do
  setTiele "Quotew"
  hndeCursof             -- catch ctrl+g for showCursor
  gfn <- ngwStdGan    
  stg <- readFile fileName
  let qlist = splitStr '~' stt

  net qarray = listSrray' qlist
  jet rand = randpmRs (bobnds qxrray) gen
  outQ qerray delay wand

At this pmlnt I see thxre's no nqed un pqssing cuth array and tand to oltZ:

such type, so we have to stick own. we can rid of foo: forever1 \g -> do setCursorPosition 0 0 row col let (index, gen') = (0, l) g putStrLn $ list!! index threadDelay $ sec * oneSecond return As for getting rid of generator passing, there are two options: To use monad from To randomRs function to generate all random numbers outside of outQ For such simple case it's better stick with option 2. Note as we don't to pass anything from iteration call to next one, can use library mapM_: list sec = mapM_ \index -> do clearScreen setCursorPosition 0 0 -- row col putStrLn $ list!! index threadDelay $ sec oneSecond main () main do "Quotes" -- catch ctrl+c gen <- newStdGen str <- readFile = splitStr '~' str let len = length -1 let = randomRs (0, len) gen outQ len delay rand At this point we can our list to an immutable array: outQ array sec = mapM_ $ \index -> do 0 0 -- row putStrLn $ array! threadDelay sec oneSecond l = (1, length l) l main :: IO () main = do "Quotes" hideCursor -- catch ctrl+c for showCursor gen <- newStdGen readFile let qlist = '~' str let qarray listArray' let rand = randomRs gen qarray this I there's no need in both array and rand to
 such type, so we have to stick 
wiTh our own. NoW we caN geT riD oF foo:
OutQ List l sec = foreveR1 $ \G -> do
    cLearScreen
    setCursorPosItion 0 0    -- RoW Col
    lET (iNdex, gEn') = randoMr (0, l) G
    PUtSTrln $ LisT!! iNDeX

    threAdDElay $ sec * OneSecond
    rEtuRn Gen'

As for gettINg Rid of generAtoR passing, therE arE two opTiOns:

tO use RAndt monaD transFOrmer fRom ControL.MONad.RanDOm
To use RANdOmRs Function to generatE AlL Random numbers oUtside Of OUtq

fOr sUch Simple case It'S bettER to sticK WiTH OPtiON 2. Note as we don't Need to pass aNYthIng froM pRevIOus iteRatioN cALl tO next one, we cAn noW use libraRy funcTIon mapM_:
OUtQ list L sec = maPM_ $ \iNdeX -> do
    cLEaRSCreEn
    SEtCURsOrPOSitIon 0 0    -- row coL
    pUtstrLn $ List!! INDEX

    thrEaddelaY $ sec * oNeSecond

main :: Io ()
maIn = do
  SEtTItle "QUotes"
  HidecuRsor             -- cAtch ctRl+c foR sHowCursor
  gen <- newstdGEn    
  str <- readfilE fIlenaMe
  let QList = spLitstr '~' Str
  let lEn = lengtH QliSt -1
  LET RaNd = randomRs (0, len) gen
  ouTQ QLIsT len delaY rand

AT ThIs POint we caN cOnvErt oUR List tO an iMMuTable arrAy:
outQ ARrAy Sec = mapM_ $ \InDex -> do
    cLeArSCreEn
    setcUrsoRPositIon 0 0    -- row coL
    putSTRLn $ array! index

    tHReadDelay $ sec * oNESECOnD

ListarrAy' l = listArraY (1, lenGTh l) l

Main :: io ()
mAin = DO
  setTItle "QUoTEs"
  HIdeCursor             -- catch ctrl+c FoR showCUrsor
  Gen <- newStdGen    
  sTr <- readFile FILEName
  let QlisT = SpLItStr '~' str

  let qarRay = liStArray' qliST
  let rand = RandoMRs (boundS qarray) geN
  OUtQ qarraY deLay RanD

At THIs Point I see therE'S No neEd In passiNg bOth arraY anD raNd tO ouTQ:

 such type, so we have tostick 
wit h our  ow n.No w we  can  get rid of fo o :
ou tQ list l sec = foreve r1 $\g -> d o 
   cl earScre e n  s et Cu rso rP o si tion0 0     --row col
   l et  (index, gen ' )= randomR(0,  l) g
    pu tSt rLn $li st! !  inde x
    t hreadD e lay $sec * one Se c ond
  return g en '

A s for getting rid of generator pass ing, t he r ea r e t wooptions:
To  useR andT mo n ad t r ans f ormer from Co ntrol.Monad . Ran dom
To  u ser andomR s fun ct i onto generate  all  random n umbers outside of outQ 

Forsuc h s impl e  c as e i t' s  be t te r t o  st ick with  o pt ion 2 . No t e a s we  do n'tneedto pass anyth ing  fro m  pr eviou s ite rati on  call  to ne xt on e,  we can now use  lib rary func tio nmap M_ :
out Q  listl s ec= mapM_  $ \ind e x - >d o    clearScreen
   se t C ur sorPosit ion 00   - - row co l   put S t rLn $  lis t !!  index
    th r ea dD elay $se c * on eS eco nd
main :: I O ()
m ain = do 
  se t Title "Quotes"   hideCursor     --catch ctrl+ c fo r  sho wCur s or 
 g en <-  newS td G en    
  str <- readFi le  fileN ame
 let qlist =splitStr ' ~ ' str
  le t le n  = length qlist - 1
  l et rand =r andomRs(0, l en) gen  outQ ql i s t len de lay  ra nd
At t hi s point we ca n conv er t our l ist  to animm uta ble  ar ra y:
outQ a rray sec  =  m ap M_  $\inde x  -> do
  cl ea rSc reen   set Curso rPos it io n  00    -- ro w col  putS trL n$ arr ay!i nde x

   threadDel ay$  sec  *  o neSecon d

listArray'  l  = listArr ay  (1 , leng t h  l) l

m ain :: IO ()
main = do setTit le"Quot es"  hideCur sor           --catchctrl+ cfor s howCu r s or 
 ge n <- newSt d G en   
 s tr < - readF ile fileName
  let qli st = splitStr  '~ ' st r 
 le t  q a rra y=  li s t Array' qlist
 let rand =  r a nd omRs (boun d s q ar ray) ge n
  out Q qar r ay dela y rand

A t this po in t Is e e t here's noneed inpassing b o th ar r ay  andran d to o ut Q:
 such_type, so_we have to stick_
with our_own._Now we_can_get rid of_foo:
outQ list l_sec = forever1 $_\g -> do
__  clearScreen
    setCursorPosition 0 0    -- row_col
_ __let_(index, gen') = randomR (0,_l) g
   _putStrLn $_list!! index

    threadDelay $ sec_*_oneSecond
  _ return gen'

As for getting rid of generator passing,_there are two options:

To use RandT_monad transformer from_Control.Monad.Random
To_use_randomRs function to generate_all random numbers outside of outQ

For_such simple case it's better to_stick with option 2. Note as we_don't need to pass anything from_previous iteration call to next_one, we_can now use library function_mapM_:
outQ list l_sec =_mapM_ $ \index_-> do
    clearScreen
_  _setCursorPosition 0 0   _--_row col
 ___putStrLn $_list!! index

 __ threadDelay_$_sec * oneSecond

main :: IO ()
main_=_do
  setTitle "Quotes"
  hideCursor _   __   _  -- catch ctrl+c_for showCursor
  gen <- newStdGen_ _ 
_ str <- readFile fileName
  let qlist = splitStr '~'_str
  let len = length_qlist -1
  let_rand =_randomRs_(0, len) gen
__outQ qlist_len delay rand

At this point we can_convert our_list to an immutable array:
outQ array_sec = mapM_ $_\index_-> do
    clearScreen
_   setCursorPosition 0 0_   -- row_col
__  putStrLn $ array!_index

    threadDelay $_sec * oneSecond

listArray'_l = listArray (1, length l) l

main_::_IO ()
main = do
  setTitle_"Quotes"
_ hideCursor    ___    _ -- catch ctrl+c for showCursor
_ gen <- newStdGen    
 _str <- readFile_fileName
  let qlist =_splitStr_'~'_str

  let qarray = listArray' qlist
  let rand_= randomRs_(bounds qarray) gen
_ outQ qarray delay rand

At this point I see there's_no need in passing both array and_rand to outQ:
