-
-
Save joshcough/aa8b11cde0f0df3620d0 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
{-# LANGUAGE GADTs, ConstraintKinds, Rank2Types, ImplicitParams #-} | |
data Rec fields where | |
Rec :: fields => Rec fields | |
infixr 1 ? | |
(?) :: Rec fields -> (fields => r) -> r | |
Rec ? e = e | |
record :: Rec (?a :: Int, ?b :: String) | |
record = Rec where ?a=42 | |
?b="hey" | |
access :: Int | |
access = record ? ?a | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment