Re: Getting the constructor from flat curry

From: Sebastian Fischer <>
Date: Wed, 30 Jun 2010 10:31:15 +0200

Hello Hema,

hema kumar wrote:

> I want to get the constructor (data contructor) from flat curry of a
> program. is there any function which can give it directly the list
> of the contructors.If not can any one help on how should I go about
> it???

The Module FlatCurryGoodies provides auxiliary functions to process
FlatCurry programs. An functions that returns a list of all construtor
names that are defined in a program can be written as follows:

     import FlatCurry
     import FlatCurryGoodies

     constructorNames :: Prog -> [QName]
     constructorNames prog =
       [ name | typ <- progTypes prog, name <- consNames typ ]
       consNames typ =
        [ consName cons | not (isTypeSyn typ), cons <- typeConsDecls
typ ]


Underestimating the novelty of the future is a time-honored tradition.
curry mailing list
Received on Mi Jun 30 2010 - 10:43:07 CEST

This archive was generated by hypermail 2.3.0 : Mo Dez 04 2023 - 07:15:11 CET