Skip to content

Commit

Permalink
alloc
Browse files Browse the repository at this point in the history
  • Loading branch information
ejconlon committed May 17, 2024
1 parent d054b21 commit 30b55a5
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions minipat-live/src/Minipat/Live/Boot.hs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ module Minipat.Live.Boot
( LiveSt (..)
, readLiveSt
, allocate
, allocateWith
, initialize
, reallocate
, dispose
Expand Down Expand Up @@ -63,9 +64,12 @@ readLiveSt :: (LiveSt) => IO (C.St LiveBackend)
readLiveSt = readIORef liveStRef

allocate :: (Default i) => IO (IORef (C.St i))
allocate = do
allocate = allocateWith def

allocateWith :: i -> IO (IORef (C.St i))
allocateWith be = do
logger <- L.newLogger
st <- C.newSt logger def def
st <- C.newSt logger be def
newIORef st

initialize :: (LiveSt) => IO ()
Expand Down

0 comments on commit 30b55a5

Please sign in to comment.