data Weekday = Sun | Mon | Tue | Wed | Thu | Fri | Sat deriving Enum
is fine.But wouldn't it be fun if this actually worked?
let as@[sun, mon, tue, wed, thur, fri, sat] = [1..length as]
, unfortunately attempt to evaluate mon for instance, and it doesn't terminate (at least as far as I know, I didn't wait for all eternity for it to finish). Needs -XDWIM I suppose.
No comments:
Post a Comment