This file contains hidden or 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
| mysql> SELECT title, genre, count(*) FROM films GROUP BY genre; | |
| +-------------------+----------+----------+ | |
| | title | genre | count(*) | | |
| +-------------------+----------+----------+ | |
| | Arrival | scifi | 1 | | |
| | Blade Runner 2049 | thriller | 2 | | |
| +-------------------+----------+----------+ |
This file contains hidden or 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
| mysql> SELECT title, genre, count(*) FROM films GROUP BY genre; | |
| ERROR 1055 (42000): Expression #1 of SELECT list is not in GROUP BY clause and contains nonaggregated column 'some_database.films.title' which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sql_mode=only_full_group_by |
This file contains hidden or 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
| const procedural = s => { | |
| try { | |
| const parsed = JSON.parse(s); | |
| if (parsed.length > 0) { | |
| const first = parsed[0] | |
| const upperCased = first.toUpperCase() | |
| return upperCased.concat('!') | |
| } else { | |
| return "empty array" | |
| } |
This file contains hidden or 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
| const format = s => Right(s).map(upper).map(shout) | |
| const functional = s => Right(s).chain(parse).chain(first).chain(format) | |
| functional('["hello", "world"]') | |
| // Right(HELLO!) |
This file contains hidden or 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
| const format = array => { | |
| if (array.length > 0) { | |
| return array[0].toUpperCase().concat('!') | |
| } else { | |
| return "empty array" | |
| } | |
| } | |
| const procedural = s => { | |
| try { |
This file contains hidden or 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
| const format = array => { | |
| if (array.length > 0) { | |
| return array[0].toUpperCase().concat('!') | |
| } else { | |
| return "empty array" | |
| } | |
| } | |
| const procedural = (s, callback) => { | |
| try { |
This file contains hidden or 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
| const Box = x => | |
| ({ | |
| x | |
| }) | |
| const primitive = 1 | |
| const boxedPrimitive = Box(1) |
This file contains hidden or 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
| const Box = x => | |
| ({ | |
| x, | |
| map: f => Box(f(x)) | |
| }) | |
| const primitive = 1 | |
| const sum1 = primitive + 2 // 3 | |
| const boxedPrimitive = Box(1) |
This file contains hidden or 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
| const Box = x => | |
| ({ | |
| x, | |
| map: f => Box(f(x)), | |
| chain: f => f(x) | |
| }) | |
| const boxedPrimitive = Box(1) | |
| const sum = boxedPrimitive.chain(x => x + 2) // 3 |
This file contains hidden or 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
| const Right = x => | |
| ({ | |
| x, | |
| map: f => Right(f(x)), | |
| chain: f => f(x) | |
| }) | |
| const Left = x => | |
| ({ | |
| x, |