Henning Thielemann wrote:
Why not just
 FancySequence.fromList [1,2,3,4]
  or
 FancySequence.fromList $ 1:2:3:4:[]
?
Yes of course, but the same could be said for numbers, e.g when you need an Int, you have to type (Int.fromNumber 1), (Float.fromNumber 1), (Double.fromNumber 1), etc... I don't like that because it makes writing numeric type independent generic code impossibe, so luckily the Haskell compiler automatically inserts fromInteger or fromRational calls to lift a generic number into a specific representation. But it does not provide the same for lists, e.g. there is no fromList function which is a member of some List typeclass that the compiler automatically uses just like it does for numbers. I think this is a bit of a discrepancy.

_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to