devalias.net icon indicating copy to clipboard operation
devalias.net copied to clipboard

[DeepDive] Typesafe/functional JavaScript (TypeScript, PureScript, Sanctuary, Folktale, Ramda, Scala.js, etc)

Open 0xdevalias opened this issue 4 years ago • 0 comments

TypeScript

  • https://www.typescriptlang.org/
    • https://www.typescriptlang.org/docs/home.html
    • https://www.typescriptlang.org/docs/handbook/typescript-in-5-minutes.html
    • https://www.typescriptlang.org/docs/handbook/tsconfig-json.html
    • Types
      • https://www.typescriptlang.org/docs/handbook/basic-types.html
      • https://www.typescriptlang.org/docs/handbook/advanced-types.html
      • https://www.typescriptlang.org/docs/handbook/utility-types.html
    • https://www.typescriptlang.org/docs/handbook/release-notes/overview.html
      • https://www.typescriptlang.org/docs/handbook/release-notes/typescript-3-8.html
  • https://github.com/microsoft/TypeScript

Patterns

  • Type Guards
    • https://www.typescriptlang.org/docs/handbook/advanced-types.html#type-guards-and-differentiating-types
      • A type guard is some expression that performs a runtime check that guarantees the type in some scope

      • user defined: foo is bar
      • in
      • typeof
      • instanceof
  • Discriminated union types (switch case, case matching)
    • https://www.typescriptlang.org/docs/handbook/advanced-types.html#discriminated-unions
  • Creating types from values in array
    • https://github.com/microsoft/TypeScript/issues/28046#issuecomment-480516434
      • https://github.com/Microsoft/TypeScript/wiki/What's-new-in-TypeScript#const-assertions
      • https://www.typescriptlang.org/docs/handbook/release-notes/typescript-3-4.html#const-assertions
    • https://github.com/microsoft/TypeScript/issues/28046#issuecomment-607145719
    • https://github.com/piotrwitek/utility-types#elementtypet-k
      • $ElementType<T, K>

Blogs, libraries, etc

  • https://github.com/piotrwitek/utility-types
    • Collection of utility types, complementing TypeScript built-in mapped types and aliases (think "lodash" for static types)

  • https://blog.logrocket.com/pattern-matching-and-type-safety-in-typescript-1da1231a2e34/
    • https://github.com/gcanti?tab=repositories
      • https://github.com/gcanti/fp-ts
        • Functional programming in TypeScript

        • https://gcanti.github.io/fp-ts/
        • https://github.com/gcanti/fp-ts-contrib
        • https://github.com/giogonzo/fp-ts-ramda
        • https://github.com/gcanti/fp-ts-local-storage
      • https://github.com/gcanti/io-ts
        • Runtime type system for IO decoding/encoding

        • https://gcanti.github.io/io-ts/
        • https://github.com/gcanti/io-ts-types
        • https://github.com/gcanti/io-ts-codegen
      • https://github.com/gcanti/tcomb
        • Type checking and DDD for JavaScript

        • https://github.com/gcanti/tcomb-validation
        • https://github.com/gcanti/tcomb-react
        • https://github.com/gcanti/tcomb-form
        • https://github.com/gcanti/babel-plugin-tcomb
      • https://github.com/gcanti/elm-ts
      • https://github.com/gcanti/prop-types-ts
      • https://github.com/gcanti/logging-ts
      • https://github.com/gcanti/monocle-ts
      • https://github.com/gcanti/typelevel-ts
      • https://github.com/gcanti/scala-ts
      • https://github.com/gcanti/graphics-ts
      • https://github.com/gcanti/retry-ts
      • https://github.com/gcanti/money-ts
      • https://github.com/gcanti/fcomb
      • https://github.com/freight-hub/TypedEnv
  • https://github.com/typestack
    • https://github.com/typestack/class-validator

PureScript

A strongly-typed functional programming language that compiles to JavaScript

  • https://www.purescript.org/
    • https://github.com/purescript/purescript
    • https://github.com/purescript/documentation
      • https://github.com/purescript/documentation/blob/master/guides/Getting-Started.md

Sanctuary.js

Sanctuary is a JavaScript functional programming library inspired by Haskell and PureScript. It's stricter than Ramda, and provides a similar suite of functions.

  • https://sanctuary.js.org/
  • https://github.com/sanctuary-js/sanctuary
    • https://github.com/sanctuary-js/sanctuary#-folktale
      • Folktale, like Sanctuary, is a standard library for functional programming in JavaScript. It is well designed and well documented. Whereas Sanctuary treats JavaScript as a member of the ML language family, Folktale embraces JavaScript's object-oriented programming model. Programming with Folktale resembles programming with Scala.

Folktale

A standard library for functional programming in JavaScript

  • https://folktale.origamitower.com/
    • https://folktale.origamitower.com/blog/
    • https://folktale.origamitower.com/code/
    • https://folktale.origamitower.com/docs/v2.3.0/
  • https://github.com/origamitower/folktale

Ramda

A practical functional library for JavaScript programmers.

  • https://ramdajs.com/
    • https://github.com/ramda/ramda

Scala.js

Scala.js, the Scala to JavaScript compiler

  • http://www.scala-js.org/
  • https://github.com/scala-js/scala-js
  • https://github.com/scala-js/scala-js-dom

0xdevalias avatar Apr 02 '20 02:04 0xdevalias