Skip to content

Instantly share code, notes, and snippets.

@classmember
Last active November 18, 2019 20:07
Show Gist options
  • Select an option

  • Save classmember/fa25481c9aae263c0764ab34f4aacd6b to your computer and use it in GitHub Desktop.

Select an option

Save classmember/fa25481c9aae263c0764ab34f4aacd6b to your computer and use it in GitHub Desktop.
# https://probablydance.com/2016/02/27/functional-programming-is-not-popular-because-it-is-weird/
# Banana Cake recipe
# source: http://allrecipes.com/Recipe/A-Number-1-Banana-Cake/
#
# 1. Preheat oven to 175 degrees C. Grease and flour 2 – 8 inch round pans.
# In a small bowl, whisk together flour, baking soda and salt; set aside.
#
# 2. In a large bowl, cream butter, white sugar and brown sugar until light and fluffy.
# Beat in eggs, one at a time. Mix in the bananas. Add flour mixture alternately
# with the buttermilk to the creamed mixture.
# Stir in chopped walnuts.
# Pour batter into the prepared pans.
#
# 3. Bake in the preheated oven for 30 minutes.
# Remove from oven, and place on a damp tea towel to cool.
#
def ready_pan():
return greased( floured( 'pan' ) )
def prepared_toppings():
return stirred( chopped( 'walnuts' )
def creamed_definition():
return creamed_until( 'fluffy', 'butter', 'white sugar', 'brown sugar' )
def cake_batter():
return alternating_mixed(
'buttermilk',
whisked( 'flour', 'baking soda', 'salt' ),
mixed( 'bananas', 'eggs', creamed_definition() )
)
cake = cooled(
removed_from_oven(
added_to( '30min',
poured( ready_pan() ,
prepared_toppings() ,
cake_batter() ,
preheated( '175C', 'oven' )
)
)
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment