Skip to content

ex1 06

← Back

Basic Info

Functional Programming
└── Lab ML
    └── 0​307
        └── ex1 06.sml

Preview

(*Cycle a list once, i.e., convert [a1,...,an] to [a2,...,an,a1]. It doesn’t have to work on the empty list*)

fun cycle (l) = tl(l) @ [hd(l)];