Hi Alexander,
> Prelude> :t foldr
> foldr :: Foldable t => (a -> b -> b) -> b -> t a -> b
> For example:
> foldr :: (a -> b -> b) -> b -> [a] -> b
> foldr :: (a -> b -> b) -> b -> Maybe a -> b
> foldr :: (a -> b -> b) -> b -> Identity a -> b
> foldr :: (a -> b -> b) -> b -> (c, a) -> b
> and more
>
> It is easy to see a pattern here. The order of the instances used could be the load order, so the ones from Prelude would come first.
interesting idea.
It's ":t" 's verbose representation mode.
The ghci represents true type (not lie) and
beginners may intuitively understand the relation between
Foldable type class and instances.
Beginners will be overcome FTP more easily.
> Prelude> :t ($)
> ($) :: <"unreadable blurb">
> For example:
> ($) :: (a -> b) -> a -> b
> ($) :: forall a (b :: #). (a -> b) -> a -> b
>
> At least one of those lines should be understandable.
It's one of the options.
But I feel that Levity (or RuntimeRep) is more deep than the type class.
They may feel difficult to understand the difference of two patterns in ($).
(If it will be long, it's better to separate thread =) )
Regards,
Takenobu