Skip to content

Instantly share code, notes, and snippets.

@cab
Created January 21, 2016 21:21
Show Gist options
  • Save cab/62d9475053ae2b3c681e to your computer and use it in GitHub Desktop.
Save cab/62d9475053ae2b3c681e 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