Reuse buildLet in Buildable instance for Let

This commit is contained in:
Gabriel Gonzalez 2016-09-16 17:21:26 -07:00
parent d2ec1c1cc2
commit 47eb966f8e

View File

@ -134,13 +134,7 @@ data Let a = Let
} deriving (Functor, Foldable, Traversable, Show)
instance Buildable a => Buildable (Let a) where
build (Let f as r) =
"let "
<> build f
<> " "
<> foldMap (\(x, t) -> "(" <> build x <> " : " <> build t <> ")") as
<> "= "
<> build r
build = buildLet
-- | Syntax tree for expressions
data Expr a