Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add ListT section to FAQ #1226

Merged
merged 2 commits into from
Jul 24, 2016
Merged

Add ListT section to FAQ #1226

merged 2 commits into from
Jul 24, 2016

Conversation

ceedubs
Copy link
Contributor

@ceedubs ceedubs commented Jul 23, 2016

No description provided.

@ceedubs ceedubs mentioned this pull request Jul 23, 2016
8 tasks
@codecov-io
Copy link

codecov-io commented Jul 23, 2016

Current coverage is 89.62% (diff: 100%)

Merging #1226 into master will increase coverage by 0.09%

@@             master      #1226   diff @@
==========================================
  Files           234        234          
  Lines          3143       3143          
  Methods        3089       3089          
  Messages          0          0          
  Branches         51         51          
==========================================
+ Hits           2814       2817     +3   
+ Misses          329        326     -3   
  Partials          0          0          

Sunburst

Powered by Codecov. Last update b9e78f5...e3e4f42

@adelbertc
Copy link
Contributor

👍


A naive implementation of `ListT` suffers from associativity issues; see [this gist](https://gist.github.com/tpolecat/1227e22e3161b5816e014c00650f3b57) for an example. It's possible to create a `ListT` that doesn't have these issues, but it tends to be pretty inefficient. For many use-cases, [Nested](https://github.com/typelevel/cats/blob/master/core/src/main/scala/cats/data/Nested.scala) can be used to achieve the desired results.

Here is how we could achieve the effect ofthe previous example using `Nested`:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

s/offthe/of the/

@kailuowang
Copy link
Contributor

👍 apart from the missing space.

@ceedubs
Copy link
Contributor Author

ceedubs commented Jul 24, 2016

By the way @adelbertc I think that these examples show a bit of how useful your Nested contribution can be. Thanks for that!

@ceedubs ceedubs merged commit b07b1b3 into typelevel:master Jul 24, 2016
@ceedubs ceedubs deleted the faq-listt branch July 24, 2016 12:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants