Skip to content

Gomah/HOTScript

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

HOTScript

A lodash-like library for types, with support for type-level lambda functions.

🚧 work in progress 🚧

// prettier-ignore
type result = Pipe<
  //  ^? 78
  [1, 2, 3, 4, 3, 4],
  [
    T.Map<Add<3>>,
    S.Join<'.'>,
    S.Split<'.'>,
    T.Map<S.ToNumber>,
    T.Map<N.Add<10>>,
    T.Sum
  ]
>;

// This is a type-level lambda!
interface Duplicate extends Fn {
  output: [this["args"][0], this["args"][0]];
}

type result = Call<T.FlatMap<Duplicate>, [1, 2, 3, 4]>;
//     ^? [1, 1, 2, 2, 3, 3, 4, 4]

TODO

  • Composition
    • Pipe
    • PipeRight
    • Call
    • Apply
  • Tuples
    • Zip
    • Partition
    • Head
    • Tail
    • Last
    • FlatMap
    • Find
    • Sum
    • Drop n
    • Take n
    • TakeWhile
    • Join separator
    • Map
    • Filter
    • Reduce
    • ReduceRight
  • Object
    • FromEntries
    • Entries
    • MapValues
    • MapKeys
    • GroupBy
    • Assign
    • Pick
    • PickBy
    • Omit
    • OmitBy
  • Union
    • Assign
    • FromEntries
    • Entries
    • Extract
    • ExtractBy
    • Exclude
    • ExcludeBy
  • String
    • Concat
    • Uppercase
    • Lowercase
    • Capitalize
    • Uncapitalize
    • Split separator
    • Words
    • Reduce

About

Type-level madness

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • TypeScript 99.6%
  • JavaScript 0.4%