git.iko.soy/rowtype-yoga/purescript-native
on 3b68926 help sign in
46 lines 1.5 kB history raw
1-----------------------------------------------------------------------------
2--
3-- Module : Language.PureScript.Declarations
4-- Copyright : (c) Phil Freeman 2013
5-- License : MIT
6--
7-- Maintainer : Phil Freeman <paf31@cantab.net>
8-- Stability : experimental
9-- Portability :
10--
11-- |
12--
13-----------------------------------------------------------------------------
15{-# LANGUAGE DeriveDataTypeable #-}
17module Language.PureScript.Declarations where
19import Language.PureScript.Values
20import Language.PureScript.Types
21import Language.PureScript.Names
22import Language.PureScript.Kinds
24import qualified Data.Data as D
26type Precedence = Integer
28data Associativity = Infixl | Infixr deriving (Show, D.Data, D.Typeable)
30data Fixity = Fixity Associativity Precedence deriving (Show, D.Data, D.Typeable)
32data Module = Module ProperName [Declaration] deriving (Show, D.Data, D.Typeable)
34data Declaration
35 = DataDeclaration ProperName [String] [(ProperName, Maybe PolyType)]
36 | DataBindingGroupDeclaration [(ProperName, [String], [(ProperName, Maybe PolyType)])]
37 | TypeSynonymDeclaration ProperName [String] PolyType
38 | TypeDeclaration Ident PolyType
39 | ValueDeclaration Ident [[Binder]] (Maybe Guard) Value
40 | BindingGroupDeclaration [(Ident, Value)]
41 | ExternDeclaration Ident PolyType
42 | ExternMemberDeclaration String Ident PolyType
43 | ExternDataDeclaration ProperName Kind
44 | FixityDeclaration Fixity String
45 | ImportDeclaration ModuleName (Maybe [Either Ident ProperName])
46 deriving (Show, D.Data, D.Typeable)