A Bank implementation in Haskell.
All Lemmas proven using PVS in my Lab5.
There's a very big difference between the following two lines.
b1 <- deposit b1 10
b1 = deposit b1 10
One executes the function then stores it, the other scores the function definition. A similar example in javascript is as follows:
var action = function() { ... }
var equals = action
var monad = action()
To use the <-
you need to return a monad. I just so happens that using either the return
function or the pure
function will allow this to happen. So when defining a function which we'd like to reassign to a value, make sure to use the return
function!
Copyright © 2016 Skyler Layne