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