Skip to content

Instantly share code, notes, and snippets.

/*
To replicate:
type SuperArrow<'a, 'b> =
| Fn of (('a -> 'b) * string)
| Compose of SuperArrowCompose<'a,'b>
and SuperArrowCompose<'a,'b> =
abstract member eval : SuperArrowComposeEvaluator<'a, 'b, 'r> -> 'r
and SuperArrowComposeEvaluator<'a, 'b, 'r> =
abstract member apply<'c> : SuperArrow<'a, 'c> -> SuperArrow<'c, 'b> -> 'r
@emcake
emcake / applicative-builders.fs
Last active February 15, 2021 15:10
Applicative builders in F# by abusing For and IsLikeZip
type ListBuilder() =
/// map
member x.For(l,f) =
List.map f l
/// id
member x.Yield(v) =
v
using System;
interface Generator<A,Y,R>
where Y : struct
where R : struct
{
unsafe bool Resume(A a, System.Span<Y> y, System.Span<R> r);
}
struct None {
import prefect
from prefect import Flow, task, Task, case, Parameter
from prefect.environments import LocalEnvironment
from prefect.environments.storage import S3
from prefect.tasks.prefect import FlowRunTask
from prefect.tasks.control_flow import merge
from prefect.engine.results import PrefectResult
@task
import prefect
from prefect import Flow, task, Task, case, Parameter
from prefect.environments import LocalEnvironment
from prefect.environments.storage import S3
from prefect.tasks.prefect import FlowRunTask
from prefect.tasks.control_flow import merge
from prefect.engine.results import PrefectResult
with Flow('subflow-one') as subflow_one:
x = Parameter('x')
@emcake
emcake / merge.ipynb
Created November 28, 2023 22:12
Merging DeltaTables
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
from deltalake import DeltaTable, write_deltalake
import pandas as pd
delta_path = f"/tmp/table-conflict-test"
print(delta_path)
write_deltalake(
delta_path,
pd.DataFrame.from_dict(