Intro to Higher Kinded Types in Haskell

Higher Kinded Types (HKT) is known in Haskell as the type of types. In some way they give us the power of generics of other languages such as Java but with much more flexibility and seamlessly integrated in the language. Why? Let’s see it through code.

A List<T> in Java is a list that contains things of T type. A Map<K, V> will contain keys of K type mapped to values of V type. The meaning of those generics in this particular case is that they allow us to define the specific type of our list or map, so we can define a List<String>, List<User>, Map<Long, User>