Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TINY-11552: Fix type alias #27

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions Jenkinsfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
#!groovy
@Library('waluigi@release/7') _

beehiveFlowBuild()

beehiveFlowBuild(
container: [
tag: '20',
]
)
12 changes: 6 additions & 6 deletions src/main/ts/api/Pprint.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,21 +5,21 @@ import * as StringUtil from '../core/StringUtil';
import * as Type from '../core/Type';
import * as Pnode from './Pnode';

type Pnode = Pnode.Pnode;
type Show<A> = Show.Show<A>;
type PnodeType = Pnode.Pnode;
type ShowType<A> = Show.Show<A>;

export interface Pprint<A> {
pprint: (a: A) => Pnode;
pprint: (a: A) => PnodeType;
}

export const pprint = <A> (f: (a: A) => Pnode): Pprint<A> => ({ pprint: f });
export const pprint = <A> (f: (a: A) => PnodeType): Pprint<A> => ({ pprint: f });

export const render = <A> (a: A, pp: Pprint<A>): string => {
const n = pp.pprint(a);
return Pnode.render(n);
};

export const pprintShow = <A> (show: Show<A>): Pprint<A> =>
export const pprintShow = <A> (show: ShowType<A>): Pprint<A> =>
pprint((a) => Pnode.single(show.show(a)));

export const pprintUndefined: Pprint<undefined> = pprintShow(Show.showUndefined);
Expand All @@ -39,7 +39,7 @@ export const pprintArray = <A> (pprintA: Pprint<A>): Pprint<ArrayLike<A>> => ppr
export const pprintRecord = <A> (pprintA: Pprint<A>): Pprint<Record<string, A>> => pprint((r) => {
const tuples = ObjectUtil.toTuples(r);

const cnode: (t: [string, A]) => Pnode = ([ k, v ]) => {
const cnode: (t: [string, A]) => PnodeType = ([ k, v ]) => {
const pv = pprintA.pprint(v);
const start = StringUtil.doubleQuote(k) + ': ';
return Pnode.prependStart(start)(pv);
Expand Down
Loading