From 279129ac737eaf2e73e788a3abf19370c4c72b78 Mon Sep 17 00:00:00 2001 From: Rob Rix Date: Mon, 19 Oct 2020 22:47:09 -0400 Subject: [PATCH] :fire: aeq. --- src/Facet/Surface.hs | 18 ------------------ 1 file changed, 18 deletions(-) diff --git a/src/Facet/Surface.hs b/src/Facet/Surface.hs index 6bbfdfe2a..07ac18095 100644 --- a/src/Facet/Surface.hs +++ b/src/Facet/Surface.hs @@ -12,7 +12,6 @@ module Facet.Surface , Type(..) , unForAll , unTApp -, aeq -- * Declarations , Decl(..) , DDecl(..) @@ -24,11 +23,8 @@ module Facet.Surface , Import(..) ) where -import Control.Applicative (liftA2) import Control.Effect.Empty -import Data.Function (on) import Data.List.NonEmpty (NonEmpty) -import Data.Monoid (First(..)) import Facet.Name import Facet.Syntax import Text.Parser.Position @@ -89,20 +85,6 @@ unTApp :: Has Empty sig m => Type -> m (Spanned Type, Spanned Type) unTApp = \case{ f :$$ a -> pure (f, a) ; _ -> empty } -aeq :: Type -> Type -> Bool -aeq t1 t2 = case (t1, t2) of - (TFree n1, TFree n2) -> n1 == n2 - (TBound n1, TBound n2) -> n1 == n2 - (Type, Type) -> True - ((n1 ::: t1) :=> b1, (n2 ::: t2) :=> b2) -> n1 == n2 && aeq' t1 t2 && aeq' b1 b2 - (f1 :$$ a1, f2 :$$ a2) -> aeq' f1 f2 && aeq' a1 a2 - (a1 :-> b1, a2 :-> b2) -> aeq' a1 a2 && aeq' b1 b2 - _ -> False - where - aeq' = fmap and . (liftA2 aeq `on` extract) - extract = getFirst . foldMap (First . Just) - - -- Declarations data Decl