This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ret = box([1,2,3]) >> mapU(lambda x: x * x) >> unbox | |
print ret | |
# [1, 4, 9] | |
print (box() >> mapU(lambda x: x * x) >> unbox) | |
# None | |
print (box({"some": "dict"}) >> mapU(lambda x: x * x) >> unbox) | |
# TypeError |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fhir = box() | |
fhir.resourceType = 'Condition' | |
# {"resourceType": "Condition"} | |
fhir.id = identifier.value(table='condition_occurrence', | |
code=condition.condition_occurrence_id) | |
fhir.verificationStatus = 'unknown' | |
fhir.clinicalStatus = 'inactive' if condition.end_date else 'inactive' | |
fhir.subject = identifier.ref(resource_type='Patient', | |
table='person', | |
code=condition.person_id) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// First, run the linter. | |
// It's important to do this before Babel processes the JS. | |
{ | |
test: /\.(js|mjs|jsx)$/, | |
enforce: 'pre', | |
use: [ | |
{ | |
options: { | |
formatter: require.resolve('react-dev-utils/eslintFormatter'), | |
eslintPath: require.resolve('eslint'), |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
it('does execute scripts in a non-root package scope', async () => { | |
const p = await createTestSandbox(...fixture); | |
await p.esy('install'); | |
await p.esy('build'); | |
await expect(p.esy('-p dep cmd1')).rejects.toMatchObject({ | |
message: expect.stringMatching('error: unable to resolve command: cmd1'), | |
}); | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let runScriptCli = (cmd, proj: Project.t) => { | |
open RunAsync.Syntax; | |
let%bind fetched = Project.fetched(proj); | |
let script = Cmd.getTool(cmd); | |
switch (Scripts.find(script, proj.scripts)) { | |
| Some(script) => runScript(script, Cmd.getArgs(cmd), proj) | |
| None => errorf("Script '%s' not found", script) | |
}; | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module type Impl = { | |
let startProcess: string => Lwt.t(result(Process.t, string)); | |
let getFiles: Process.t => Lwt.t(list(string)); | |
}; | |
module Backend = (Impl: Impl) => { | |
type t = { | |
root: string, | |
process: Process.t, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/.../test/error-resolve-case-sensitive/index.js | |
Cannot resolve './badCase.js' | |
File can be found on the filesystem by the requsted name, but doesn't match exactly (case sensitive). This is usually the sign that your module request is not accurate. | |
Directory '/.../test/error-resolve-case-sensitive' contains potentially matching files: | |
BadCase.js | |
Resolving './badCase.js'. Base directory: '/.../test/error-resolve-case-sensitive' | |
Resolving '/.../test/error-resolve-case-sensitive/badCase.js'. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"resolutions": { | |
"@esy-ocaml/reason": | |
"github:facebook/reason#335c3fb2470964c2b4a7d571a8fbd9acdc3c2323", | |
"@esy-ocaml/reason": | |
"github:facebook/reason#335c3fb2470964c2b4a7d571a8fbd9acdc3c2323", | |
"@esy-ocaml/esy-installer": "0.0.1" | |
}, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let resolveDeps = fix (fun recur -> | |
let%bind _js, reqs = File.compute >>> parse in | |
let%bind deps = return reqs ||> resolve in | |
let%bind depsOfDeps = return deps ||> recur in | |
return (deps @ List.flatten depsOfDeps) | |
) in |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Data.Char | |
import qualified Data.Map as M | |
import qualified Data.Set as S | |
data Claim = Claim { elfId :: Int | |
, left :: Int | |
, top :: Int | |
, width :: Int | |
, height :: Int | |
} |