Last active
May 2, 2017 17:10
-
-
Save elliotpotts/f04fff8dc4a54f74473c726900d88e90 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
type Var = String | |
type Z = Int | |
type State = Var -> Z | |
emptyState :: State | |
emptyState = const 0 | |
assign :: State -> Var -> Z -> State | |
assign oldst name var x = if x == name then value else oldst x | |
assign' :: State -> Var -> Z -> State | |
assign' oldst name var = \x -> if x == name then value else oldst x |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment