heidi icon indicating copy to clipboard operation
heidi copied to clipboard

Couple Frame and Header

Open ocramz opened this issue 4 years ago • 1 comments

  • A Header is uniquely determined by the type of the input data
  • once data are encoded in a Frame, we compute a Header from the type (with header)
  • relational operations such as JOINs, and tidying operations produce dataframes that have a different (larger or smaller) column set than the one of either operands
  • this is why a new Header should be derived when producing the operation result, and stored in the resulting Frame

possible representation :

data Frame = Frame {
    frameRows :: [Row [TC] VP]
  , frameHeader :: Header [TC]
}

currently, the information in Header and Val is not compatible:

λ> gflattenHM $ MkC1 42
fromList [([TC "C" "c1"],42)]
λ> 
λ> header (Proxy @C)
HSum "C" (fromList [("MkC3",HLeaf "()"),("MkC1",HLeaf "Int"),("MkC2",HProd "A" (fromList [("MkA",HLeaf "Int")]))])

ocramz avatar Oct 20 '20 18:10 ocramz