on 1925e31 help sign in
elk/src/Docs/AST.hs
46 lines 852 B history raw
1module Docs.AST where
3import qualified Data.Map as Map
4import Data.Text (Text)
6import qualified Elm.Compiler.Type as Type
7import qualified Reporting.Annotation as A
10-- FULL DOCUMENTATION
12data Docs t =
13 Docs
14 { comment :: Text
15 , aliases :: Map.Map Text (A.Located Alias)
16 , types :: Map.Map Text (A.Located Union)
17 , values :: Map.Map Text (A.Located (Value t))
18 }
21type Centralized = Docs (Maybe Type.Type)
23type Checked = Docs Type.Type
26-- VALUE DOCUMENTATION
28data Alias = Alias
29 { aliasComment :: Maybe Text
30 , aliasArgs :: [Text]
31 , aliasType :: Type.Type
32 }
35data Union = Union
36 { unionComment :: Maybe Text
37 , unionArgs :: [Text]
38 , unionCases :: [(Text, [Type.Type])]
39 }
42data Value t = Value
43 { valueComment :: Maybe Text
44 , valueType :: t
45 , valueAssocPrec :: Maybe (Text,Int)
46 }