Skip to content

Commit

Permalink
etc
Browse files Browse the repository at this point in the history
  • Loading branch information
ejconlon committed Jan 12, 2024
1 parent 1ea2117 commit d200310
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 4 deletions.
1 change: 1 addition & 0 deletions minipat/minipat.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ source-repository head
library
exposed-modules:
Minipat.Ast
Minipat.Interp
Minipat.Main
Minipat.Parser
Minipat.Print
Expand Down
5 changes: 1 addition & 4 deletions minipat/src/Minipat/Ast.hs
Original file line number Diff line number Diff line change
Expand Up @@ -402,7 +402,7 @@ instance (Pretty s, Pretty a, Pretty r) => Pretty (PatF s a r) where

newtype Pat b a = Pat {unPat :: UnPat b a}
deriving stock (Show)
deriving newtype (Eq, Ord, Functor, Foldable)
deriving newtype (Eq, Ord, Functor, Foldable, Pretty)

type UnPat b = Jot (PatF (Pat b Factor)) b

Expand Down Expand Up @@ -448,9 +448,6 @@ instance Bitraversable Pat where
PatMod (Mod r m) -> fmap PatMod $ Mod <$> go r <*> traverse (bitraverse f pure) m
PatPoly (PolyPat rs mc) -> fmap (\rs' -> PatPoly (PolyPat rs' mc)) (traverse go rs)

instance (Pretty a) => Pretty (Pat b a) where
pretty = pretty . unPat

-- ** Normalization

type NPat b = Pat (Expansion b)
Expand Down
11 changes: 11 additions & 0 deletions minipat/src/Minipat/Interp.hs
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
module Minipat.Interp where

import Bowtie (jotRight)
import Minipat.Ast qualified as A
import Minipat.Types qualified as T

interp :: A.NPat b a -> T.Pat a
interp = jotRight go . A.unPat
where
go = \case
_ -> error "TODO"

0 comments on commit d200310

Please sign in to comment.