question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Type representation for generator functions

See original GitHub issue

executing this in the repl

S.prop('a', {a : function*(){return 12}} )

results in

TypeError: Type-variable constraint violation

prop :: Accessible a => String -> a -> b
                                       ^
                                       1

1)  function* (){return 12} ::

Since there is no type of which all the above values are members, the type-variable constraint has been violated.

It used to work before, now it’s breaking.
Is there a type representation for generator functions? (is this even the issue? i’m not completely sure) I’m currently using the latest version of ES6

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:9 (5 by maintainers)

github_iconTop GitHub Comments

4reactions
arsaniwilliamcommented, Apr 6, 2017

My pleasure! This is my first public contribution on github and i’m glad it’s to Sanctuary 😃

0reactions
davidchamberscommented, Dec 18, 2017
$ npm install sanctuary@0.13.2
$ node --print 'require("sanctuary").prop("a", {a: function*() { return 12; }})'
[Function: a]
Read more comments on GitHub >

github_iconTop Results From Across the Web

Generators - Python Wiki
Generator functions allow you to declare a function that behaves like an iterator, i.e. it can be used in a for loop.
Read more >
Generating function - Wikipedia
There are various types of generating functions, including ordinary generating functions, exponential generating functions, Lambert series, Bell series, ...
Read more >
Iterators and generators - JavaScript - MDN Web Docs
When called, generator functions do not initially execute their code. Instead, they return a special type of iterator, called a Generator.
Read more >
Understanding Generators in JavaScript | DigitalOcean
In this article, we'll cover how to create generator functions, how to iterate over Generator objects, the difference between yield and ...
Read more >
Python Generators (With Examples) - Programiz
In this tutorial, you'll learn how to create iterations easily using Python generators, how it is different from iterators and normal functions, and...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found