Skip to content

Instantly share code, notes, and snippets.

@mvaldesdeleon
Created August 12, 2018 09:36
Show Gist options
  • Save mvaldesdeleon/2e75713ef24e377b2341a9de9418cd3d to your computer and use it in GitHub Desktop.
Save mvaldesdeleon/2e75713ef24e377b2341a9de9418cd3d to your computer and use it in GitHub Desktop.
// -- EXAMPLE THAT WOULD BE WRONG
// -- wrongBurgerSpec :: IxBurgerBuilder Ready TopBunOn BurgerSpec
// -- wrongBurgerSpec = getEmptyPlate
// -- :>>= placeEmptyBun
// -- :>>= addKetchup
// -- :>>= addCheese -- Can't match PattyOn with BottomBunOn, since we haven't put on the patty, the most important part!!!
// -- :>>= addOnions
// -- :>>= noLettuce
// -- :>>= addTomato
// -- :>>= addTopBun
getEmptyPlate
.ichain(placeEmptyBun)
.ichain(addKetchup)
.ichain(addCheese) // Type '"PattyOn"' is not assignable to type '"BottomBunOn"'.
.ichain(addOnions)
.ichain(noLettuce)
.ichain(addTomato)
.ichain(addTopBun);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment