Skip to content

Instantly share code, notes, and snippets.

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 eric-corumdigital/4a4b6594c77e8274f900177e2fb989d8 to your computer and use it in GitHub Desktop.
Save eric-corumdigital/4a4b6594c77e8274f900177e2fb989d8 to your computer and use it in GitHub Desktop.
module Main where
import Data.NaturalTransformation (type (~>))
import Data.Symbol (class IsSymbol, SProxy)
import Prim.Row as Row
import Unsafe.Coerce (unsafeCoerce)
data VariantRF (s :: # Type) (r :: # Type) (a :: Type)
data RFProxy (f :: # Type -> Type -> Type) = RFProxy
newtype MuVariantRF r a = InVariantRF (VariantRF r r a)
inj :: forall u sym s r f
. Row.Cons sym (RFProxy f) u r
=> IsSymbol sym
=> SProxy sym
-> f s
~> VariantRF s r
inj = unsafeCoerce 0
--
on :: forall u sym f s r a b
. Row.Cons sym (RFProxy f) u r
=> IsSymbol sym
=> SProxy sym
-> (f s a -> b)
-> (VariantRF s u a -> b)
-> VariantRF s r a
-> b
on = unsafeCoerce 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment