Lists as least fixed point of a functor

561 views Asked by At

I thought I understood Haskell's lists, until I stumbled recently on recursive infinite lists, such as

let idList = 0 : (map (+1) idList)

which is the infinite list of numbers 0, 1, 2, ...

Now I wonder what is the mathematical definition of Haskell's recursive data types like lists and trees. This article about F-algebras mentions "Types defined by using least fixed point construct with functor F can be regarded as an initial F-algebra, provided that parametricity holds for the type.".

Is this where Haskell's types come from ?

0

There are 0 answers