Skip to content

Commit

Permalink
Update lambda-pi
Browse files Browse the repository at this point in the history
  • Loading branch information
fizruk committed Oct 22, 2024
1 parent 45cbc2e commit 540b7a7
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions haskell/lambda-pi/src/Language/LambdaPi/Impl/FreeFoilTH.hs
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ import qualified Language.LambdaPi.Syntax.Lex as Raw
import qualified Language.LambdaPi.Syntax.Par as Raw
import qualified Language.LambdaPi.Syntax.Print as Raw
import System.Exit (exitFailure)
import Control.Monad.Free.Foil.Generic (genericZipMatch2)
import Control.Monad.Free.Foil.Generic
import Generics.Kind.TH (deriveGenericK)
import qualified GHC.Generics as GHC

Expand Down Expand Up @@ -89,9 +89,20 @@ instance Foil.UnifiableInPattern Raw.BNFC'Position where
unifyInPattern _ _ = True
deriveUnifiablePattern ''Raw.VarIdent ''Raw.Pattern'

-- | Deriving 'GHC.Generic' and 'GenericK' instances.
deriving instance GHC.Generic (Term'Sig a scope term)
deriveGenericK ''Term'Sig
instance ZipMatch (Term'Sig a) where

-- -- | Match 'Raw.Ident' via 'Eq'.
-- instance ZipMatchK Raw.Ident where zipMatchWithK = zipMatchViaEq

-- | Ignore 'Raw.BNFC'Position' when matching terms.
instance ZipMatchK Raw.BNFC'Position where zipMatchWithK = zipMatchViaChooseLeft

-- | Generic 'ZipMatchK' instance.
instance ZipMatchK a => ZipMatchK (Term'Sig a)

instance ZipMatchK a => ZipMatch (Term'Sig a) where
zipMatch = genericZipMatch2

-- * User-defined code
Expand Down

0 comments on commit 540b7a7

Please sign in to comment.