Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
GHC 8.0 TypeApplication
{-# LANGUAGE TypeApplications #-}
elem1 ::
(Eq a, Foldable t) => a -> t a -> Bool
elem1 =
elem
elem2 ::
(Foldable t, Eq a) => a -> t a -> Bool
elem2 =
elem
e ::
Char -> String -> Bool
e =
-- changing elem1 to elem2 will fail the compiler.
elem1 @Char @[]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment