Re: [Haskell-cafe] Is there a name for this?

On 2015-03-09 11:26 AM, Ben Franksen wrote:
Albert Y. C. Lai wrote:
Choose one:
Foo' is a free Foo
Foo' is a limit of the diagram of Foo
Foo' is a terminal object of the [sub]category of Foo
Interesting. Is the last variant how "free <whatever>" is usually defined? Or is it a coincidence that the two, well, coincide here? I remember I have seen other definitions that looked a lot less easy to understand.
I have not checked, and too lazy to.
The usual "free" is the less-easy-to-understand one: you need a forgetful functor, then you need its left adjoint, and you call it your free functor. Then the target objects hit by the free functor are the free things. In general when talking about free things and adjunctions one must pay attention to what the functions are.
The original definition of class Foo was coalgebraic:
class Foo f where
bar :: f -> Bool
baz :: f -> Char -> Int
meaning that the functions take an f and make something else rather than taking something and constructing an f (like e.g. the (:) of lists does). With the definition
data Foo' = {
bar' :: Bool,
baz' :: Char -> Int}
one can re-write
class Foo f where
barbaz :: f -> Foo’
Objects of our category Foo are instances of Foo, that are pairs
participants (1)
-
Olaf Klinke