
13 Dec
2013
13 Dec
'13
3:26 p.m.
Wouldn't it make more sense to have fromInteger be `repeat . fromInteger`? This would make it an instance for ZipList, not list. You could even give a general instance for applicatives:
Very neat. I had tried using the standard Applicative instance for lists, as I wasn't aware of the ZipList newtype. Very useful. On the question of whether any of this is a good idea, I found this discussion that mostly dismissed it based on the handling of literals (which if I understand it, is the source of my original question): http://www.haskell.org/pipermail/libraries/2012-October/018663.html At the end Conal Elliot points to the applicative-numbers package that has a nearly verbatim implementation of Num (f a). -M