fluture-js / fluture-sanctuary-types Goto Github PK
View Code? Open in Web Editor NEWFluture type definitions for Sanctuary
License: MIT License
Fluture type definitions for Sanctuary
License: MIT License
exports.env = [
FutureType($.Unknown, $.Unknown),
ConcurrentFutureType($.Unknown, $.Unknown)
];
allowing for:
- $.create({checkTypes: true, env: $.env.concat([FutureType($.Unknown, $.Unknown), ConcurrentFutureType($.Unknown, $.Unknown)])})
+ $.create({checkTypes: true, env: $.env.concat(env)});
Branch | Build failing 🚨 |
---|---|
Dependency | sanctuary-scripts |
Current Version | 1.4.1 |
Type | devDependency |
This version is covered by your current version range and after updating it in your project the build failed.
sanctuary-scripts is a devDependency of this project. It might not break your production code or affect downstream projects, but probably breaks your build or test tools, which may prevent deploying or publishing.
Changes:
lint-readme
now checks the formatting of doctests and other code blocks (#13)The new version differs by 3 commits.
ce8733d
Version 1.5.0
6fd7771
Merge pull request #13 from sanctuary-js/davidchambers/lint-readme
468b5ef
lint-readme: lint doctests and other code blocks
See the full diff
There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.
Your Greenkeeper Bot 🌴
Hey there
I am wondering why my Fluture return value is not throwing for executeWrite
but only as soon as we get to executeRead
. How can I make it throw earlier?
TypeError: Invalid value
executeRead :: { path :: String } -> Future Any Buffer
^^^^^^
1
My implementation:
const executeWrite_ = F.encaseP(({ path, contents }) =>
fs.promises.writeFile(path, contents).then(() => 12) // PROVOKE TYPE VIOLATION
);
const executeWrite = def("executeWrite")({})([
WriteOperationType,
FlutureTypes.FutureType($.Any)($.String)
])(executeWrite_);
const executeRead_ = F.encaseP(({ path }) => fs.promises.readFile(path));
The test which writes a file and reads back from it.
test("write file e2e", t =>
new Promise((resolve, reject) => {
const fileName = "testFile";
const contents =
"contents " +
Array.from({ length: 1 }, () => Math.random().toString(36)[2]).join(
""
);
const writeOp = executeWrite({ path: fileName, contents });
const readOp = path => executeRead({ path });
const readWrite = F.chain(readOp)(F.map(log("written"))(writeOp));
const e2e = F.map(toString)(readWrite);
F.fork(someError => reject(someError))(readContents => {
log("resolve")(contents);
t.equals(readContents, contents);
resolve();
})(e2e);
}));
Thanks for the help 👋
The fluture-hooks library introduces the Hook and ConcurrentHook types.
1.9.2
to 1.9.3
.This version is covered by your current version range and after updating it in your project the build failed.
rollup is a devDependency of this project. It might not break your production code or affect downstream projects, but probably breaks your build or test tools, which may prevent deploying or publishing.
2019-04-10
The new version differs by 3 commits.
516a06d
1.9.3
a5526ea
Update changelog
c3d73ff
Handle out-of-order binding of identifiers to improve tree-shaking (#2803)
See the full diff
There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.
Your Greenkeeper Bot 🌴
To see what happens to your code in Node.js 10, Greenkeeper has created a branch with the following changes:
.travis.yml
If you’re interested in upgrading this repo to Node.js 10, you can open a PR with these changes. Please note that this issue is just intended as a friendly reminder and the PR as a possible starting point for getting your code running on Node.js 10.
Greenkeeper has checked the engines
key in any package.json
file, the .nvmrc
file, and the .travis.yml
file, if present.
engines
was only updated if it defined a single version, not a range..nvmrc
was updated to Node.js 10.travis.yml
was only changed if there was a root-level node_js
that didn’t already include Node.js 10, such as node
or lts/*
. In this case, the new version was appended to the list. We didn’t touch job or matrix configurations because these tend to be quite specific and complex, and it’s difficult to infer what the intentions were.For many simpler .travis.yml
configurations, this PR should suffice as-is, but depending on what you’re doing it may require additional work or may not be applicable at all. We’re also aware that you may have good reasons to not update to Node.js 10, which is why this was sent as an issue and not a pull request. Feel free to delete it without comment, I’m a humble robot and won’t feel rejected 🤖
There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.
Your Greenkeeper Bot 🌴
First off, thank you for creating these typings!
I'm completely new to Sancturary and Fluture and already I feel productive with Sanctuary's awesome type checking.
But after a lot of initial head scratching, since my requirements are bit odd (old).
I maintain a website that was build 6 years ago with jQuery, underscore.js and express, ejs on the server.
We do not have a built step for javascript (we do for CSS) and I had to figure out how to combine Sancturary + Fluture + jQuery in the browser. Luckily we only support ES2015, so modules are supported.
I came up with the following as a proof of concept:
<p id="output">Loading...</p>
<script>
'use strict'
const process = {}
process.env = {}
process.env.NODE_ENV = 'dev'
</script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/jquery.min.js" integrity="sha256-/xUj+3OJU5yExlq6GSYGSHk7tPXikynS7ogEvDej/m4=" crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/gh/sanctuary-js/[email protected]/dist/bundle.js"></script>
<script type="module" src="js/app.js"></script>
js/app.js
import { env as flutureEnv } from './[email protected]'
import { Future, fork } from 'https://cdn.jsdelivr.net/gh/fluture-js/[email protected]/dist/module.js'
/** @type {import('sanctuary')} */
const S = window.sanctuary.create({ checkTypes: true, env: window.sanctuary.env.concat(flutureEnv) })
// getJSON :: String -> {} -> Task Error JN
const getJSON = S.curry2((url, params) => Future((reject, result) => {
$.getJSON(url, params, result).fail(reject)
// Here is how we handle cancellation. This signal is received when nobody
// is interested in the answer any more.
return function onCancel () {
// Clearing the timeout releases the resources we were holding.
console.log('Future was cancelled')
}
}))
const display = S.pipe([
S.prop('publishableKey'),
key => $('#output').text(key)
])
fork (console.error) (display)
(getJSON('/setup') ({}))
'./[email protected]'
is my edited version of the current typings, since I can not use the implementation as it is.
The following changes was needed before I could get it to work:
const $D = window.sanctuaryDef
const type = window.sanctuaryTypeIdentifiers
import {
Future,
isFuture,
extractLeft,
extractRight,
Par,
seq
} from 'https://cdn.jsdelivr.net/gh/fluture-js/[email protected]/dist/module.js';
Contrast that with what is provided by fluture-sanctuary-types today:
import $ from 'sanctuary-def';
import type from 'sanctuary-type-identifiers';
import {
Future,
isFuture,
extractLeft,
extractRight,
Par,
seq
} from 'fluture/index.js';
Both app.js and [email protected] imports "https://cdn.jsdelivr.net/gh/fluture-js/[email protected]/dist/module.js" but it is only loaded by the browser once.
The process.env.NODE_ENV
stuff is to turn Sanctuary type checking on/off.
Notice that $
had to be renamed to $D
to not conflict with jQuery.
That was a lot of pretext.. What I wanted to ask is, is it possible to get a built hosted on jsDelivr that assumes Sancturary is global and imports Fluture from a CDN (preferably jsDelivr too)?
I'm not sure if depending on jsDelivr is the right path for everyone who needs to run Sanctuary + Fluture directly in the browser but it is an idea.
By the way, fluture-sanctuary-types
works great with Fluture 14 in my very limited test. Currently npm will loudly protest if you try to use Fluture 14 because of the peer dependency semver requirement.
Hi ! Thanks a lot for this integration with Sanctuary, makes everything better 👍
I'm using typescript and have been working pretty well for Fluture and Sanctuary so far, however there are no @types/fluture-sanctuary-types
library, with makes ts throw a Could not find a declaration file for module
i made a workaround by declaring the tipes in a file:
// ./src/misssingDeclarations/fluture-sanctuary-types.d.ts
declare module 'fluture-sanctuary-types' {
export const env: ReadonlyArray<any>;
}
and
// tsconfig.json
{
"compilerOptions": {
"baseUrl": "./",
"paths": {
"fluture-sanctuary-types": [
"./src/misssingDeclarations/fluture-sanctuary-types.d.ts"
]
},
}
But seems there are no official typescript package.
Sorry for bothering let me know if there is any way i could contribute. 🙏
1.18.0
to 1.19.0
.This version is covered by your current version range and after updating it in your project the build failed.
rollup is a devDependency of this project. It might not break your production code or affect downstream projects, but probably breaks your build or test tools, which may prevent deploying or publishing.
The new version differs by 6 commits.
9af119d
1.19.0
b3f361c
Update changelog
456f4d2
Avoid variable from empty module name be empty (#3026)
17eaa43
Use id of last module in chunk as name base for auto-generated chunks (#3025)
871bfa0
Switch to a code-splitting build and update dependencies (#3020)
2443783
Unified file emission api (#2999)
See the full diff
There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.
Your Greenkeeper Bot 🌴
Branch | Build failing 🚨 |
---|---|
Dependency | sanctuary-type-classes |
Current Version | 8.1.1 |
Type | devDependency |
This version is covered by your current version range and after updating it in your project the build failed.
sanctuary-type-classes is a devDependency of this project. It might not break your production code or affect downstream projects, but probably breaks your build or test tools, which may prevent deploying or publishing.
The new version differs by 23 commits.
9314180
Version 8.2.0
8f7d59d
Merge pull request #89 from sanctuary-js/davidchambers/laws
ed252e7
use fantasy-laws to test lawfulness of implementations
912e8aa
Merge pull request #98 from masaeedu/master
6428cae
Add foldMap
90baa0e
Merge pull request #92 from paldepind/sort-performance
9c5744e
Improve performance of sortBy
d148eb0
Merge pull request #100 from sanctuary-js/davidchambers/scripts
55be404
[email protected]
f45d4ac
Merge pull request #99 from sanctuary-js/avaq/flip
6bca048
Correct the function signature of flip
07e7221
Merge pull request #95 from sanctuary-js/avaq/flip
e76b78a
Derive flip from map
75a929f
Merge pull request #97 from sanctuary-js/davidchambers/scripts
84e471a
[email protected]
There are 23 commits in total.
See the full diff
There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.
Your Greenkeeper Bot 🌴
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.