Skip to content

Instantly share code, notes, and snippets.

@kika
Created July 22, 2016 16:36
Show Gist options
  • Save kika/54a8ac517065eba29cc224254bdf5603 to your computer and use it in GitHub Desktop.
Save kika/54a8ac517065eba29cc224254bdf5603 to your computer and use it in GitHub Desktop.
module Main where
import Prelude
import Control.Monad.Eff
import Control.Monad.Eff.Console
type Config = {
debug::Boolean
}
type Params = {
config::Config
}
printParams::forall e.Params -> Eff (console::CONSOLE|e) Unit
printParams p =
log $ show p.config.debug
updateParams::Params -> Boolean -> Params
updateParams p debug =
p { config = p.config { debug }}
main = do
printParams $ updateParams {config: {debug: true}} false
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment