on f34b150 help sign in
elk/compiler/SourceSyntax/Declaration.hs
25 lines 650 B history raw
1{-# LANGUAGE DeriveDataTypeable #-}
2module SourceSyntax.Declaration where
4import Data.Data
5import qualified SourceSyntax.Expression as Expr
6import SourceSyntax.Type
8data Declaration tipe var
9 = Definition (Expr.Def tipe var)
10 | Datatype String [String] [(String,[Type])]
11 | TypeAlias String [String] Type
12 | ImportEvent String (Expr.LExpr tipe var) String Type
13 | ExportEvent String String Type
14 | Fixity Assoc Int String
15 deriving (Eq, Show)
17data Assoc = L | N | R
18 deriving (Eq)
20instance Show Assoc where
21 show assoc =
22 case assoc of
23 L -> "left"
24 N -> "non"
25 R -> "right"