| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
DataFrame.Typed.Freeze
Synopsis
- freeze :: forall (cols :: [(Symbol, Type)]). KnownSchema cols => DataFrame -> Maybe (TypedDataFrame cols)
- freezeWithError :: forall (cols :: [(Symbol, Type)]). KnownSchema cols => DataFrame -> Either Text (TypedDataFrame cols)
- freezeOrThrow :: forall (cols :: [(Symbol, Type)]). KnownSchema cols => DataFrame -> IO (TypedDataFrame cols)
- thaw :: forall (cols :: [(Symbol, Type)]). TypedDataFrame cols -> DataFrame
- unsafeFreeze :: forall (cols :: [(Symbol, Type)]). DataFrame -> TypedDataFrame cols
- class ToDataFrame f where
- toDataFrame :: f -> DataFrame
Safe boundary
freeze :: forall (cols :: [(Symbol, 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 :: [(Symbol, Type)]). KnownSchema cols => DataFrame -> Either Text (TypedDataFrame cols) Source #
Like freeze but returns a descriptive error message on failure.
freezeOrThrow :: forall (cols :: [(Symbol, Type)]). KnownSchema cols => DataFrame -> IO (TypedDataFrame cols) Source #
Validate and wrap like freezeWithError, but throw a DataFrameException
in IO on mismatch. The throwing boundary used by the typed readers
(readCsv / readParquet).
Escape hatches
thaw :: forall (cols :: [(Symbol, Type)]). TypedDataFrame cols -> DataFrame Source #
Unwrap a typed DataFrame back to the untyped representation. Always safe; discards type information.
unsafeFreeze :: forall (cols :: [(Symbol, Type)]). DataFrame -> TypedDataFrame cols Source #
Wrap an untyped DataFrame without any validation. Used internally after delegation where the library guarantees schema correctness.
Frame coercion
class ToDataFrame f where Source #
Methods
toDataFrame :: f -> DataFrame Source #
Instances
| ToDataFrame DataFrame Source # | |
Defined in DataFrame.Typed.Freeze Methods toDataFrame :: DataFrame -> DataFrame Source # | |
| ToDataFrame (TypedDataFrame cols) Source # | |
Defined in DataFrame.Typed.Freeze Methods toDataFrame :: TypedDataFrame cols -> DataFrame Source # | |