---
layout: "default"
title: "sequence"
description: "Swift documentation for 'sequence': Returns a sequence formed from first and repeated lazy applications of."
keywords: "sequence,func,swift,documentation"
root: "/v4.2"
---

<div class="declaration" id="func-sequence-t_-t-next_-escaping-t-t">
<a class="toggle-link" data-toggle="collapse" href="#comment-func-sequence-t_-t-next_-escaping-t-t">func sequence&lt;T&gt;(<wbr>_:<wbr> T, next: @escaping (T) -&gt; T?)</a>
        
<div class="comment collapse" id=