Skip to content

Instantly share code, notes, and snippets.

@cab
Created January 21, 2016 21:23
Show Gist options
  • Save cab/c0615cc0d2d1459e5d79 to your computer and use it in GitHub Desktop.
Save cab/c0615cc0d2d1459e5d79 to your computer and use it in GitHub Desktop.
// where `A` is a type and `a` is an instance of that type
data = (
(a, b, c),
(a, b),
(a, c, d),
(b, c, d, e),
(b, a),
(c, a, f, d),
(b, a, c)
)
find[A](data) = (
(a, b, c),
(a, b),
(a, c, d),
(b, a),
(c, a, f, d),
(b, a, c)
)
find[A :: B](data) = (
(a, b, c),
(a, b),
(b, a),
(b, a, c)
)
find[A :: F :: C] = (
(c, a, f, d)
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment