Last active
July 30, 2018 18:12
-
-
Save eric-corumdigital/4a4b6594c77e8274f900177e2fb989d8 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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