Skip to content

Instantly share code, notes, and snippets.

@joneshf
Created May 11, 2018 02:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save joneshf/238e42fbe4175436472947577222e4a4 to your computer and use it in GitHub Desktop.
Save joneshf/238e42fbe4175436472947577222e4a4 to your computer and use it in GitHub Desktop.
expand
module Main where
import Prelude
import Unsafe.Coerce
data FOO
data BAR
data BAZ
data Run (x :: # Type) a
type LessRows r = (foo :: FOO | r)
type MoreRows = (foo :: FOO, bar :: BAR, baz :: BAZ)
foo :: forall r. Run (LessRows r) Unit
foo = unsafeCoerce unit
foo' :: Run MoreRows Unit
foo' = expand foo
expand :: forall r1 r2 rx a. Union r1 rx r2 => Run r1 a -> Run r2 a
expand = unsafeCoerce
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment