8000 Runtime performance hit regardless of checkTypes · Issue #12 · xodio/hm-def · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
Runtime performance hit regardless of checkTypes #12
Open
@Gipphe

Description

@Gipphe

The signature passed to the created def function is resolved regardless whether checkTypes is true or not, meaning there is currently a potential, unnecessary performance drain from resolving those signatures which are then subsequently discarded immediately in production environments.

import $ from 'sanctuary-def';
import {create} from 'hm-def';

const def = create ({
  checkTypes: false,
  env: $.env,
  typeClasses: [],
});

const foo = def
  // This signature will be parsed and resolved to an `Array Type`, regardless of `checkTypes` above.
  ('foo :: Boolean -> Boolean')
  (x => !x);

The resolved signature is never used by sanctuary-def's def when checkTypes is false anyways.

< 3C85 /div>

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0