- expression-oriented programming one of the great advances of FP
- expressions plug together like legos, making more malleable programming experience in-the-small
Write in an expression-oriented style, scoping variables as locally as possible:
// Example of using multiple / nested `createEntityAdapter` calls within a single Redux Toolkit slice | |
interface Message { | |
id: string; | |
roomId: string; | |
text: string; | |
timestamp: string; | |
username: string; | |
} |
// Retrieves and recasts the body of an enum | |
func body<T, U>(of value: inout T) -> U { | |
return withUnsafePointer(to: &value) { | |
$0.withMemoryRebound(to: U.self, capacity: 1) { | |
$0.pointee | |
} | |
} | |
} |
<link rel='stylesheet' href='mobile.css' type='text/css' /> | |
<link rel='stylesheet' href='desktop.css' type='text/css' media='(min-width: 961px)' /> | |
<!--[if lt IE 9]> | |
<link rel='stylesheet' href='desktop.css' type='text/css' /> | |
<![endif]--> |