module Id ( newId, nextId ) where {- - - Écrit par Hédy GIRAUDEAU - 27/07/17 - -} import Data.IORef import Data.Functor type Id_number a = IORef a newId = (newIORef 0) nextId cnt = modifyIORef cnt (+1) >> (+0) <$> readIORef cnt