module Model.IdGenerator ( IdGenerator , initialIdGenerator , getId ) where import Model.Id (..) type alias IdGenerator = { counter : Id } initialIdGenerator = { counter = 1 } getId : IdGenerator -> (Id, IdGenerator) getId idGenerator = ( idGenerator.counter , { idGenerator | counter <- idGenerator.counter + 1 } )