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

types: define Module #283

Merged
merged 1 commit into from
Jan 13, 2020
Merged
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
11 changes: 11 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -741,6 +741,14 @@
(typeEq ('sanctuary-maybe/Maybe@1'))
(I);

//# Module :: Type
//.
//. Type comprising every ES module.
var Module = NullaryTypeWithUrl
('Module')
([])
(function(x) { return toString.call (x) === '[object Module]'; });

//# NonEmpty :: Type -> Type
//.
//. Constructor for non-empty types. `$.NonEmpty ($.String)`, for example, is
Expand Down Expand Up @@ -1041,6 +1049,7 @@
//. - <code>[JsMap](#JsMap) ([Unknown][]) ([Unknown][])</code>
//. - <code>[JsSet](#JsSet) ([Unknown][])</code>
//. - <code>[Maybe](#Maybe) ([Unknown][])</code>
//. - <code>[Module](#Module)</code>
//. - <code>[Null](#Null)</code>
//. - <code>[Number](#Number)</code>
//. - <code>[Object](#Object)</code>
Expand Down Expand Up @@ -1068,6 +1077,7 @@
JsMap (Unknown) (Unknown),
JsSet (Unknown),
Maybe (Unknown),
Module,
Null,
Number_,
Object_,
Expand Down Expand Up @@ -2818,6 +2828,7 @@
JsMap: fromUncheckedBinaryType (JsMap),
JsSet: fromUncheckedUnaryType (JsSet),
Maybe: fromUncheckedUnaryType (Maybe),
Module: Module,
NonEmpty: NonEmpty,
Null: Null,
Nullable: fromUncheckedUnaryType (Nullable),
Expand Down
6 changes: 6 additions & 0 deletions scripts/test
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/usr/bin/env bash
set -euf -o pipefail

node_modules/.bin/sanctuary-test "$@"

node --experimental-modules test/module.mjs
14 changes: 14 additions & 0 deletions test/module.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import * as fs from 'fs';

import $ from '../index.js';


const a = $.TypeVariable ('a');

$.create
({checkTypes: true, env: $.env})
('I')
({})
([a, a])
(x => x)
(fs);