Skip to content
Skillv1.0.0

fp-pipe-ref

Quick reference for pipe and flow. Use when user needs to chain functions, compose operations, or build data pipelines in fp-ts.

by Youssef-Ashraf2099(0) 0 installs
Free
Sign in to install

Free account. Installing gives you the manifest plus copy-paste snippets.

See reviews

About

Imported from Youssef-Ashraf2099/World-war-stratagy (.github/skills/fp-pipe-ref/SKILL.md). Install upstream with npx skills add Youssef-Ashraf2099/World-war-stratagy --skill fp-pipe-ref. Copyright stays with the author.

pipe & flow Quick Reference

pipe - Transform a Value

import { pipe } from 'fp-ts/function'

// pipe(startValue, fn1, fn2, fn3)
// = fn3(fn2(fn1(startValue)))

const result = pipe(
  '  hello world  ',
  s => s.trim(),
  s => s.toUpperCase(),
  s => s.split(' ')
)
// ['HELLO', 'WORLD']

flow - Create Reusable Pipeline

import { flow } from 'fp-ts/function'

// flow(fn1, fn2, fn3) returns a new function
const process = flow(
  (s: string) => s.trim(),
  s => s.toUpperCase(),
  s => s.split(' ')
)

process('  hello world  ') // ['HELLO', 'WORLD']
process('  foo bar  ')     // ['FOO', 'BAR']

When to Use

Use When
pipe Transform a specific value now
flow Create reusable transformation

With fp-ts Types

import * as O from 'fp-ts/Option'
import * as A from 'fp-ts/Array'

// Option chain
pipe(
  O.fromNullable(user),
  O.map(u => u.email),
  O.getOrElse(() => 'no email')
)

// Array chain
pipe(
  users,
  A.filter(u => u.active),
  A.map(u => u.name)
)

Common Pattern

// Data last enables partial application
const getActiveNames = flow(
  A.filter((u: User) => u.active),
  A.map(u => u.name)
)

// Reuse anywhere
getActiveNames(users1)
getActiveNames(users2)

Limitations

  • Use this skill only when the task clearly matches the scope described above.
  • Do not treat the output as a substitute for environment-specific validation, testing, or expert review.
  • Stop and ask for clarification if required inputs, permissions, safety boundaries, or success criteria are missing.

Use it

Copy one of these into your project. Installing also returns the manifest and these snippets.

yaml
targets:
  - https://api.opensmartroute.ai/api/v1/registry/youssef-ashraf2099-world-war-stratagy-fp-pipe-ref/manifest   # or paste the manifest below

Manifest

An Open Capability Manifest: the router reads it to know what this does, what it costs and when to pick it.

youssef-ashraf2099-world-war-stratagy-fp-pipe-ref.ocm.jsonjson
{
  "ocm": "1",
  "id": "youssef-ashraf2099-world-war-stratagy-fp-pipe-ref",
  "kind": "skill",
  "name": "fp-pipe-ref",
  "description": "Quick reference for pipe and flow. Use when user needs to chain functions, compose operations, or build data pipelines in fp-ts.",
  "publisher": "Youssef-Ashraf2099",
  "version": "1.0.0",
  "capabilities": {
    "domains": [
      "general"
    ],
    "tags": [
      "skill-md",
      "fp-ts",
      "pipe",
      "flow",
      "composition",
      "quick-reference",
      "github"
    ],
    "languages": [
      "en"
    ]
  },
  "quality_prior": 0.6,
  "examples": [
    "Quick reference for pipe and flow. Use when user needs to chain functions, compose operations, or build data pipelines in fp-ts."
  ],
  "primary": false,
  "metadata": {
    "source": {
      "provider": "github",
      "repository": "https://github.com/Youssef-Ashraf2099/World-war-stratagy",
      "path": ".github/skills/fp-pipe-ref/SKILL.md",
      "ref": "0cc1f9c58809c2c1c4b0e0c0a7ed04029ce69d39",
      "url": "https://github.com/Youssef-Ashraf2099/World-war-stratagy/blob/0cc1f9c58809c2c1c4b0e0c0a7ed04029ce69d39/.github/skills/fp-pipe-ref/SKILL.md",
      "key": "Youssef-Ashraf2099/World-war-stratagy/.github/skills/fp-pipe-ref/SKILL.md"
    }
  },
  "instructions": "# pipe & flow Quick Reference\n\n## pipe - Transform a Value\n\n```typescript\nimport { pipe } from 'fp-ts/function'\n\n// pipe(startValue, fn1, fn2, fn3)\n// = fn3(fn2(fn1(startValue)))\n\nconst result = pipe(\n  '  hello world  ',\n  s => s.trim(),\n  s => s.toUpperCase(),\n  s => s.split(' ')\n)\n// ['HELLO', 'WORLD']\n```\n\n## flow - Create Reusable Pipeline\n\n```typescript\nimport { flow } from 'fp-ts/function'\n\n// flow(fn1, fn2, fn3) returns a new function\nconst process = flow(\n  (s: string) => s.trim(),\n  s => s.toUpperCase(),\n  s => s.split(' ')\n)\n\nprocess('  hello world  ') // ['HELLO', 'WORLD']\nprocess(",
  "cost": {
    "context_tokens": 404
  }
}

Fetch it by URL: GET /api/v1/registry/youssef-ashraf2099-world-war-stratagy-fp-pipe-ref/manifest?version=1.0.0

Reviews

Star ratings from people who tried it. One review per account; edit yours any time.

No reviews yet. Install it, try it, and be the first to rate it.