To make below listed activites simple (from SCM point of view)
- Adding new features
- Fixing bugs
- Preparing for release
- Deploying to production
- Applying hotfixes
- Versioning
| def can_user_act_on_document(user, document, action): | |
| if user.is_admin: | |
| return True | |
| if action == "view": | |
| return document.owner_id == user.id | |
| if action == "edit": | |
| return document.owner_id == user.id | |
| return False # unknown action | |
| # growing conditionals and nested logic |
| trait Summable { | |
| fn zero() -> Self; | |
| fn add(&self, other: &Self) -> Self; | |
| } | |
| impl Summable for i32 { | |
| fn zero() -> Self { | |
| 0 | |
| } | |
| fn add(&self, other: &Self) -> Self { |
| # Problem Statement | |
| # cons(a, b) constructs a pair, and car(pair) and cdr(pair) returns the first and last element of that pair. | |
| # For example, car(cons(3, 4)) returns 3, and cdr(cons(3, 4)) returns 4. | |
| # Given the below implementation for cons( ), please implement car & cdr | |
| def cons(a, b): | |
| def pair(f): | |
| return f(a, b) | |
| return pair |
| data Point = Pt Int Int | |
| data Expr a = Number Integer | Boolean Bool |
| {-# LANGUAGE TypeFamilies | |
| , DataKinds | |
| , PolyKinds | |
| , TypeInType | |
| , TypeOperators | |
| , UndecidableInstances | |
| , RankNTypes | |
| #-} | |
| {-# LANGUAGE RankNTypes #-} | |
| module RankN where | |
| -- Rank 0: | |
| -- add1 is momomorphic | |
| add1 :: Int -> Int | |
| add1 x = x + 1 | |
| -- Rank 1 |
I hereby claim:
To claim this, I am signing this object: