From 447f5ddbd9d98c0106a190fd3894de1ff5d2e98c Mon Sep 17 00:00:00 2001 From: "P. Oscar Boykin" Date: Thu, 31 Oct 2024 08:21:59 -1000 Subject: [PATCH] remove asCheap from Matchless (#1239) --- core/src/main/scala/org/bykn/bosatsu/Matchless.scala | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/core/src/main/scala/org/bykn/bosatsu/Matchless.scala b/core/src/main/scala/org/bykn/bosatsu/Matchless.scala index 167f333cc..2e30c55fc 100644 --- a/core/src/main/scala/org/bykn/bosatsu/Matchless.scala +++ b/core/src/main/scala/org/bykn/bosatsu/Matchless.scala @@ -217,18 +217,12 @@ object Matchless { case class PrevNat(of: Expr) extends Expr - private def asCheap(expr: Expr): Option[CheapExpr] = - expr match { - case c: CheapExpr => Some(c) - case _ => None - } - private def maybeMemo[F[_]: Monad]( tmp: F[Long] )(fn: CheapExpr => F[Expr]): Expr => F[Expr] = { (arg: Expr) => - asCheap(arg) match { - case Some(c) => fn(c) - case None => + arg match { + case c: CheapExpr => fn(c) + case _ => for { nm <- tmp bound = LocalAnon(nm)