module Language.PureScript.Declarations where
import Language.PureScript.Values
import Language.PureScript.Types
import Language.PureScript.Names
import Language.PureScript.Kinds
import qualified Data.Data as D
type Precedence = Integer
data Associativity = Infixl | Infixr deriving (Show, D.Data, D.Typeable)
data Fixity = Fixity Associativity Precedence deriving (Show, D.Data, D.Typeable)
data Module = Module ProperName [Declaration] deriving (Show, D.Data, D.Typeable)
data Declaration
= DataDeclaration ProperName [String] [(ProperName, Maybe Type)]
| DataBindingGroupDeclaration [(ProperName, [String], [(ProperName, Maybe Type)])]
| TypeSynonymDeclaration ProperName [String] Type
| TypeDeclaration Ident Type
| ValueDeclaration Ident [[Binder]] (Maybe Guard) Value
| BindingGroupDeclaration [(Ident, Value)]
| ExternDeclaration Ident Type
| ExternMemberDeclaration String Ident Type
| ExternDataDeclaration ProperName Kind
| FixityDeclaration Fixity String
| ImportDeclaration ModuleName (Maybe [Either Ident ProperName])
deriving (Show, D.Data, D.Typeable)