Content-Length: 231785 | pFad | http://github.com/PHS-TSA/webmaster-23-24/commit/46da0be4d504227cbf520909f30ce91b846dde14

D0 refactor: use either, not effect, for pure computation · PHS-TSA/webmaster-23-24@46da0be · GitHub
Skip to content

Commit

Permalink
refactor: use either, not effect, for pure computation
Browse files Browse the repository at this point in the history
  • Loading branch information
lishaduck committed Oct 20, 2024
1 parent eb10e33 commit 46da0be
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions tool/compile-mdx.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { type ParseResult, Schema } from "@effect/schema";
import { type CompileOptions, compile } from "@mdx-js/mdx";
import { dirname, fromFileUrl, join, relative, resolve } from "@std/path";
import { Cause, Chunk, Console, Effect, Order, Stream } from "effect";
import { Cause, Chunk, Console, Effect, Either, Order, Stream } from "effect";
import rehypeMathjax from "rehype-mathjax";
import remarkFrontmatter from "remark-frontmatter";
import remarkLintCheckboxContentIndent from "remark-lint-checkbox-content-indent";
Expand Down Expand Up @@ -325,8 +325,8 @@ const categories = (
*/
const categoriesFile = (
files: VFile[],
): Effect.Effect<string, ParseResult.ParseError, never> =>
Effect.gen(function* () {
): Either.Either<string, ParseResult.ParseError> =>
Either.gen(function* () {
const sortedFiles = files.map((file) => {
const stem = file.stem ?? "";
const category = file.data.matter?.category ?? "";
Expand All @@ -340,7 +340,7 @@ const categoriesFile = (
};
});
const parsedProfiles =
yield* Schema.decodeUnknown(SolutionPagesSchema)(sortedFiles);
yield* Schema.decodeUnknownEither(SolutionPagesSchema)(sortedFiles);
const json = JSON.stringify(parsedProfiles, undefined, 2);

return `import type { SolutionPages } from "./solutions.ts";
Expand Down

0 comments on commit 46da0be

Please sign in to comment.








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: http://github.com/PHS-TSA/webmaster-23-24/commit/46da0be4d504227cbf520909f30ce91b846dde14

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy