|
| <prev next> |
RE: RE: Enum class: msg#00129lang.haskell.cafe
Sorry, that was a stupid error. I meant to use fromEnum: > next:: (Enum a, Bounded a) => a -> a > next v = if (fromEnum v) == (fromEnum maxBound) > then minBound > else succ v I don't think this will quite work if fromEnum:: a -> Int for type a, were not injective. However, that might be part of the specification... I don't remember. It should be fine, so long as the preimage of (fromEnum maxBound) is {maxBound}. -Arjun -- Arjun Guha <guhaarju@xxxxxxxxxxxx> |
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| Previous by Date: | Re: Some random newbie questions: 00129, Jorge Adriano Aires |
|---|---|
| Next by Date: | Re: Some random newbie questions: 00129, John Hughes |
| Previous by Thread: | RE: Enum classi: 00129, Arjun Guha |
| Indexes: | [Date] [Thread] [Top] [All Lists] |
| News | FAQ | advertise |