Skip to content

Commit

Permalink
cache generated traverse instance ot a val (#115)
Browse files Browse the repository at this point in the history
  • Loading branch information
pepegar authored and andyscott committed May 24, 2019
1 parent 814a88d commit bad7dae
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ object Macros {
v
})

def traverseInstance(λ: TypeName): DefDef = {
def traverseInstance(λ: TypeName): ValDef = {
val G = c.freshName(TypeName("G"))
val AA = c.freshName(TypeName("AA"))
val B = c.freshName(TypeName("B"))
Expand Down Expand Up @@ -142,7 +142,7 @@ object Macros {
val mtch = Match(Ident(TermName("fa")), cases)

q"""
implicit def traverseInstance: _root_.cats.Traverse[] = new _root_.higherkindness.droste.util.DefaultTraverse[] {
implicit val traverseInstance: _root_.cats.Traverse[] = new _root_.higherkindness.droste.util.DefaultTraverse[] {
def traverse[$G[_]: _root_.cats.Applicative, $AA, $B](fa: [$AA])(fn: $AA => $G[$B]): $G[[$B]] = $mtch
}
"""
Expand Down

0 comments on commit bad7dae

Please # to comment.