|
RE: Enum class: msg#00118lang.haskell.cafe
Well, you already have succ:: (Enum a) => a -> a defined for all data of the Enum class. You also need Bounded so that you can check maxBound. This (untested) code should do it: > next:: (Enum a, Bounded a) => a -> a > next v = if (toEnum v) == (toEnum (maxBound)) > then minBound > else succ v -- Arjun Guha <guhaarju@xxxxxxxxxxxx> |
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| Previous by Date: | Re: Re: Typed Lambda-Expressions withOUT GADTs: 00118, Martin Sulzmann |
|---|---|
| Next by Date: | Re: Some random newbie questions: 00118, O . Chitil |
| Previous by Thread: | Two fun things with GADTsi: 00118, Ashley Yakeley |
| Next by Thread: | RE: RE: Enum class: 00118, Arjun Guha |
| Indexes: | [Date] [Thread] [Top] [All Lists] |
| News | FAQ | advertise |