isovector / reasonablypolymorphic.com

⏳ my math blog
http://reasonablypolymorphic.com
BSD 3-Clause "New" or "Revised" License
23 stars 11 forks source link

blog/typeholes/ #35

Open utterances-bot opened 1 year ago

utterances-bot commented 1 year ago

Implement With Types, Not Your Brain! :: Reasonably Polymorphic

https://reasonablypolymorphic.com/blog/typeholes/

johannes-riecken commented 1 year ago

Is there any widely applicable rule so that I don't come up with this inferior definition of zoop? It also matches all arguments, provably terminates and has the same type as foldr.

zoop abb b [] = b zoop abb b (a:as) = zoop abb (abb a b) as

isovector commented 1 year ago

@johannes-riecken you wrote foldl, which is just as good!