// Nested components 3

/* Declare local identity with a delay */
component Identity(delay) token -> token {
  /* Use identity from standard lib */
  id : std.Identity()
  /* Use delay from standard lib */
  delay : std.Delay(delay=delay)

  .token > id.token
  id.token > delay.token
  delay.token > .token
}

component E() in -> out {
  /* Use Identity from standard lib */
  f:std.Identity()
  g:std.Identity()

  .in > f.token
  f.token > g.token
  g.token > .out
}

component B() in -> out {
  /* Use local identity */
  d:Identity(delay=0.1)
  e:E()

  .in > e.in
  e.out > d.token
  d.token > .out
}

a:std.Counter()
b:B()
c:test.Sink()

a.integer > b.in
b.out > c.token
