Rahul Kapoor <r...@trie.org> writes: >> *Main> toEnum 2 > > ghci does not know what type of enum you want to create from the number 2. > Try: toEnum 2 :: DayOfWeek > > That said, I would expect "toEnum 2" to give an error like: 'Ambiguous > type variable `a'....'. So I am not sure why your error message says: > '** Exception: Prelude.Enum.().toEnum: bad argument'
Wild guess: The dread monomorphism restriction uses () as a reasonable type, and it only has one element. Does 'toEnum 0' give '()' as the result? (I couldn't reproduce it with my version of GHCi - I get the ambigous type error message) -k -- If I haven't seen further, it is by standing in the footprints of giants _______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe