Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
私はこのようなものを持っています
isLastPermutation (h:t)= catch (nextPermutation (h:t)) (\e-> return True) return False
場合によってnextPermutationは例外がスローされ、例外がスローされる場合は関数isLastPermutationが true を返し、nextPermutationそれ以外の場合は false を返します。
nextPermutation
isLastPermutation
純粋な Haskell では、フロー制御に例外を使用しないでください。Maybeまたはを使用しEitherます。
Maybe
Either