-
Notifications
You must be signed in to change notification settings - Fork 12
Open
Description
Thank you for these rules, I find them really helpful!
I found that the FlatTraverse rule may rewrite code in a way that produces type errors. For example, this traverses a List[String] and produces an IO[List[Option[Int]]], then maps and flattens it to a List[Int]:
List("", "foo", "bar").traverse(s =>
IO(Some(s.length).filter(_ > 0))
).map(_.flatten)When it's rewritten to flatTraverse it triggers a type error since flatTraverse would require the given function to return an IO[List[?]].
I think fixing this would require changing it to a SemanticRule.
Metadata
Metadata
Assignees
Labels
No labels