mirror of
https://github.com/GrammaticalFramework/gf-core.git
synced 2026-04-14 07:19:31 -06:00
17 lines
296 B
Haskell
17 lines
296 B
Haskell
module SMacros where
|
|
|
|
import AbsSrc
|
|
|
|
apps :: Exp -> (Exp,[Exp])
|
|
apps e = (f,reverse xs) where
|
|
(f,xs) = aps e
|
|
aps e = case e of
|
|
EApp f x -> let (f',xs) = aps f in (f',x:xs)
|
|
_ -> (e,[])
|
|
|
|
constr :: Ident -> [Exp] -> Exp
|
|
constr = ECst
|
|
|
|
mkApp :: Exp -> [Exp] -> Exp
|
|
mkApp f = foldl EApp f
|