Not only does you lack some parens around your patterns, your function types are wrong : type Key = String data EnvItem a = EnvItem (Key, a) envKey :: EnvItem a -> String envKey (EnvItem (key, value)) = key envValue :: EnvItem a -> a envValue (EnvItem (key, value)) = value -- Jedaï