loading...
markdown guide
 

Cool stuff. Haskell is such a pleasure to use.

A few notes:

No arrays in functional JS? Why the heck not?

const head = ([x, ...xs]) => x
const tail = ([x, ...xs]) => xs

head([1, 2, 3]) // 1
tail([1, 2, 3]) // [2, 3]

I've done plenty of functional js that used the array built-in. Since dynamism is one of JS's strengths, why throw it out?

import { All, Any, mreduceMap, compose, propOr, not, isArray } from 'crocks'

const includes = x => xs => isArray(xs) && xs.includes(x)

const isAdmin = compose(includes('admin'), propOr([], 'roles'))

const areAllAdmins = mreduceMap(All, isAdmin)
const noneAreAdmins = not(mreduceMap(Any, isAdmin))

areAllAdmins([
  {name: 'Anton', roles: ['author', 'admin']},
  {name: 'Ben', roles: ['author', 'founder', 'admin']},
]) // true

noneAreAdmins([
  {name: 'Bill', roles: ['author']},
  {name: 'Ben', roles: ['author', 'founder', 'admin']},
]) // false
 

Even though he explained it really well, I see why it's not popular, because like too many limitations and we hooomans don't like to have any limit.

He explained the limitations and their workarounds. Such FP is for PROs. :D

Good video, thanks for sharing.

 

These limitations only seem to be limitations. I used to be afraid of Haskell. Until recently I went to edx.org and pulled out their old course on FP with Eric Meijer. It's actually not intimidating. In Haskell you don't have to explicitly write
\x -> (y -> (z -> x + y + z)))
you can just write
\x y z -> x + y + z

When I first saw the video I thought the same way. Then it dawned on me that the point was to just introduce PURE functional programming through JS. It is tedious and feels limiting to write PURE FP in JS but it's different in Haskell (or other FP languages), that's the point.

 

JS is not a good language for trying to do "pure FP". However, Elm is a language that is ML inspired, and transpiles to JS.

Elm is undergoing a lot of change as it evolves. It's at 0.19, but still worthy of taking a serious look at it. Even for production, depending on one's production qualifications.

 
 
 

So you can hear the volume and clarity of your voice through the microphone and can adjust your voice/proximity to the microphone.

Classic DEV Post from Jun 9 '19

Top 5 Soft Skills for Software Engineer

Soft skills are as critical as technical skills for a software engineer. No one works in isolation. Each person has to deal with teammates, colleagues, managers, etc. Therefore team interpersonal skills are essential too. Soft skills include things like good communication, honesty, teamwork, integrity, organization, empathy, etc.

Anton profile image
Born into being.