dataframe-0.7.0.0: A fast, safe, and intuitive DataFrame library.
Safe HaskellNone
LanguageHaskell2010

DataFrame.Typed.Freeze

Synopsis

Safe boundary

freeze :: forall (cols :: [Type]). KnownSchema cols => DataFrame -> Maybe (TypedDataFrame cols) Source #

Validate that an untyped DataFrame matches the expected schema cols, then wrap it. Returns Nothing on mismatch.

freezeWithError :: forall (cols :: [Type]). KnownSchema cols => DataFrame -> Either Text (TypedDataFrame cols) Source #

Like freeze but returns a descriptive error message on failure.

Escape hatches

thaw :: forall (cols :: [Type]). TypedDataFrame cols -> DataFrame Source #

Unwrap a typed DataFrame back to the untyped representation. Always safe; discards type information.

unsafeFreeze :: forall (cols :: [Type]). DataFrame -> TypedDataFrame cols Source #

Wrap an untyped DataFrame without any validation. Used internally after delegation where the library guarantees schema correctness.