[ rule "teList_list" $
between (symbol "[") (symbol "]") listG
, rule "teList_empty" $
- withMeta $
- (\src -> BinTree0 $ Token_Term $ TermVT_CF teList_empty `setSource` src)
+ g_source $
+ (\src -> BinTree0 $ Token_Term $ TermAVT teList_empty `setSource` src)
<$ symbol "["
<* symbol "]"
]
where
listG :: CF g (AST_Term src ss)
listG = rule "list" $
- withMeta $
+ g_source $
(\a mb src ->
case mb of
- Just b_ -> BinTree2 (BinTree2 (BinTree0 $ Token_Term $ TermVT_CF $ (`setSource` src) $ teList_cons) a) b_
+ Just b -> BinTree2 (BinTree2 (BinTree0 $ Token_Term $ TermAVT $ (`setSource` src) $ teList_cons) a) b
Nothing ->
BinTree2
- (BinTree2 (BinTree0 $ Token_Term $ TermVT_CF $ (`setSource` src) $ teList_cons) a)
- (BinTree0 $ Token_Term $ TermVT_CF $ (`setSource` src) $ teList_empty))
+ (BinTree2 (BinTree0 $ Token_Term $ TermAVT $ (`setSource` src) $ teList_cons) a)
+ (BinTree0 $ Token_Term $ TermAVT $ (`setSource` src) $ teList_empty))
<$> g_term
<*> option Nothing (Just <$ symbol "," <*> listG)
-instance (Source src, Inj_Sym ss []) => Module src ss [] where
- module_ _s = [] `moduleWhere`
+instance (Source src, Inj_Sym ss []) => ModuleFor src ss [] where
+ moduleFor _s = ["List"] `moduleWhere`
[ "[]" := teList_empty
, "zipWith" := teList_zipWith
, ":" `withInfixR` 5 := teList_cons