on f232da4 help sign in
elk/src/AST/Effects.hs
80 lines 1.2 kB history raw
1{-# OPTIONS_GHC -Wall #-}
2module AST.Effects
3 ( Effects(..), Raw, Canonical
4 , Info(..)
5 , RawManagerType(..), ManagerType(..)
6 , PortRaw(..), PortCanonical(..), Kind(..)
7 )
8 where
10import Data.Text (Text)
12import qualified AST.Type as Type
13import qualified Elm.Package as Pkg
14import qualified Reporting.Annotation as A
15import qualified Reporting.Region as R
19-- EFFECTS
22data Effects pkg ports
23 = None
24 | Manager pkg Info
25 | Port ports
28type Raw =
29 Effects () [A.Commented PortRaw]
32type Canonical =
33 Effects Pkg.Name [A.Commented PortCanonical]
37-- EFFECT MANAGERS
40data Info =
41 Info
42 { _tag :: R.Region
43 , _init :: R.Region
44 , _onEffects :: R.Region
45 , _onSelfMsg :: R.Region
46 , _managerType :: RawManagerType
47 }
50data RawManagerType
51 = CmdManager (A.Located Text)
52 | SubManager (A.Located Text)
53 | FxManager (A.Located Text) (A.Located Text)
56data ManagerType = Cmds | Subs | Both
60-- FOREIGN EFFECTS
63data PortRaw =
64 PortRaw
65 { _rawName :: Text
66 , _rawType :: Type.Raw
67 }
70data PortCanonical =
71 PortCanonical
72 { _name :: Text
73 , _kind :: Kind
74 , _type :: Type.Canonical
75 }
78data Kind
79 = Outgoing Type.Canonical
80 | Incoming Type.Canonical