Skip to content

Instantly share code, notes, and snippets.

@joshcough
Forked from llelf/ip1.hs
Created March 3, 2016 16:12
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 joshcough/aa8b11cde0f0df3620d0 to your computer and use it in GitHub Desktop.
Save joshcough/aa8b11cde0f0df3620d0 to your computer and use it in GitHub Desktop.
{-# 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