Last active
August 24, 2017 09:29
-
-
Save Icelandjack/c67c26b9b1b6627dc685eff225fe9d2a to your computer and use it in GitHub Desktop.
TODO: Stuff
A tutorial on the universality and expressiveness of fold
uses
fold :: (α → β → β) → β → ([α] → β)
instead of
fold :: (a -> b -> b) -> b -> [a] -> b
-- or
fold :: (a -> b -> b) -> (b -> [a] -> b)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
generic-transformation transformer
fmap : (b. Term b => b -> b) -> (b. Term b => b -> b)
https://www.microsoft.com/en-us/research/wp-content/uploads/2003/01/hmap.pdf
6 Refinements and reflections
Having introduced the basics, we pause to reflect on the ideas a little and to make some modest generalisations.
6.1 An aside about types
It is worth noticing that the type of everywhere could equivalently
be written thus:
by moving the implicit
forall a
inwards. The nice thing about writing it this way is that it becomes clear thateverywhere
is a generic-transformation transformer. We might even write this:The same approach gives a more perspicuous type for everything: