Skip to content

Latest commit

 

History

History
27 lines (23 loc) · 602 Bytes

File metadata and controls

27 lines (23 loc) · 602 Bytes

hktu - HKT Utils

Collection of predefined transformers and Higher Kinded Types, utils

Examples

import { HKTU } from 'hktu';

// "Hello, world!"
type WithPipe = HKTU.Pipe<
  'hello42world',
  HKTU.string.Split<'42'>,
  HKTU.array.MapEx<
    HKTU.If<
      HKTU.value.IsAssignable<HKTU.types.ArrayItemInfo<string>, { index: 0 }>,
      HKTU.Compose<
        HKTU.object.Get<HKTU.types.ArrayItemInfo<string>, 'item'>,
        HKTU.string.Capitalize
      >,
      HKTU.object.Get<HKTU.types.ArrayItemInfo<string>, 'item'>
    >
  >,
  HKTU.array.Join<', '>,
  HKTU.string.Append<'!'>
>;