Skip to content

Instantly share code, notes, and snippets.

@milesrout
Created October 18, 2018 10:50
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 milesrout/625de4852f7756e9e6443a88f637fc08 to your computer and use it in GitHub Desktop.
Save milesrout/625de4852f7756e9e6443a88f637fc08 to your computer and use it in GitHub Desktop.
data X = X { _y :: Y }
data Y = Y1 { _y1 :: Int }
| Y2 { _y2 :: String }
x1 = X (Y1 0)
x2 = X (Y2 "Hello")
i1 = x1^.y.y1 -- error ??
i2 = x2^.y.y1 -- error ??
s1 = x1^.y.y2
s2 = x2^.y.y2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment