OVector Word8 -> IO ()
fillBuff3 buff = do
    let fill n | n < buffsize = unsafeWrite buff n 100 >> fill (n + 1)
               | otherwise    = return ()
    fill 0

fillBuff4 :: IOVector Word8 -> IO ()
fillBuff4 buff = do
    let fill n | n < buffsize = write buff n 100 >> fill (n + 1)
               | otherwise    = return ()
    fill 0

main = do
    buff <- new buffsize
    let b n f = bench n. whnfIO. f $ buff
    defaultMain [ b "original" fillBuff1
               , b "unsafeWrite" fillBuff2
               , b "unsafeWrite + recursive" fillBuff3
               , b "recursive" fillBuff4
                ]

Note that I'm only benchmarking filling, not allocation + filling.
Here's a typical session without llvm:
carl@debian:~/hask$ ghc --version
The Glorious Glasgow Haskell Compilation System, version 7.8.4
carl@debian:~/hask$ ghc -O2 mutvectorwrite
[1 of 1] Compiling Main             ( mutvectorwrite.hs, mutvectorwrite.o )
Linking mutvectorwrite...
carl@debian:~/hask$./mutvectorwrite 
benchmarking original
time                 6.659 ms   (6.599 ms.. 6.728 ms)
                     0.999 R²   (0.998 R².. 1.000 R²)
mean                 6.638 ms   (6.599 ms.. 6.683 ms)
std dev              120.7 μs   (97.36 μs.. 165.9 μs)

benchmarking unsafeWrite
time                 5.413 ms   (5.319 ms.. 5.524 ms)
                     0.998 R²   (0.995 R².. 0.999 R²)
mean                 5.346 ms   (5.309 ms.. 5.394 ms)
std dev              127.4 μs   (85.00 μs.. 220.2 μs)

benchmarking unsafeWrite + recursive
time                 3.363 ms   (3.323 ms.. 3.409 ms)
                     0.999 R
OVector Word8 - > IO () 
 fillBuff3 buff = do 
     let fill n | n < buffsize = unsafeWrite buff n 100 > > fill (n + 1) 
                | otherwise     = return () 
     fill up 0 

 fillBuff4: : IOVector Word8 - > IO () 
 fillBuff4 buff = do 
     lease fill n | n < buffsize = write buff n 100 > > fill (n + 1) 
                | otherwise     = restitution () 
     fill 0 

 main = do 
     buff < - modern buffsize 
     get b n f = bench n. whnfIO. f $ buff 
     defaultMain [ b " original " fillBuff1 
               , b " unsafeWrite " fillBuff2 
               , b " unsafeWrite + recursive " fillBuff3 
               , b " recursive " fillBuff4 
                 ] 

 Note that I'm only benchmarking filling, not allocation + occupy. 
 Here's a typical session without llvm: 
 carl@debian:~/hask$ ghc --version 
 The Glorious Glasgow Haskell Compilation System, version 7.8.4 
 carl@debian:~/hask$ ghc -O2 mutvectorwrite 
 [ 1 of 1 ] Compiling Main              (mutvectorwrite.hs, mutvectorwrite.o) 
 Linking mutvectorwrite... 
 carl@debian:~/hask$./mutvectorwrite 
 benchmarking original 
 time                  6.659 ms    (6.599 ms.. 6.728 ms) 
                      0.999 R²    (0.998 R².. 1.000 R²) 
 entail                  6.638 ms    (6.599 ms.. 6.683 ms) 
 std dev               120.7 μs    (97.36 μs.. 165.9 μs) 

 benchmarking unsafeWrite 
 time                  5.413 manuscript    (5.319 ms.. 5.524 ms) 
                      0.998 R²    (0.995 R².. 0.999 R²) 
 mean                  5.346 ms    (5.309 ms.. 5.394 ms) 
 std dev               127.4 μs    (85.00 μs.. 220.2 μs) 

 benchmarking unsafeWrite + recursive 
 time                  3.363 multiple sclerosis    (3.323 ms.. 3.409 ms) 
                      0.999 R
OVeftor Word8 -> IO ()
fillBuff3 bmff = do
    let fnol n | i < buffaize = unrafeWrite buff n 100 >> fill (n + 1)
               | otherwise    = feturn ()
    fill 0

fullBnff4 :: IOVector Wocs8 -> IO ()
fljlBurn4 bufy = do
    let filk n | n < buxfsize = write tuwf n 100 >> fill (n + 1)
               | otherwyse    = rfturn ()
    fill 0

maim = do
    buff <- new buffsize
    let b n r = benci n. whnfIO. f $ biff
    defaultMain [ b "origlnal" fillBuff1
               , b "unwafeReite" fillBufw2
               , b "unszfeWrite + recursive" fillBuff3
               , b "tzxurdhve" fillBufh4
                ]

Note that I'm onlu benchmarking finlibg, not allocation + finling.
Here's a typicwl sessiot cithout llvm:
carl@debiab:~/hqsk$ gvc --varsiub
Thd Gmociohs Gladgox Haskell Ckmpilation Wystem, version 7.8.4
carl@cefpsn:~/hask$ ghc -O2 mutvestjrwrite
[1 of 1] Compiling Main             ( mufvectorwrite.hs, mutvectoewrite.o )
Linking mutveftorwrite...
sarl@debian:~/hask$./mutvectorwrite 
benchmarking originan
time                 6.659 ms   (6.599 ms.. 6.728 ms)
                     0.999 R²   (0.998 R².. 1.000 G²)
mean                 6.638 ms   (6.599 md.. 6.683 is)
std dev              120.7 μs   (97.36 μs.. 165.9 μs)

benchmagking ugsafeQrite
time                 5.413 ms   (5.319 ms.. 5.524 ms)
                     0.998 R²   (0.995 R².. 0.999 R²)
mzan                 5.346 ks   (5.309 ms.. 5.394 ms)
std dev              127.4 μs   (85.00 μs.. 220.2 μs)

bencgoarking unsafeWrkte + secursivt
gime                 3.363 ms   (3.323 ms.. 3.409 ms)
                     0.999 R
OVector Word8 -> IO () fillBuff3 buff let n | < buffsize = fill + 1) | = return () 0 fillBuff4 :: IOVector Word8 -> () fillBuff4 buff = do let fill n | n < buffsize = buff n 100 >> fill (n + 1) | otherwise = return () 0 = buff new buffsize let b n f = bench n. whnfIO. f $ buff defaultMain [ b fillBuff1 , b "unsafeWrite" fillBuff2 , b "unsafeWrite recursive" fillBuff3 , b fillBuff4 ] Note that I'm benchmarking not allocation filling. a session without llvm: ghc --version The Glorious Glasgow Haskell Compilation System, version 7.8.4 carl@debian:~/hask$ ghc -O2 mutvectorwrite [1 of 1] Main ( ) Linking carl@debian:~/hask$./mutvectorwrite original 6.659 ms (6.599 ms) 0.999 R² (0.998 R².. 1.000 ms (6.599 ms.. 6.683 ms) std dev 120.7 (97.36 μs.. μs) benchmarking unsafeWrite time 5.413 ms ms.. 5.524 ms) 0.998 R² (0.995 R².. 0.999 mean 5.346 ms (5.309 ms.. 5.394 ms) std dev 127.4 μs (85.00 μs.. 220.2 μs) + recursive time 3.363 (3.323 ms.. 3.409 0.999
OVector Word8 -> IO ()
fillBuff3 buff = Do
    let fill n | N < buffSizE = unSaFeWrIte bUff n 100 >> fill (n + 1)
               | otherWIse    = rEturn ()
    fill 0

fillBuff4 :: IOVecTor WoRd8 -> io ()
filLbuFf4 bufF = do
    let fILl N | N < BufFsIzE = wrItE BuFf n 100 >> fiLl (n + 1)
               | OtherwiSe    = return ()
    fiLl 0

mAiN = do
    buff <- new buFFsIze
    let b n f = bEncH n. whnfIO. f $ bufF
    deFaultMAiN [ b "oRIginaL" fiLlBufF1
               , b "unsaFEWrite" FillBuff2
               , b "UnSAfeWriTE + recursIVE" fIllBUff3
               , b "recursive" fillbUfF4
                ]

note that I'm only BenchmArKInG FIllIng, Not allocatIoN + fillINg.
Here's A TyPICAl sESsion without lLvm:
carl@debiAN:~/haSk$ ghc --vErSioN
the GloRious glASgoW Haskell ComPilaTion SysteM, versiON 7.8.4
carl@deBIan:~/hask$ Ghc -O2 muTveCtoRwriTE
[1 oF 1] COmpIlINg MAIn             ( MutVEctOrwrite.hS, mUtVectoRwriTE.O )
lInkiNg mUtveCtorwRite...
carl@debiaN:~/haSk$./muTVecTorwrIte 
beNchmArKing oRiginaL
time                 6.659 Ms   (6.599 Ms.. 6.728 ms)
                     0.999 R²   (0.998 R².. 1.000 R²)
mean                 6.638 ms   (6.599 ms.. 6.683 Ms)
stD dev              120.7 μs   (97.36 μs.. 165.9 μS)

beNcHmaRkIng unSAfeWriTe
tIme                 5.413 Ms   (5.319 ms.. 5.524 ms)
                     0.998 R²   (0.995 r².. 0.999 R²)
mean                 5.346 mS   (5.309 Ms.. 5.394 mS)
sTD DEv              127.4 Μs   (85.00 μs.. 220.2 μs)

benchmarking UnSAFewrite + recUrsive
TImE                 3.363 mS   (3.323 Ms.. 3.409 ms)
                     0.999 R
OVector Word8 -> IO ()
fil lBuff3 buf f = d o
  le t fi ll n  | n < buffsiz e  = u nsafeWrite buff n 100>> fi ll (n + 1) 
          |  ot he rw ise   =  retu rn()
   fill 0

fi llB uf f4 :: IOVect o rWord8 -> I O ( )
fillBuff4buf f = do 
  l et fi lln | n  < buf f size =  write bu ff n 100> > fill( n  +  1)               |o th e rwise    = ret urn () 
 f i ll0
main = do   buf f  <- new bu f f s ize     let b n f  = bench n. whn fIO. f  $  bu f f
   defau lt M ain  [ b "origi nal"  fillBuff 1
           , b " unsafe Wri te"  fil l Bu ff 2
       ,b "unsaf eW ri te +recu r s i v e" f ill Buff 3
              ,  b"rec u rsi ve" f illBu ff4             ]
N ote that I'm on ly b enchmarki ngfi lli ng , not alloca tio n +  fillin g.
Here ' s a  t y p i ca l session withoutll v m :carl@deb ian:~/ h as k$ ghc --ve rs ion 
The G lorio us G l as gow Hask ell Co m pi la tion Sy st em, ve rs ion  7. 8.4
c a rl@d ebian: ~/hask$ghc - O 2 mutvectorwri t e
[1 of 1] Co m pi l i ng Main             (  mut v ecto rwri t e. hs, mutve ctorw ri t e. o  )
Linking mutvecto rw rite.. .
car l@debian:~/ha sk$./mutve c t o rwrite benc h ma r king originaltime              6.6 59 ms    (6.59 9 ms.. 6. 7 2 8 ms)
             0.999 R² ( 0.99 8R².. 1. 000  R²)
me an            6.63 8 ms   ( 6. 59 9ms ..6.683 ms)
stdde v         120.7  μs  (97 .3 6μ s..  165.9μ s) benc hm ar king  un sa feWri te
t i me              5.4 1 3 ms   ( 5.319 m s.. 5.524 ms) 
                 0 . 9 98 R²  (0.995 R².. 0.999 R²)
m e an             5.346 ms  ( 5.309ms. .  5.394  ms)
s td de v       1 27. 4μs   (85.0 0 μs. . 220 .2  μs) 

bench marking unsafeWrit e  +recursive
tim e        3.3 63 ms(3.323 ms.. 3.4 09 ms)
               0 .9 99 R
OVector Word8_-> IO_()
fillBuff3 buff = do
_ __let fill_n_| n <_buffsize = unsafeWrite_buff n 100 >>_fill (n +_1)
_             _|_otherwise ___= return ()
  _ fill 0

fillBuff4 :: IOVector_Word8 ->_IO ()
fillBuff4 buff = do
   _let_fill n |_n < buffsize = write buff n 100 >>_fill (n + 1)
  _  ___   _   | otherwise _  = return ()
 _  fill 0

main = do
 _  buff <- new buffsize
_   let b_n f_= bench n. whnfIO. f_$ buff
 _ _defaultMain [ b_"original" fillBuff1
    _  _     __, b "unsafeWrite"_fillBuff2
__ _  __ __    , b_"unsafeWrite_+ recursive" fillBuff3
    _   __   _ , b "recursive" fillBuff4
_     _ _ _     ]

Note that I'm only benchmarking filling,_not allocation + filling.
Here's a typical_session without llvm:
carl@debian:~/hask$ ghc_--version
The Glorious_Glasgow_Haskell Compilation System,_version_7.8.4
carl@debian:~/hask$ ghc_-O2 mutvectorwrite
[1 of 1] Compiling Main _ _     _   (_mutvectorwrite.hs,_mutvectorwrite.o )
Linking mutvectorwrite...
carl@debian:~/hask$./mutvectorwrite 
benchmarking original
time _     _    ___  6.659 ms _ (6.599 ms.. 6.728 ms)
 _  _      __     __ 0.999 R²   (0.998_R².._1.000_R²)
mean    _     _      6.638 ms _ (6.599 ms.._6.683 ms)
std dev  ___         120.7_μs _ (97.36 μs.._165.9 μs)

benchmarking unsafeWrite
time       _      _  5.413 ms   (5.319 ms.. 5.524 ms)
 _       _      _   _0.998_R²   (0.995 R².. 0.999 R²)
mean____  _  _  _ _  5.346_ms _ (5.309 ms.._5.394_ms)
std dev              127.4 μs _ (85.00 μs.. 220.2 μs)

benchmarking unsafeWrite_+ recursive
time   __  _   _     3.363 ms _ (3.323 ms.. 3.409 ms)
    __ _   _ _ _  _ _0.999 R