on 1925e31 help sign in
elk/src/AST/Effects.hs
70 lines 1.0 kB history raw
1module AST.Effects where
3import Data.Text (Text)
5import qualified AST.Type as Type
6import qualified Elm.Package as Pkg
7import qualified Reporting.Annotation as A
8import qualified Reporting.Region as R
12-- EFFECTS
15data Effects pkg ports
16 = None
17 | Manager pkg Info
18 | Port ports
21type Raw =
22 Effects () [A.Commented PortRaw]
25type Canonical =
26 Effects Pkg.Name [A.Commented PortCanonical]
30-- EFFECT MANAGERS
33data Info =
34 Info
35 { _tag :: R.Region
36 , _init :: R.Region
37 , _onEffects :: R.Region
38 , _onSelfMsg :: R.Region
39 , _managerType :: ManagerType
40 }
43data ManagerType
44 = CmdManager (A.Located Text)
45 | SubManager (A.Located Text)
46 | FxManager (A.Located Text) (A.Located Text)
50-- FOREIGN EFFECTS
53data PortRaw =
54 PortRaw
55 { _rawName :: Text
56 , _rawType :: Type.Raw
57 }
60data PortCanonical =
61 PortCanonical
62 { _name :: Text
63 , _kind :: Kind
64 , _type :: Type.Canonical
65 }
68data Kind
69 = Outgoing Type.Canonical
70 | Incoming Type.Canonical