Skip to content
Vincent Aravantinos edited this page Jul 11, 2017 · 7 revisions

Scénario d'enculé

Data model

Soit la structure suivante :

A : { b : B }
B : { c :> C }
C : { name : String, d :> D }
D : { city : String }

Avec l'exemple suivant :

a =
{ b = [
  { c = id1 },
  { c = id2 },
  { c = id3 }
  ]
}
id1 = { name = "123", d = id4 }
id2 = { name = "Vincent", d = id5 }
id3 = { name = "", d = id6 }
id4 = { city = "456" }
id5 = { city = "86153" }
id6 = { city = "86150" }

Bindings

Binding 1:

\c:C ->
  if c.name != ""
  then c.name
  else c.d.city

Binding 2:

\a ->
  a.b.mapFilter (\b ->
    case intOfString(binding1(b.c).get())
    Just n ->
      Just stringOfInt (n+1)
    
    Nothing ->
      Nothing
 )

View

+-----------+
| [ 124   ] |
| [ 86151 ] |
+-----------+

Scenarios

Issues #11-#18 describe various scenarios of adding or changing various elements on server and client side.

Lessons learnt from the issues

  • binding needs to access other binding results
Clone this wiki locally