purescript/purescript-enums — pull request #6 by NightRa (2014-11-28 07:56:43+00:00)
Title: Move toEnum&fromEnum into the Enum class, provide range functions.

This PR moves toEnum and fromEnum into the Enum class, providing default implementations for succ, pred, toEnum and fromEnum.

The move is nessesary for providing O(1) toEnum and fromEnum implementations.

Migration guide:
-- Add toEnum & fromEnum to all Enum classes, with a fallback to default implementations.
-- Beware of ScopedTypeVariables and passing typeclass functions to the default implementations.
-- See the implementation for workarounds.

Also, this PR adds the range functions for enums.