| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
DataFrame.Typed.Freeze
Contents
Synopsis
- freeze :: forall (cols :: [Type]). KnownSchema cols => DataFrame -> Maybe (TypedDataFrame cols)
- freezeWithError :: forall (cols :: [Type]). KnownSchema cols => DataFrame -> Either Text (TypedDataFrame cols)
- thaw :: forall (cols :: [Type]). TypedDataFrame cols -> DataFrame
- unsafeFreeze :: forall (cols :: [Type]). DataFrame -> TypedDataFrame cols
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.