{-# LANGUAGE OverloadedStrings, ImpredicativeTypes #-} data ImpredicativeList = Empty | forall a. Some a ImpredicativeList countThem :: ImpredicativeList -> Int countThem Empty = 0 countThem (Some _ xs) = 1 + countThem xs main :: IO () main = do print (countThem (Some True (Some 1 (Some 'a' Empty))))