
9 Dec
2009
9 Dec
'09
10:11 a.m.
Nicolas Pouillard wrote:
Henning Thielemann wrote:
@Apfelmus:
For practical purposes I think Train should have swapped type parameters in order to make Functor act on the type of the list elements.
data Train b a = Wagon a (Train b a) | Loco b
The functor on the Loco/Caboose makes sense too and swapping the arguments is less natural to read.
It's a bifunctor! :D I don't really mind. The application "list that may end with an error" uses a fixed b , so putting the a at the end makes sense. Regards, Heinrich Apfelmus -- http://apfelmus.nfshost.com