-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | Make bounded enum types circular -- -- Circular successor & predecessor for bounded enum types @package circular-enum @version 0.1.0.0 -- | Sometimes, bounded enum types should be circular. Consider this enum -- type of directions: -- --
--   data Direction  = North
--                   | East
--                   | South
--                   | West
--                   deriving (Eq, Enum, Bounded)
--   
-- -- The Enum instance allows for succ North to be -- East and succ East to be South. But in this -- case, one would like to have some kind of succ with succ -- West = North again. With Eq and Bounded instances, -- the functions defined in this module act like circular versions of -- succ and pred. module Data.Enum.Circular -- | Circular version of succ csucc :: (Eq a, Enum a, Bounded a) => a -> a -- | Circular version of pred cpred :: (Eq a, Enum a, Bounded a) => a -> a