|
definition: |
dataDeclsOf :: Prog -> [DataDecl]
dataDeclsOf (Prog _ _ tdecls _ _) = concatMap dataDeclsOfTypeDecl tdecls
where
dataDeclsOfTypeDecl (TypeSyn _ _ _ _ ) = []
dataDeclsOfTypeDecl (TypeNew tn _ _ (NewCons cn _ _)) =
[(tn, [(cn,1)])] -- should not be relevant since newtypes are eliminated
dataDeclsOfTypeDecl (Type tn _ _ cdecl ) =
[(tn, map (\ (Cons cn ar _ _) -> (cn,ar)) cdecl)]
|
|
demand: |
argument 1 |
|
deterministic: |
deterministic operation |
|
documentation: |
--------------------------------------------------------------------------- Get all data types (pairs of type name and list of constructor names and arities) in a given FlatCurry program. |
|
failfree: |
_ |
|
indeterministic: |
referentially transparent operation |
|
infix: |
no fixity defined |
|
iotype: |
{({Prog}) |-> _}
|
|
name: |
dataDeclsOf |
|
precedence: |
no precedence defined |
|
result-values: |
_ |
|
signature: |
FlatCurry.Types.Prog -> [((String, String), [((String, String), Prelude.Int)])] |
|
solution-complete: |
operation might suspend on free variables |
|
terminating: |
yes |
|
totally-defined: |
reducible on all ground data terms |