unfoldl package:folds

Construct a Moore machine from a state valuation and transition function
Construct a strict Moore machine from a state valuation and transition function