1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
-- Some useful operations on FlatCurry programs:

module MyFlatCurryGoodies where

import FlatCurry.Types

moduleName (Prog mod _ _ _ _) = mod

importsOfProg :: Prog -> [String]
importsOfProg (Prog _ imps _ _ _) = imps

typesOfProg (Prog _ _ types _ _) = types

funcsOfProg (Prog _ _ _ funcs _) = funcs

dataModule (Type tname _ _ _) = fst tname
dataModule (TypeSyn tname _ _ _) = fst tname


funcName (Func fname _ _ _ _) = fname

unqualifiedName (Func fname _ _ _ _) = snd fname

funcModule (Func fname _ _ _ _) = fst fname

isPublic :: FuncDecl -> Bool
isPublic (Func _ _ vis _ _) = vis==Public