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
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:
-- 1 + 2 | |
-- (+) 1 2 | |
-- + (Just 1) (Just 2) | |
-- Monadic desugared | |
(Just 1) >>= (\x -> (Just 2) >>= \y -> return (x+y)) | |
-- Monadic sugar |