...
 
Commits (2)
......@@ -30,15 +30,27 @@ Portability : POSIX
{-# LANGUAGE IncoherentInstances #-}
{-# LANGUAGE AllowAmbiguousTypes #-}
module Language.Grammars.AspectAG (
(.+:),
(.:+:),
syn, syndef, syndefM,
mod, synmod, synmodM,
at, lhs,
Label, Prod, NT, Child, (#.), (=.),
emptyAtt
) where
module Language.Grammars.AspectAG
(
(.+:),
(.:+:),
syn, syndef, syndefM,
mod, synmod, synmodM,
inh, inhdef, inhdefM,
inhmod, inhmodM,
at, lhs,
Label, Prod, NT, Child,
(#.), (=.), (.=.), (.*.),
(*.), (#.),
emptyAtt,
emptyRecord,
singAsp,
emptyAspect,
ter,
sem_Lit,
knitAspect
)
where
import Language.Grammars.AspectAG.HList
......@@ -197,6 +209,8 @@ ext :: RequireEq prd prd' (Text "ext":ctx)
-> CRule ctx prd sc ip a b ic' sp'
ext = ext'
singAsp r
= r .+: emptyAspect
infixr 6 .+.
(.+.) = ext
......@@ -636,7 +650,6 @@ knitAspect (prd :: Label prd) asp fc ip
-- use
-- class Use (att :: Att) (prd :: Prod) (nts :: [NT]) (a :: Type) sc
-- where
......@@ -702,7 +715,6 @@ knitAspect (prd :: Label prd) asp fc ip
-- -----------------------------------------------------------------------------
-- singAsp r = r .+: emptyAspect
-- tyAppAtt :: (forall b. Label ('Att name b)) -> Proxy a -> Label ('Att name a)
-- att `tyAppAtt` Proxy = att
......
......@@ -68,13 +68,14 @@ data TagField (cat :: k) (l :: k') (v :: k'') where
TagField :: Label c -> Label l -> WrapField c v -> TagField c l v
-- | operator
(l :: Label l) .=. (v :: v) = TagField Label l v
-- (l :: Label l) .=. (v :: v) = TagField Label l v
type family WrapField (c :: k') (v :: k)
type family UnWrap (t :: Type) :: [(k,k')]
type instance UnWrap (Rec c (r :: [(k, k')])) = (r :: [(k, k')])
-- emptyRecord = EmptyRec
untagField :: TagField c l v -> WrapField c v
untagField (TagField lc lv v) = v
......@@ -100,8 +101,8 @@ type family ShowField c :: Symbol
-- | Datatype for lookup (wrapper)
data OpLookup (c :: Type)
(l :: k)
(r :: [(k, k')]) :: Type where
(l :: k)
(r :: [(k, k')]) :: Type where
OpLookup :: Label l -> Rec c r -> OpLookup c l r
-- | Datatype for lookup (internal)
......