-- INBOUND

inbound :: String -> T.Port T.Canonical -> Expression ()
inbound name portType =
  case portType of
    T.Normal tipe ->
        _Port "inbound" `call`
            [ StringLit () name
            , StringLit () (show (RenderType.toDoc Map.empty tipe))
            , toTypeFunction tipe
            ]

    T.Signal _root arg ->
        _Port "inboundSignal" `call`
            [ StringLit () name
            , StringLit () (show (RenderType.toDoc Map.empty arg))
            , toTypeFunction arg
            ]
inbound :: String -> T.Port T.Canonical -> Expression ()
inbound name portType =
  case portType of
    T.Normal tipe ->
        _Port "inbound" `call`
            [ StringLit () name
            , StringLit () (show (RenderType.toDoc Map.empty tipe))
            , toTypeFunction tipe
            ]

    T.Signal _root arg ->
        _Port "inboundSignal" `call`
            [ StringLit () name
            , StringLit () (show (RenderType.toDoc Map.empty arg))
            , toTypeFunction arg
            ]
inbound name portType =
  case portType of
    T.Normal tipe ->
        _Port "inbound" `call`
            [ StringLit () name
            , StringLit () (show (RenderType.toDoc Map.empty tipe))
            , toTypeFunction tipe
            ]

    T.Signal _root arg ->
        _Port "inboundSignal" `call`
            [ StringLit () name
            , StringLit () (show (RenderType.toDoc Map.empty arg))
            , toTypeFunction arg
            ]