@@ -25,10 +25,10 @@ data Query a
2525 = UpdateText a
2626
2727type State =
28- { text :: String
28+ { text ∷ String
2929 }
3030
31- initialState :: State
31+ initialState ∷ State
3232initialState =
3333 { text : " Name: Ace Editor"
3434 }
@@ -38,38 +38,38 @@ type AceSlot = Unit
3838type StateP g = H.ParentState State AceState Query AceQuery g AceSlot
3939type QueryP = Coproduct Query (H.ChildF AceSlot AceQuery )
4040type MainHtml g = H.ParentHTML AceState Query AceQuery g AceSlot
41- type MainEffects = H.HalogenEffects (random :: RANDOM , now :: NOW , ref :: REF , ace :: ACE )
41+ type MainEffects = H.HalogenEffects (random ∷ RANDOM , now ∷ NOW , ref ∷ REF , ace ∷ ACE )
4242type MainAff = Aff MainEffects
4343type MainDSL = H.ParentDSL State AceState Query AceQuery MainAff AceSlot
4444
45- ui :: H.Component (StateP MainAff ) QueryP MainAff
45+ ui ∷ H.Component (StateP MainAff ) QueryP MainAff
4646ui = H .parentComponent { render, eval, peek: Just (peek <<< H .runChildF) }
4747 where
4848
49- render :: State -> MainHtml MainAff
49+ render ∷ State → MainHtml MainAff
5050 render state =
5151 HH .div_
5252 [ HH.Slot $ aceConstructor unit (initEditor state) Nothing
5353 , HH .div_ [ HH .text state.text ]
5454 ]
5555
56- initEditor :: State -> Editor -> MainAff Unit
56+ initEditor ∷ State → Editor → MainAff Unit
5757 initEditor state editor = liftEff $ do
58- session <- Editor .getSession editor
58+ session ← Editor .getSession editor
5959 Session .setMode " ace/mode/yaml" session
6060 Editor .setValue state.text Nothing editor
6161 pure unit
6262
63- eval :: Query ~> MainDSL
63+ eval ∷ Query ~> MainDSL
6464 eval (UpdateText next) =
6565 pure next
6666
67- peek :: forall x . AceQuery x -> MainDSL Unit
67+ peek ∷ forall x . AceQuery x → MainDSL Unit
6868 peek (TextChanged _) = do
69- text <- H .query unit $ H .request GetText
69+ text ← H .query unit $ H .request GetText
7070 H .modify (_ { text = fromMaybe " " text })
7171 peek _ =
7272 pure unit
7373
74- main :: Eff MainEffects Unit
74+ main ∷ Eff MainEffects Unit
7575main = runHalogenAff $ H .runUI ui (H .parentState initialState) =<< awaitBody
0 commit comments