Scala:
enum Status:
case Ok
case Error(err: String)
import * as RTE from "fp-ts/ReaderTaskEither"; | |
import * as E from "fp-ts/Either"; | |
import * as O from "fp-ts/Option"; | |
import { Kind, URIS } from "fp-ts/HKT"; | |
import { pipe } from "fp-ts/function"; | |
import { Do } from "fp-ts-contrib/Do"; | |
import { Monad1 } from "fp-ts/Monad"; | |
interface MonadError<M extends URIS, E> extends Monad1<M> { | |
readonly throwError: <A>(e: E) => Kind<M, A>; |
// scalaVersion := "3.2.0" | |
// libraryDependencies ++= Seq( | |
// libraryDependencies ++= Seq( | |
// "org.typelevel" %% "cats-core" % "2.8.0", | |
// "dev.zio" %% "zio" % "2.0.0", | |
// "org.typelevel" %% "cats-effect" % "3.3.14", | |
// "org.typelevel" %% "kittens" % "3.0.0", | |
// "dev.zio" %% "zio-json" % "0.3.0-RC10", | |
// "io.d11" %% "zhttp" % "2.0.0-RC10" | |
// ) |
import * as E from '@effect-ts/core/Either'; | |
import * as O from '@effect-ts/core/Option'; | |
import * as T from '@effect-ts/core/Effect'; | |
import * as L from '@effect-ts/core/Effect/Layer'; | |
import * as M from '@effect-ts/core/Effect/Managed'; | |
import * as HashMap from '@effect-ts/core/Collections/Mutable/HashMap'; | |
import { pipe, flow } from '@effect-ts/core/Function'; | |
import { tag } from '@effect-ts/system/Has'; | |
import express, { Request, Response, Router, Express } from 'express'; | |
import { v4 as uuidv4 } from 'uuid'; |
import * as Free from 'fp-ts-contrib/Free'; | |
import * as I from 'fp-ts/lib/Identity'; | |
import * as O from 'fp-ts/Option'; | |
import { Do } from 'fp-ts-contrib/Do'; | |
import { pipe, flow } from 'fp-ts/function'; | |
import { sequenceS } from 'fp-ts/lib/Apply'; | |
declare module 'fp-ts/HKT' { | |
interface URItoKind<A> { | |
Store: StoreA; |