question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

use `TypeRep f` in traverse instead of `a -> f a`

See original GitHub issue

As continuation of #206 I think we should change the signature of traverse

-traverse :: Applicative f, Traversable t => t a ~> (a -> f b, c -> f c) -> f (t b)
+traverse :: Applicative f, Traversable t => t a ~> (TypeRep f, a -> f b) -> f (t b)

sanctuary-type-classes TypeReps are first arguments and i think it’s fine, but if someone things that TypeRep f should be last argument let’s discuss that too.

This would be a breaking change so we might hold it for some time.

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Reactions:2
  • Comments:12 (8 by maintainers)

github_iconTop GitHub Comments

4reactions
joneshfcommented, Jan 5, 2017

so it puzzles me why that extra argument is ever needed as the desired of can be already accessed via v.constructor.of.

It is incredibly instructive to implement traverse for a data type like Maybe a. Here’s a link to a partial implementation: https://glot.io/snippets/elw3v9lfkc You should only have to implement the two traverse functions. There’s a couple of assertions at the bottom that should all pass.

For more insight, try to understand why the traverse1 function cannot be implemented for Nothing. If you think traverse1 can be implemented for Nothing, please provide an implementation.

1reaction
SimonRichardsoncommented, Jan 6, 2017

It doesn’t work like that for haskell because of type inference.

Read more comments on GitHub >

github_iconTop Results From Across the Web

SCP-3673: SCP-2997: versioned builtins. fix consByteString integer ...
An example use of this feature is for "fixing" the behaviour of `ConsByteString` builtin to throw an error instead. +. of overflowing its...
Read more >
Traverse City, MI Weather Conditions | Weather Underground
Traverse City, MI Weather Conditionsstar_ratehome ; Pressure. 29.76 · in ; Visibility. 10 · miles ; Dew Point. 34 · F ; Humidity....
Read more >
Untitled
County Attorney A. RES Authorize - Closed Meeting 8 Pubic Hearings 2:00 P.M. A. RES - Authorize 'Dumfries- Triangle Volunteer Fire Department...
Read more >
Programming-Language-Identification/keywords.txt at master
Name already in use ... f 6026. IhWees 1. ZIkiffqu 1. ylVFliuepOfdOYl 1. maxBodyTemperatureInGalaxy 2 ... aFa 1. Analysis 16. bang 2. substituteTemplates...
Read more >
Full text of "Quantum Physics" - Internet Archive
One may gather from this short sketch how important and use¬ ful it ... tw een the plates constant, if the distance between...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found