{"push_id":1848683709,"size":1,"distinct_size":1,"ref":"refs/heads/master","head":"c4875cc69a86427feec2d8d00cbd37b1b23d73d2","before":"223584f54c7991b14859b38202e54294db74b834","commits":[{"sha":"c4875cc69a86427feec2d8d00cbd37b1b23d73d2","author":{"name":"Martin Bidlingmaier","email":"d7748a5e67866a8ba461709d0328ac8f4bd8d462@gmail.com"},"message":"Add -WithIndex classes (#72)\n\n* Add -WithIndex classes\r\n\r\nThis adds `FunctorWithIndex`, `FoldableWithIndex` and\r\n`TraversableWithIndex` and some combinators. Implementations are mostly\r\ncopied from the versions without index with minor adaptions. Similarly\r\nfor the documentation.\r\n\r\nI think the corresponding haskell package does not state all laws for\r\nthese type classes, so there are TODO's in the doc strings of the three\r\nclasses.\r\n\r\n`StateL` and `StateR` in TraversableWithIndex.purs are exact copies of\r\nthe versions in Traversable.purs because they are not exported there.\r\nMaybe it would be better to merge TraversableWithIndex.purs into\r\nTraversable.purs and similarly for Foldable. The Foldable and Traverse\r\ninstances of Array could then be along the lines of\r\n```purescript\r\ntraverse f = itraverse (const f)`\r\n```\r\nso that the foreign js imports for the unindexed version could be\r\nremoved.\r\n\r\n`FunctorWithIndex`'s `imap` collides with the `imap` of\r\npurescript-invariant. Haskell calls the latter `invmap`. I don't know\r\nwhether that's a problem.\r\n\r\nThis does not yet include the `-1WithIndex` classes, i.e.\r\ngeneralizations of `Foldable1` and `Traversable1` in `Semigroup/`. I\r\nguess it would make sense to provide them here as well.\r\n\r\n* Fix export lists\r\n\r\n* Add missing semicolon in js\r\n\r\n* Remove foreign implementation of array's itraverse\r\n\r\n* Move `Accum` and State to separate module\r\n\r\n* Remove foreign implementation of array's folds\r\n\r\n* Settle with incomplete laws\r\n\r\nThe modified `Foldable` and `Traversable` laws that must hold for their\r\n-WithIndex versions are missing in the docs. But because the actual\r\nunmodified laws for `Foldable` and `Traversable` themselves are not here\r\neither I guess it shouldn't be a problem.\r\n\r\n* Add some test for FoldableWithIndex\r\n\r\nNo tests for\r\n\r\n- ifoldM\r\n- itraverse_\r\n- ifor_\r\n- iall\r\n- iany\r\n- all instances except for Array\r\n\r\nThese are not tested for Foldable either.\r\n\r\n* Add test for Array's TraversableWithIndex instance\r\n\r\n* Fix name: Add mising i- prefix\r\n\r\n* Change index naming scheme `i-` -> `-WithIndex`\r\n\r\n* Revert accidentally renamed Bifoldable functions","distinct":true,"url":"https://api.github.com/repos/purescript/purescript-foldable-traversable/commits/c4875cc69a86427feec2d8d00cbd37b1b23d73d2"}]}
{"actor":{"display_login":"paf31"}}