( tag: A["_tag"] )
| 169 | * @category constructors |
| 170 | */ |
| 171 | export const tagged = <A extends { readonly _tag: string }>( |
| 172 | tag: A["_tag"] |
| 173 | ): Case.Constructor<A, "_tag"> => |
| 174 | (args) => { |
| 175 | const value = args === undefined ? Object.create(StructuralPrototype) : struct(args) |
| 176 | value._tag = tag |
| 177 | return value |
| 178 | } |
| 179 | |
| 180 | /** |
| 181 | * Provides a constructor for a Case Class. |