How to use the sanctuary-def.Type function in sanctuary-def

To help you get started, we’ve selected a few sanctuary-def examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github sanctuary-js / sanctuary / test / env.js View on Github external
test ('env', () => {

  eq (S.is ($.Array ($.Type)) (S.env)) (true);

});
github xodio / hm-def / src / index.js View on Github external
import $priv from 'sanctuary-def';
import * as Sig from './signature';

const def = $priv.create ({checkTypes: true, env: $priv.env});

const Parameters = $priv.RecordType ({
  $: $priv.Object,
  checkTypes: $priv.Boolean,
  env: $priv.Array ($priv.Type),
  typeClasses: $priv.Array ($priv.TypeClass),
});

export const create = def
  ('create')
  ({})
  ([
    Parameters,
    $priv.String,
    $priv.AnyFunction,
    $priv.AnyFunction,
  ])
  (({$, checkTypes, env, typeClasses}) => {
    const $def = $.create ({checkTypes, env});
    const resovleSig = Sig.resolve ($) (typeClasses) (env);