_id stringlengths 64 64 | repository stringlengths 6 84 | name stringlengths 4 110 | content stringlengths 0 248k | license null | download_url stringlengths 89 454 | language stringclasses 7
values | comments stringlengths 0 74.6k | code stringlengths 0 248k |
|---|---|---|---|---|---|---|---|---|
bd3d9f6635a9d9c8f12a2910f5ada766e266afc14903adde26b32f85b33e4484 | silky/myth | eval.ml | open Core
open Consts
open Lang
open Pp
exception Eval_error of string
(***** Helpers {{{ *****)
let rec find_first_branch (c:id) (bs:branch list) : branch =
match bs with
| [] -> raise @@ Internal_error "Constructor not found during matching"
| (p, e)::bs ->
begin match p with
| PCtor (c', _) -> if c ... | null | https://raw.githubusercontent.com/silky/myth/b631edefb2a27a1d731daa6654517d91ca660b95/src/eval.ml | ocaml | **** Helpers {{{ ****
**** }}} ****
**** Evaluation Cache {{{ ****
**** }}} ****
Value binding
Function binding
Value binding
Function binding | open Core
open Consts
open Lang
open Pp
exception Eval_error of string
let rec find_first_branch (c:id) (bs:branch list) : branch =
match bs with
| [] -> raise @@ Internal_error "Constructor not found during matching"
| (p, e)::bs ->
begin match p with
| PCtor (c', _) -> if c = c' then (p, e) else find... |
01d8ffb4bbf6e35db625851650610b7b696f5095877d2f59516bf5ffd8b14a27 | hammerlab/prohlatype | nomenclature.ml | (** Decode HLA allele names. *)
open Util
type suffix =
| N
| L
| S
| C
| A
| Q
let suffix_opt_of_char = function
| 'N' -> Some N
| 'L' -> Some L
| 'S' -> Some S
| 'C' -> Some C
| 'A' -> Some A
| 'Q' -> Some Q
| _ -> None
let suffix_to_string = function
| N -> "N"
| L -> "L"
| S ->... | null | https://raw.githubusercontent.com/hammerlab/prohlatype/3acaf7154f93675fc729971d4c76c2b133e90ce6/src/lib/nomenclature.ml | ocaml | * Decode HLA allele names.
All of the actual alleles have a non-zero value in their fields and we
check for that, so we can use 0 as the lowest value to compare against.
Match on just the name, ignore suffix
Also, ignore suffix.
: sig
type t
val empty : t
val add : resolution -> t -> t
val nearest : ... |
open Util
type suffix =
| N
| L
| S
| C
| A
| Q
let suffix_opt_of_char = function
| 'N' -> Some N
| 'L' -> Some L
| 'S' -> Some S
| 'C' -> Some C
| 'A' -> Some A
| 'Q' -> Some Q
| _ -> None
let suffix_to_string = function
| N -> "N"
| L -> "L"
| S -> "S"
| C -> "C"
| A -> "A"
... |
7927de1354d1e34eeb576d7c22121370ac6d308826519a24b7934cbecffe06d7 | Enecuum/Node | Interpreter.hs | module Enecuum.Core.Random.Interpreter where
import qualified Enecuum.Core.Language as L
import Enecuum.Prelude
import System.Entropy
import System.Random hiding (next)
import qualified Enecuum.Core.Crypto.Interpreter as I
import Data.UUID.V1 (nextU... | null | https://raw.githubusercontent.com/Enecuum/Node/3dfbc6a39c84bd45dd5f4b881e067044dde0153a/src/Enecuum/Core/Random/Interpreter.hs | haskell | | Interpret RandomL language. | module Enecuum.Core.Random.Interpreter where
import qualified Enecuum.Core.Language as L
import Enecuum.Prelude
import System.Entropy
import System.Random hiding (next)
import qualified Enecuum.Core.Crypto.Interpreter as I
import Data.UUID.V1 (nextU... |
0c605325aef6391b73333c679424e7171b733f5859315a2347f3acf51b674482 | tomjridge/imp_fs | freelist_intf.ml | (** Main interfaces used by the freelist *)
open Tjr_plist.Plist_intf
*
There are two versions of the freelist :
- For_blkids : to implement the " usual " blk freelist , managing on - disk
blocks ; the elts are actually blk_ids
- For_arbitrary_elts : which allocates and frees arbitrary elements ;
s... | null | https://raw.githubusercontent.com/tomjridge/imp_fs/8eb2bce99008be34b17aa5f4eb031d1be2b49e69/src/freelist/freelist_intf.ml | ocaml | * Main interfaces used by the freelist
$(PIPE2SH("""sed -n '/type[ ].*version/,/^$/p' >GEN.version.ml_"""))
* For arbitrary elts, we need a way to allocate and free blocks
$(PIPE2SH("""sed -n '/type[ ][^=]*fl_origin/,/}/p' >GEN.fl_origin.ml_"""))
$(PIPE2SH("""sed -n '/type[ ].*freelist_ops/,/^}$/p' >GEN.freelist... |
open Tjr_plist.Plist_intf
*
There are two versions of the freelist :
- For_blkids : to implement the " usual " blk freelist , managing on - disk
blocks ; the elts are actually blk_ids
- For_arbitrary_elts : which allocates and frees arbitrary elements ;
some other freelist of the first type provide... |
a5933aeb3a27de782ba5d513ed27f5ed67da5384cefe6202db6ca062183be47a | liqd/thentos | CookieSessionSpec.hs | {-# LANGUAGE DataKinds #-}
# LANGUAGE FlexibleInstances #
# LANGUAGE MultiParamTypeClasses #
# LANGUAGE OverloadedStrings #
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE TypeOperators #-}
{-# OPTIONS -fno-warn-incomplete-patterns #-}
module Thentos.CookieSessionSpec (spec) where
i... | null | https://raw.githubusercontent.com/liqd/thentos/f7d53d8e9d11956d2cc83efb5f5149876109b098/thentos-cookie-session/test/Thentos/CookieSessionSpec.hs | haskell | # LANGUAGE DataKinds #
# LANGUAGE ScopedTypeVariables #
# LANGUAGE TypeOperators #
# OPTIONS -fno-warn-incomplete-patterns # | # LANGUAGE FlexibleInstances #
# LANGUAGE MultiParamTypeClasses #
# LANGUAGE OverloadedStrings #
module Thentos.CookieSessionSpec (spec) where
import Control.Monad (replicateM_)
import Control.Monad.Trans.Except (ExceptT)
import qualified Data.Vault.Lazy as Vault... |
53281a85f009b14d4c321f75447acb88e1569fca65fb5457bef987409765c8dd | Clozure/ccl | arm-float.lisp | -*- Mode : Lisp ; Package : CCL -*-
;;;
;;; Copyright 2010 Clozure Associates
;;;
Licensed under the Apache License , Version 2.0 ( the " License " ) ;
;;; you may not use this file except in compliance with the License.
;;; You may obtain a copy of the License at
;;;
;;; -2.0
;;;
;;; Unless required by applicabl... | null | https://raw.githubusercontent.com/Clozure/ccl/6c1a9458f7a5437b73ec227e989aa5b825f32fd3/level-0/ARM/arm-float.lisp | lisp | Package : CCL -*-
Copyright 2010 Clozure Associates
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
-2.0
Unless required by applicable law or agreed to in writing, software
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
... | distributed under the License is distributed on an " AS IS " BASIS ,
(in-package "CCL")
(eval-when (:compile-toplevel :execute)
(require "NUMBER-MACROS")
(require :number-case-macro))
make a float from hi - high 24 bits mantissa ( ignore implied higher bit )
lo - low 28 bits mantissa
... |
b085d5f87eaf37ba6986e481e490e9e62a78a52ee085bc9f9b6ad72132d7d0de | nasa/Common-Metadata-Repository | config.clj | (ns cmr.opendap.config
(:require
[clojure.string :as string]
[cmr.exchange.common.config :as common-config]
[cmr.exchange.common.file :as file]
[cmr.exchange.common.util :as util]
[cmr.metadata.proxy.config :as config]
[environ.core :as environ]
[taoensso.timbre :as log])
(:import
(clojure.... | null | https://raw.githubusercontent.com/nasa/Common-Metadata-Repository/63001cf021d32d61030b1dcadd8b253e4a221662/other/cmr-exchange/service-bridge/src/cmr/opendap/config.clj | clojure | (ns cmr.opendap.config
(:require
[clojure.string :as string]
[cmr.exchange.common.config :as common-config]
[cmr.exchange.common.file :as file]
[cmr.exchange.common.util :as util]
[cmr.metadata.proxy.config :as config]
[environ.core :as environ]
[taoensso.timbre :as log])
(:import
(clojure.... | |
de533066abc67f8ee5744ebffaf27a2d1d20cbd154cc83e809a9a753c347d84f | krimlabs/ubiq | seeder.clj | (ns ubiq.components.seeder
(:require [clojure.tools.logging :as log]
[integrant.core :as ig]
[faker.name]
[faker.address]))
(defn- seed-parties [db-fns count]
(log/info "Seeding parties")
(let [insert-party (get-in db-fns [:parties :insert-party])]
(doall (map (fn [_]
... | null | https://raw.githubusercontent.com/krimlabs/ubiq/594ca0bce5946da3560c0bdc87f7af7712336977/src/ubiq/components/seeder.clj | clojure | (ns ubiq.components.seeder
(:require [clojure.tools.logging :as log]
[integrant.core :as ig]
[faker.name]
[faker.address]))
(defn- seed-parties [db-fns count]
(log/info "Seeding parties")
(let [insert-party (get-in db-fns [:parties :insert-party])]
(doall (map (fn [_]
... | |
c6bffb1b42c8077e9843fb2a951243eaa6ff75bd4a955439a2b80b771b61cd12 | mzp/coq-ruby | xlate.ml | (** Translation from coq abstract syntax trees to centaur vernac
*)
open String;;
open Char;;
open Util;;
open Names;;
open Ascent;;
open Genarg;;
open Rawterm;;
open Termops;;
open Tacexpr;;
open Vernacexpr;;
open Decl_kinds;;
open Topconstr;;
open Libnames;;
open Goptions;;
// Verify whether this is dead code ... | null | https://raw.githubusercontent.com/mzp/coq-ruby/99b9f87c4397f705d1210702416176b13f8769c1/contrib/interface/xlate.ml | ocaml | * Translation from coq abstract syntax trees to centaur vernac
(true,])
* Tactics
probably useless: just for compatibility
TODO: application pattern
CT_premise_pattern(xlate_id_opt na, xlate_context_pattern b, xlate_context_pattern t);;
Moved from xlate_tactic
TODO LATER: local recursive tactics and ... | open String;;
open Char;;
open Util;;
open Names;;
open Ascent;;
open Genarg;;
open Rawterm;;
open Termops;;
open Tacexpr;;
open Vernacexpr;;
open Decl_kinds;;
open Topconstr;;
open Libnames;;
open Goptions;;
// Verify whether this is dead code , as of coq version 7
The following three sentences have been added t... |
3da677fec481e81fbc77632acc3a4ee4e1270a472f1b0d110197eddc630f1d45 | rajasegar/cl-warehouse | main.lisp | (in-package :cl-user)
(defpackage cl-warehouse
(:use :cl)
(:import-from :cl-warehouse.config
:config)
(:import-from :clack
:clackup)
(:export :start
:stop))
(in-package :cl-warehouse)
(defvar *appfile-path*
(asdf:system-relative-pathname :cl-warehouse #P"app.lisp"))... | null | https://raw.githubusercontent.com/rajasegar/cl-warehouse/cb6313d42ba5df49c54f9bf7a9e30734c6f6cbd9/src/main.lisp | lisp | (in-package :cl-user)
(defpackage cl-warehouse
(:use :cl)
(:import-from :cl-warehouse.config
:config)
(:import-from :clack
:clackup)
(:export :start
:stop))
(in-package :cl-warehouse)
(defvar *appfile-path*
(asdf:system-relative-pathname :cl-warehouse #P"app.lisp"))... | |
50dc0c953f9c0f0114dd7fe18e751f0a4e48694a2746aaaacfa433c94263ee8c | Octachron/codept | option.ml | let bind x f = match x with
| Some x -> f x
| None -> None
let fmap f = function
| Some x -> Some (f x)
| None -> None
let either f default = function
| Some x -> f x
| None -> default
let iter f = either f ()
let default value = function
| None -> value
| Some x -> x
let lazy_default suspended =... | null | https://raw.githubusercontent.com/Octachron/codept/2d2a95fde3f67cdd0f5a1b68d8b8b47aefef9290/lib/option.ml | ocaml | let bind x f = match x with
| Some x -> f x
| None -> None
let fmap f = function
| Some x -> Some (f x)
| None -> None
let either f default = function
| Some x -> f x
| None -> default
let iter f = either f ()
let default value = function
| None -> value
| Some x -> x
let lazy_default suspended =... | |
13be4fd8cca52705163fcae5baf129f4cb37be8b9721b1d5ca7c4432796f8c3d | b0-system/b0 | b0_cmd_list.ml | ---------------------------------------------------------------------------
Copyright ( c ) 2020 The b0 programmers . All rights reserved .
Distributed under the ISC license , see terms at the end of the file .
---------------------------------------------------------------------------
Copyright (c) 20... | null | https://raw.githubusercontent.com/b0-system/b0/d1b413ebb600dd387ad6ef3fc097328580fa22d9/tool-b0/b0_cmd_list.ml | ocaml | XXX improve that when cmdlets and outcome actions are merged
Command line interface
Commands | ---------------------------------------------------------------------------
Copyright ( c ) 2020 The b0 programmers . All rights reserved .
Distributed under the ISC license , see terms at the end of the file .
---------------------------------------------------------------------------
Copyright (c) 20... |
9a049f913e70c6757e7099cd701ef0c0917c5b7d19fad901e9df04d00ec27243 | DavidAlphaFox/RabbitMQ | webmachine_demo_resource.erl | @author < >
2007 - 2009 Basho Technologies , Inc. All Rights Reserved .
%% @doc Example webmachine_resource.
-module(webmachine_demo_resource).
-author('Justin Sheehy <>').
-export([init/1, to_html/2, to_text/2, content_types_provided/2,
is_authorized/2, generate_etag/2, expires/2, last_modified/2])... | null | https://raw.githubusercontent.com/DavidAlphaFox/RabbitMQ/0a64e6f0464a9a4ce85c6baa52fb1c584689f49a/plugins-src/webmachine-wrapper/webmachine-git/demo/src/webmachine_demo_resource.erl | erlang | @doc Example webmachine_resource. | @author < >
2007 - 2009 Basho Technologies , Inc. All Rights Reserved .
-module(webmachine_demo_resource).
-author('Justin Sheehy <>').
-export([init/1, to_html/2, to_text/2, content_types_provided/2,
is_authorized/2, generate_etag/2, expires/2, last_modified/2]).
-include_lib("webmachine/include/w... |
7ae37489fe0343b290000a34a6ec43fdf3742f992052a08e612ec65fee1c7638 | kuis-isle3sw/IoPLMaterials | myMap.mli | type ('a, 'b) t
val empty : ('a, 'b) t
val is_empty : ('a, 'b) t -> bool
val singleton : 'a -> 'b -> ('a, 'b) t
val from_list : ('a * 'b) list -> ('a, 'b) t
val to_list : ('a, 'b) t -> ('a * 'b) list
val assoc : 'a -> 'b -> ('a, 'b) t -> ('a, 'b) t
val get : 'a -> ('a, 'b) t -> 'b option
val merge : ('a, 'b) t -> ('a,... | null | https://raw.githubusercontent.com/kuis-isle3sw/IoPLMaterials/fa328e92fdaaf6986394f832ef689689930647cd/misc/miniml-compiler/myMap.mli | ocaml | type ('a, 'b) t
val empty : ('a, 'b) t
val is_empty : ('a, 'b) t -> bool
val singleton : 'a -> 'b -> ('a, 'b) t
val from_list : ('a * 'b) list -> ('a, 'b) t
val to_list : ('a, 'b) t -> ('a * 'b) list
val assoc : 'a -> 'b -> ('a, 'b) t -> ('a, 'b) t
val get : 'a -> ('a, 'b) t -> 'b option
val merge : ('a, 'b) t -> ('a,... | |
bf9072b326476fe984dd65c680c7a8ac21887f8b1f309106b8e39636b739140d | cac-t-u-s/om-sharp | bpf-tools.lisp | ;============================================================================
; om#: visual programming language for computer-assisted music composition
;============================================================================
;
; This program is free software. For information on usage
; and redistribution, see... | null | https://raw.githubusercontent.com/cac-t-u-s/om-sharp/9d06fd6c8ef9c504038d6ddf67ba553529ec2216/src/packages/basic/bpf-bpc/bpf-tools.lisp | lisp | ============================================================================
om#: visual programming language for computer-assisted music composition
============================================================================
This program is free software. For information on usage
and redistribution, see the "... | File author :
(in-package :om)
(defmethod* point-pairs ((self bpf))
:initvals '(nil)
:indoc '("a BPC or BPF")
:doc "Retruns the list of points in <self> as a list ((x1 y1) (x2 y2) ...) or ((x1 y1 t1) (x2 y2 t2) ...)"
:icon :bpf
(mat-trans (list (x-points self) (y-points self))))
(defmethod* point-pai... |
0aad72cf1b0a0f26ff22fba88cc4e86b6b47e59e530a54b10e04f9b2d0450208 | ashinn/chibi-scheme | extract-special-casing.scm | #!/usr/bin/env chibi-scheme
;; Build a table of special case (non 1:1) case mappings.
;;
;; Usage:
;; extract-special-casing.scm [options] CaseFolding.txt SpecialCasing.txt > out
(import (chibi) (srfi 1) (srfi 125) (srfi 95) (chibi io) (chibi string))
(define (warn . args)
(let ((err (current-error-port)))
(... | null | https://raw.githubusercontent.com/ashinn/chibi-scheme/8b27ce97265e5028c61b2386a86a2c43c1cfba0d/tools/extract-special-casing.scm | scheme | Build a table of special case (non 1:1) case mappings.
Usage:
extract-special-casing.scm [options] CaseFolding.txt SpecialCasing.txt > out
))))
TODO: handle folds not in cases (currently only #\x1e9e)
)))) | #!/usr/bin/env chibi-scheme
(import (chibi) (srfi 1) (srfi 125) (srfi 95) (chibi io) (chibi string))
(define (warn . args)
(let ((err (current-error-port)))
(for-each (lambda (x) (display x err)) args)
(newline err)))
(define (useq->string str)
(let ((ls (map (lambda (s) (string->number s 16))
... |
1092feb7f273cabd0a2047a6d0b3059993b6988bae8d4f51bdb7e1571843f0f1 | cocreature/lrucaching | Spec.hs | module Main where
import Test.Hspec
import qualified Data.LruCacheSpec as LruCacheSpec
import qualified Data.LruCache.IOSpec as IOSpec
main :: IO ()
main =
hspec $ do
describe "Data.LruCache" LruCacheSpec.spec
describe "Data.LruCache.IO" IOSpec.spec
| null | https://raw.githubusercontent.com/cocreature/lrucaching/b722777185d9df6145c8efc6ddc6057983dec5db/test/Spec.hs | haskell | module Main where
import Test.Hspec
import qualified Data.LruCacheSpec as LruCacheSpec
import qualified Data.LruCache.IOSpec as IOSpec
main :: IO ()
main =
hspec $ do
describe "Data.LruCache" LruCacheSpec.spec
describe "Data.LruCache.IO" IOSpec.spec
| |
a5a90f737fe72abced5f2619e99a354f6c70480bc55eeee5949d5c4689f54e33 | puppetlabs/clj-i18n | project.clj | (defproject puppetlabs/i18n-example-program "0.1.0"
:description "A sample use of the i18n library"
:url ""
:license {:name "Eclipse Public License"
:url "-v10.html"}
:dependencies [[org.clojure/clojure "1.6.0"]
[puppetlabs/i18n "0.1.0-SNAPSHOT"]]
:plugins [[puppetlabs/i18n "... | null | https://raw.githubusercontent.com/puppetlabs/clj-i18n/3f56f2b2be40aacd2dae09f32d5e6f97a12c363b/example/program/project.clj | clojure | (defproject puppetlabs/i18n-example-program "0.1.0"
:description "A sample use of the i18n library"
:url ""
:license {:name "Eclipse Public License"
:url "-v10.html"}
:dependencies [[org.clojure/clojure "1.6.0"]
[puppetlabs/i18n "0.1.0-SNAPSHOT"]]
:plugins [[puppetlabs/i18n "... | |
b291613410fa1e35b34daa218702a83541b3b411d69a9e758c9b8949795025ad | Ekatereana/CommonLispWorks | orderby.lisp | (defun get_comparator (value)
"returns function for comparing in asc order corresponds to value type"
(cond
((numberp value) #'<)
((stringp value) #'string<)
(t #'equal)
)
)
(defun get_comparator_reverse (value)
"returns function for comparing in desc order corresponds to value type"
(cond
... | null | https://raw.githubusercontent.com/Ekatereana/CommonLispWorks/13111f7c45ec4d672dfdf3689ba22554d5c60727/orderby.lisp | lisp | (defun get_comparator (value)
"returns function for comparing in asc order corresponds to value type"
(cond
((numberp value) #'<)
((stringp value) #'string<)
(t #'equal)
)
)
(defun get_comparator_reverse (value)
"returns function for comparing in desc order corresponds to value type"
(cond
... | |
3305d3219cb7739849b85ae79118c56784bbe60833ec973491612e78426f3234 | malthe/bs-virtualdom | virtualdom_events.ml | type event =
Abort
| AnimationCancel
| AnimationEnd
| AnimationIteration
| AnimationStart
| BeforeCopy
| BeforeCut
| BeforeInput
| BeforePaste
| BeforeUnload
| Blur
| Change
| Click
| ClipboardChange
| Copy
| Cut
| DblClick
| DragEnd
| DragEnter
| DragExit
| DragLeave
| Dra... | null | https://raw.githubusercontent.com/malthe/bs-virtualdom/ed57fa83b6b5258218de4fafb03dd2a7b3e12565/src/virtualdom_events.ml | ocaml | type event =
Abort
| AnimationCancel
| AnimationEnd
| AnimationIteration
| AnimationStart
| BeforeCopy
| BeforeCut
| BeforeInput
| BeforePaste
| BeforeUnload
| Blur
| Change
| Click
| ClipboardChange
| Copy
| Cut
| DblClick
| DragEnd
| DragEnter
| DragExit
| DragLeave
| Dra... | |
08048a51be74d86b3b348b4196a3deaf91c06902da2040ddf8eb0759a44cce5d | videlalvaro/claude | postgresql_test.clj | (ns claude.postgresql-test
(:use clojure.test
claude.core)
(:require [claude.postgresql :as cfp]))
(defn mock-vcap-env []
(constantly (slurp (clojure.java.io/resource "json/1.json"))))
(deftest pname
(with-redefs [get-vcap-env (mock-vcap-env)]
(is (= "test-name"
(cfp/name)))
))
(de... | null | https://raw.githubusercontent.com/videlalvaro/claude/ae39a605740e16eb47053637420a80f63270681b/test/claude/postgresql_test.clj | clojure | (ns claude.postgresql-test
(:use clojure.test
claude.core)
(:require [claude.postgresql :as cfp]))
(defn mock-vcap-env []
(constantly (slurp (clojure.java.io/resource "json/1.json"))))
(deftest pname
(with-redefs [get-vcap-env (mock-vcap-env)]
(is (= "test-name"
(cfp/name)))
))
(de... | |
8950be69e012d3330ce038ba3d523201ce62c72c30f3b13043c30392be0bbf9d | kemerovo-man/super-ants-clojure-clr | start.clj | (System.Reflection.Assembly/LoadWithPartialName "System.Windows.Forms")
(System.Reflection.Assembly/LoadWithPartialName "System.Windows.Forms.DataVisualization")
(ns super-ants
(:use [clojure.repl])
(:import [System.Drawing Graphics Bitmap Brush SolidBrush Color Pen Rectangle Size Point BufferedGraphicsManager])
(:... | null | https://raw.githubusercontent.com/kemerovo-man/super-ants-clojure-clr/0ff543da253568504aeb0ddb4810c32d2a13462b/start.clj | clojure | ---------------------------------------- DEBUG ---------------------------------------------
---------------------------------------- LOADING FILES ---------------------------------------------
---------------------------------------- MAIN RUN --------------------------------------------- | (System.Reflection.Assembly/LoadWithPartialName "System.Windows.Forms")
(System.Reflection.Assembly/LoadWithPartialName "System.Windows.Forms.DataVisualization")
(ns super-ants
(:use [clojure.repl])
(:import [System.Drawing Graphics Bitmap Brush SolidBrush Color Pen Rectangle Size Point BufferedGraphicsManager])
(:... |
e3e4278fedfcd0fef90ebab4e67504239d91688cd4e67832995c051a73093176 | google-research/dex-lang | Eval.hs | Copyright 2021 Google LLC
--
-- Use of this source code is governed by a BSD-style
-- license that can be found in the LICENSE file or at
-- -source/licenses/bsd
module MLIR.Eval where
import Data.Function
import qualified Data.ByteString.Char8 as BSC8
import qualified Data.ByteString as BS
import... | null | https://raw.githubusercontent.com/google-research/dex-lang/42cf4941597796a2953bf7595ca6e14d339208d3/src/old/MLIR/Eval.hs | haskell |
Use of this source code is governed by a BSD-style
license that can be found in the LICENSE file or at
-source/licenses/bsd | Copyright 2021 Google LLC
module MLIR.Eval where
import Data.Function
import qualified Data.ByteString.Char8 as BSC8
import qualified Data.ByteString as BS
import GHC.Stack
import qualified MLIR.AST as AST
import qualified MLIR.AST.Serialize as AST
import qualified MLI... |
e74cb6c9dcd58ebf87a794abf8b075261826568c2d192f7b7b1796e7e473cf6d | kofigumbs/elm-beam | Core.hs | module ElmBeam.Core (interfaces, modules) where
import qualified Data.Map as Map
import qualified AST.Module as Module
import qualified AST.Module.Name as ModuleName
import qualified AST.Type as Type
import qualified AST.Variable as Variable
import qualified Elm.Package as Package
import qualified ElmBeam.Compiler as... | null | https://raw.githubusercontent.com/kofigumbs/elm-beam/e998e5715ac2f8b3c3c13c8d94c9191d1a1d0540/src/ElmBeam/Core.hs | haskell | module ElmBeam.Core (interfaces, modules) where
import qualified Data.Map as Map
import qualified AST.Module as Module
import qualified AST.Module.Name as ModuleName
import qualified AST.Type as Type
import qualified AST.Variable as Variable
import qualified Elm.Package as Package
import qualified ElmBeam.Compiler as... | |
f6ba04f1269e3fe222940f5265e667d143e0192b396e3cd4a31072e2aa2e2421 | FranklinChen/Ebnf2ps | EbnfOutput.hs | -- -*- Mode: Haskell -*-
Copyright 1996 by
EbnfOutput.hs --- produce EBNF output for yacc / happy input
-- Initial revision
--
Last Modified By :
--
module EbnfOutput (genEbnfFile) where
import Version
import AbstractSyntax
import GrammarUnfold (GrammarInfo(..),
... | null | https://raw.githubusercontent.com/FranklinChen/Ebnf2ps/131bf89bc56c9503dc941f0b5bad0e2fe8eb4551/src/EbnfOutput.hs | haskell | -*- Mode: Haskell -*-
- produce EBNF output for yacc / happy input
Initial revision
| Copyright 1996 by
Last Modified By :
module EbnfOutput (genEbnfFile) where
import Version
import AbstractSyntax
import GrammarUnfold (GrammarInfo(..),
getNonterminals,
getTerminals,
getProdsInfo,
getReduces,
getEmpties)
genEbnfFile :: String ->... |
d967967ab3588a95a1b521fd55465bf5f2277cb084001a2468866e940fe975e3 | shentufoundation/deepsea | Gen.ml | open Ascii
open BinNums
open Cop
open Ctypes
open Datatypes
open ExpMiniC
open Globalenvs
open Integers
open Maps0
open Monad
open OptErrMonad
open StmtMiniC
open String0
open Trees
* : positive - > expr *
let constofpos p =
Econst_int256 ((Int256.repr (Zpos p)), (Tpointer (Coq_stor, Tvoid)))
(** val clike_rvalu... | null | https://raw.githubusercontent.com/shentufoundation/deepsea/60386608f23e5e316196ac73db417007783240d8/src/backend/extraction/Gen.ml | ocaml | * val clike_rvalue : expr -> expr optErr *
* val clike_rvalue_option : expr option -> expr option optErr *
* val clike_function : coq_function -> coq_function optErr *
* val clike_constructor :
coq_function option -> coq_function option optErr *
* val clike_methoddefs :
coq_function option IntMap.t -> coq_funct... | open Ascii
open BinNums
open Cop
open Ctypes
open Datatypes
open ExpMiniC
open Globalenvs
open Integers
open Maps0
open Monad
open OptErrMonad
open StmtMiniC
open String0
open Trees
* : positive - > expr *
let constofpos p =
Econst_int256 ((Int256.repr (Zpos p)), (Tpointer (Coq_stor, Tvoid)))
let rec clike_rval... |
3cea89a40230e231c9c624dd863855af3cb03025457fc836dfeaab386e9884a5 | jeapostrophe/racket-langserver | test.rkt | #lang racket
(require "../with-document.rkt"
chk
json)
(define uri "file")
(define code
#<<END
#lang racket/base
(define x 0)
(let ([x 1])
x)
END
)
(module+ test
(with-document "../../../main.rkt" uri code
(λ (lsp)
;; definition
(let ([req (read-json (open-input-file "de... | null | https://raw.githubusercontent.com/jeapostrophe/racket-langserver/fc37990ebaf77f0d606c10782e5012f73d663028/tests/textDocument/find-symbol/test.rkt | racket | definition
documentHighlight
symbol
references | #lang racket
(require "../with-document.rkt"
chk
json)
(define uri "file")
(define code
#<<END
#lang racket/base
(define x 0)
(let ([x 1])
x)
END
)
(module+ test
(with-document "../../../main.rkt" uri code
(λ (lsp)
(let ([req (read-json (open-input-file "definition-req1.json")... |
972a2dda648d952d0eac9171be337b109d051a5fe7fdfec012458d9315c5da56 | dfinity/motoko | didc.ml | open Idllib
open Printf
let name = "didc"
let banner = "Candid compiler " ^ Source_id.banner
let usage = "Usage: " ^ name ^ " [option] [file ...]"
(* Argument handling *)
type mode = Default | Check | Js | PrettyPrint
let mode = ref Default
let args = ref []
let add_arg source = args := !args @ [source]
let set_m... | null | https://raw.githubusercontent.com/dfinity/motoko/bb906395e4923e5d61bc25705695fd185e6d5e14/src/exes/didc.ml | ocaml | Argument handling
Main
Sys.catch_break true; - enable to get stacktrace on interrupt
(useful for debugging infinite loops)
| open Idllib
open Printf
let name = "didc"
let banner = "Candid compiler " ^ Source_id.banner
let usage = "Usage: " ^ name ^ " [option] [file ...]"
type mode = Default | Check | Js | PrettyPrint
let mode = ref Default
let args = ref []
let add_arg source = args := !args @ [source]
let set_mode m () =
if !mode <>... |
fa768b99410b08dadac8b2b49018a198f01d15706ae4e3a5050f48a5a1f6cedd | hedgehogqa/haskell-hedgehog-classes | Comonad.hs | # language
DerivingStrategies
, #
DerivingStrategies
, GeneralizedNewtypeDeriving
#-}
# options_ghc -fno - warn - orphans #
module Spec.Comonad
( testComonad
) where
import Data.List.NonEmpty
import Control.Applicative (liftA2)
import Control.Comonad
import Control.Comonad.Sto... | null | https://raw.githubusercontent.com/hedgehogqa/haskell-hedgehog-classes/4d97b000e915de8ba590818f551bce7bd862e7d4/test/Spec/Comonad.hs | haskell | # language
DerivingStrategies
, #
DerivingStrategies
, GeneralizedNewtypeDeriving
#-}
# options_ghc -fno - warn - orphans #
module Spec.Comonad
( testComonad
) where
import Data.List.NonEmpty
import Control.Applicative (liftA2)
import Control.Comonad
import Control.Comonad.Sto... | |
d52cfa861d066a989c761520d8f051562ca944439fcdd95681ed608c67939986 | eyedouble/couchdb | couchdb_server.erl | %% @doc The `couchdb_server' module contains functionality listed under CouchDB API
%% Reference section 1.4.1.
%%
%% The Server module contains mainly maintenace and stats related functionality.
%%
-module(couchdb_server).
-include("couchdb.hrl").
-export([
info/1
,active_tasks/0
,all_dbs/1
,all_dbs... | null | https://raw.githubusercontent.com/eyedouble/couchdb/39830e536e803dfb492bfdb8b3644839cdd7e356/src/sections/couchdb_server.erl | erlang | @doc The `couchdb_server' module contains functionality listed under CouchDB API
Reference section 1.4.1.
The Server module contains mainly maintenace and stats related functionality.
%reference CouchDB Docs 1.2.1
%reference CouchDB Docs 1.2.2
@doc List of running tasks, including the task type, name, status a... | -module(couchdb_server).
-include("couchdb.hrl").
-export([
info/1
,active_tasks/0
,all_dbs/1
,all_dbs/2
,replicate/2
,replicate/3
,replicate/4
]).
@doc Get Information from the server
( ) ) - > { ok , ( ) }
info(#server{url=Url, options=Opts}) ->
case hackney:get(Url, [], <<>... |
5cb6b7a224c0df04ffefcf0d8253c482e87751c8f89f784556fbab977fb91949 | maximedenes/native-coq | typing.mli | (************************************************************************)
v * The Coq Proof Assistant / The Coq Development Team
< O _ _ _ , , * INRIA - CNRS - LIX - LRI - PPS - Copyright 1999 - 2010
\VV/ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *... | null | https://raw.githubusercontent.com/maximedenes/native-coq/3623a4d9fe95c165f02f7119c0e6564a83a9f4c9/pretyping/typing.mli | ocaml | **********************************************************************
// * This file is distributed under the terms of the
* GNU Lesser General Public License Version 2.1
**********************************************************************
* This module provides the typing ma... | v * The Coq Proof Assistant / The Coq Development Team
< O _ _ _ , , * INRIA - CNRS - LIX - LRI - PPS - Copyright 1999 - 2010
\VV/ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
open Names
open Term
open Env... |
e9a479e93e7a771c64337877f665844222b2f89e8398709c0d6f00bf285f7f43 | sgbj/MaximaSharp | cobyla.lisp | ;;; Compiled by f2cl version:
( " f2cl1.l , v 1.222 2010/10/08 03:05:30 "
" f2cl2.l , v 1.37 2008/02/22 22:19:33 rtoy Exp $ "
" f2cl3.l , v 1.6 2008/02/22 22:19:33 rtoy Exp $ "
" f2cl4.l , v 1.7 2008/02/22 22:19:34 rtoy Exp $ "
" f2cl5.l , v 1.204 2010/02/23 05:21:30 "
" f2cl6.l , v 1.48 2008/08/... | null | https://raw.githubusercontent.com/sgbj/MaximaSharp/75067d7e045b9ed50883b5eb09803b4c8f391059/Test/bin/Debug/Maxima-5.30.0/share/maxima/5.30.0/share/cobyla/lisp/cobyla.lisp | lisp | Compiled by f2cl version:
Options: ((:prune-labels nil) (:auto-save t) (:relaxed-array-decls t)
(:coerce-assigns :as-needed) (:array-type ':array)
(:array-slicing t) (:declare-common nil)
(:float-format double-float)) | ( " f2cl1.l , v 1.222 2010/10/08 03:05:30 "
" f2cl2.l , v 1.37 2008/02/22 22:19:33 rtoy Exp $ "
" f2cl3.l , v 1.6 2008/02/22 22:19:33 rtoy Exp $ "
" f2cl4.l , v 1.7 2008/02/22 22:19:34 rtoy Exp $ "
" f2cl5.l , v 1.204 2010/02/23 05:21:30 "
" f2cl6.l , v 1.48 2008/08/24 00:56:27 rtoy Exp $ "
" ... |
d623e6354ec6f2650786c8c6ca8030ef3902fd5657e697beff6e7a2a9a46e9f4 | Kong/HARchiver | cache.mli | open Core.Std
type ('a, 'b) t
val create : unit -> ('a, 'b) t
val get : ('a, 'b) t -> key:string -> exp:float -> thunk:(unit -> ('a, 'b) Result.t Lwt.t) -> ('a, 'b) Result.t Lwt.t
val invalidate : ('a, 'b) t -> string -> unit
| null | https://raw.githubusercontent.com/Kong/HARchiver/eb0aca5c15d536ab2d7fba9d00ed1928466e1a54/src/cache.mli | ocaml | open Core.Std
type ('a, 'b) t
val create : unit -> ('a, 'b) t
val get : ('a, 'b) t -> key:string -> exp:float -> thunk:(unit -> ('a, 'b) Result.t Lwt.t) -> ('a, 'b) Result.t Lwt.t
val invalidate : ('a, 'b) t -> string -> unit
| |
17bbe3863a59caf05d1c9623711549ada37e2c6f5075690ad38155096d560e29 | AbstractMachinesLab/caramel | tail_analysis.ml | { { { COPYING * (
This file is part of Merlin , an helper for ocaml editors
Copyright ( C ) 2013 - 2015 < frederic.bour(_)lakaban.net >
refis.thomas(_)gmail.com >
< simon.castellan(_)iuwt.fr >
Permission is hereby granted , free... | null | https://raw.githubusercontent.com/AbstractMachinesLab/caramel/7d4e505d6032e22a630d2e3bd7085b77d0efbb0c/vendor/ocaml-lsp-1.4.0/ocaml-lsp-server/vendor/merlin/src/ocaml/merlin_specific/411/tail_analysis.ml | ocaml | If the expression is a function, return all of its entry-points (which are
in tail-positions). Returns an empty list otherwise
FIXME: what about method call? It should be translated to a Texp_apply,
but I am not sure | { { { COPYING * (
This file is part of Merlin , an helper for ocaml editors
Copyright ( C ) 2013 - 2015 < frederic.bour(_)lakaban.net >
refis.thomas(_)gmail.com >
< simon.castellan(_)iuwt.fr >
Permission is hereby granted , free... |
f3f89d8230fc69081f472ba342998c7b78ea45efae5cc7fdbfb8f35546004982 | otherjoel/splitflap | feed-tests.rkt | #lang racket/base
;; Unit tests
(require splitflap
gregor
net/url
rackunit)
(define site-id (mint-tag-uri "example.com" "2007" "blog"))
;; Updated time occurring before published time results in exception
(check-exn
exn:fail:contract?
(λ () (feed-item (append-specific site-id "one")
... | null | https://raw.githubusercontent.com/otherjoel/splitflap/a48bb18ac4b21a7d97ba8a7ba1827403bd5f8537/splitflap-tests/tests/feed-tests.rkt | racket | Unit tests
Updated time occurring before published time results in exception
<p>Welcome to my blog.</p><ul><li>&amp ; ' & amp;lt ; & amp;gt ; © ℗ ™ & lt;/li></ul></div></content >
<p>Welcome to my blog.</p><ul><li>&amp ; ' & amp;lt ; & amp;gt ; © ... | #lang racket/base
(require splitflap
gregor
net/url
rackunit)
(define site-id (mint-tag-uri "example.com" "2007" "blog"))
(check-exn
exn:fail:contract?
(λ () (feed-item (append-specific site-id "one")
""
"Kate's First Post"
(person "Kate P... |
dd147c68fe13dea95dac31f4e5dbe2e537fdbbbc6bc32eed506694108783301a | realgenekim/rss-reader-fulcro-demo | authorization_test.clj | (ns com.example.model.authorization-test
(:require
[com.fulcrologic.rad.authorization :as auth]
[com.fulcrologic.rad.database-adapters.datomic :as datomic]
[com.fulcrologic.rad.ids :refer [new-uuid]]
[com.example.model.seed :as seed]
[com.example.model :refer [all-attributes]]
[com.fulcrologic... | null | https://raw.githubusercontent.com/realgenekim/rss-reader-fulcro-demo/c8e590b48f6a1119f5818bd36b2aa8ff2feff8f5/src/datomic-tests/com/example/model/authorization_test.clj | clojure | [datomic.api :as d]
@(d/transact c [(seed/new-account (new-uuid 1) "tony" "" "letmein" | (ns com.example.model.authorization-test
(:require
[com.fulcrologic.rad.authorization :as auth]
[com.fulcrologic.rad.database-adapters.datomic :as datomic]
[com.fulcrologic.rad.ids :refer [new-uuid]]
[com.example.model.seed :as seed]
[com.example.model :refer [all-attributes]]
[com.fulcrologic... |
dde689bc45374d5924ab452955d09ad799e5c744bf3546590148e669fb2a2db8 | d-cent/objective8 | import_draft.clj | (ns objective8.front-end.templates.import-draft
(:require [net.cgrand.enlive-html :as html]
[net.cgrand.jsoup :as jsoup]
[objective8.front-end.templates.page-furniture :as pf]
[objective8.front-end.templates.template-functions :as tf]
[objective8.utils :as utils]))
(de... | null | https://raw.githubusercontent.com/d-cent/objective8/db8344ba4425ca0b38a31c99a3b282d7c8ddaef0/src/objective8/front_end/templates/import_draft.clj | clojure | (ns objective8.front-end.templates.import-draft
(:require [net.cgrand.enlive-html :as html]
[net.cgrand.jsoup :as jsoup]
[objective8.front-end.templates.page-furniture :as pf]
[objective8.front-end.templates.template-functions :as tf]
[objective8.utils :as utils]))
(de... | |
7837103ae8e9d40dd8805c8b17b790e1fe24f98ed0511cc64273897cea950b0b | input-output-hk/rscoin-haskell | Wrapper.hs | {-# LANGUAGE BangPatterns #-}
{-# LANGUAGE DataKinds #-}
# LANGUAGE DeriveGeneric #
# LANGUAGE TemplateHaskell #
{-# LANGUAGE ViewPatterns #-}
import Control.Concurrent (ThreadId, forkIO, killThread)
import Control.Concurrent.Async (mapConcurrently)
import Control... | null | https://raw.githubusercontent.com/input-output-hk/rscoin-haskell/109d8f6f226e9d0b360fcaac14c5a90da112a810/bench/Remote/Wrapper.hs | haskell | # LANGUAGE BangPatterns #
# LANGUAGE DataKinds #
# LANGUAGE ViewPatterns #
users " %
abbrev -s HEAD`,\\\"") | # LANGUAGE DeriveGeneric #
# LANGUAGE TemplateHaskell #
import Control.Concurrent (ThreadId, forkIO, killThread)
import Control.Concurrent.Async (mapConcurrently)
import Control.Exception (finally, onException)
import Control.Monad (unless)
imp... |
ed35306bc36eb06d1e4c84cbef201dd40cae03876b75dfd4f18ff72fc31fc448 | uswitch/blueshift | s3.clj | (ns uswitch.blueshift.s3
(:require [com.stuartsierra.component :refer (Lifecycle system-map using start stop)]
[clojure.tools.logging :refer (info error warn debug errorf)]
[amazonica.aws.s3 :as s3]
[clojure.set :refer (difference)]
[clojure.core.async :refer (go-loop t... | null | https://raw.githubusercontent.com/uswitch/blueshift/98c4345c8145158247c8c88637ae7c01d9df7a83/src/uswitch/blueshift/s3.clj | clojure | (ns uswitch.blueshift.s3
(:require [com.stuartsierra.component :refer (Lifecycle system-map using start stop)]
[clojure.tools.logging :refer (info error warn debug errorf)]
[amazonica.aws.s3 :as s3]
[clojure.set :refer (difference)]
[clojure.core.async :refer (go-loop t... | |
ffc94ca1379c5582f2f17f13a0cc8b602596883f325a09cf3fcd027d1590e50e | synrc/fs | fs_app.erl | -module(fs_app).
-behaviour(application).
-export([start/2, stop/1]).
start(_StartType, _StartArgs) ->
case application:get_env(fs, backwards_compatible) of
{ok, false} -> {ok, self()};
{ok, true} -> fs:start_link(default_fs)
end.
stop(_State) -> ok.
| null | https://raw.githubusercontent.com/synrc/fs/337f80ef4290bb08b18f2cf6ddc1d32f0fb6fcd6/src/fs_app.erl | erlang | -module(fs_app).
-behaviour(application).
-export([start/2, stop/1]).
start(_StartType, _StartArgs) ->
case application:get_env(fs, backwards_compatible) of
{ok, false} -> {ok, self()};
{ok, true} -> fs:start_link(default_fs)
end.
stop(_State) -> ok.
| |
1d6b6ff606dda375c9336fa5239151c156fb82e949cbc7c3d68f59534a8efd4a | drdo/logic-translation | Separation.hs | {-# LANGUAGE MultiWayIf #-}
# LANGUAGE OverloadedLists #
# LANGUAGE RecordWildCards #
# LANGUAGE UnicodeSyntax #
module Separation
( sep, sepWithSimplify
, t1, t2, t3, t4, t5, t6, t7, t8
)
where
import Data.Foldable
import Data.List
import Data.Maybe
import Data.Monoid
import Data.Set (Set)
import Numeric.Natur... | null | https://raw.githubusercontent.com/drdo/logic-translation/3efca7ce74b2e018a6ac4a8dacfc8a2dcfbd467f/library/Separation.hs | haskell | # LANGUAGE MultiWayIf #
------------------------------------------------------------------------------
------------------------------------------------------------------------------
------------------
cases 1,2,3
case 0
Already separated
Already separated
t8
t7
t6
t2
t4
t1
The order we choose appears to affe... | # LANGUAGE OverloadedLists #
# LANGUAGE RecordWildCards #
# LANGUAGE UnicodeSyntax #
module Separation
( sep, sepWithSimplify
, t1, t2, t3, t4, t5, t6, t7, t8
)
where
import Data.Foldable
import Data.List
import Data.Maybe
import Data.Monoid
import Data.Set (Set)
import Numeric.Natural
import qualified Data.Set... |
6dd8f40971a40e0dd30644086f2fe0dab8cc8a28a70032bd77b385725b8c01e0 | janestreet/core | test_blang.ml | open! Core
open! Import
open! Blang
let andalso = O.( && )
let orelse = O.( || )
let%test_module "Stable.V1" =
(module Stable_unit_test.Make (struct
type t = string Stable.V1.t [@@deriving bin_io, equal, sexp]
let test_blang =
if_
(base "foo")
(not_ (or_ [ base "bara"; ... | null | https://raw.githubusercontent.com/janestreet/core/f382131ccdcb4a8cd21ebf9a49fa42dcf8183de6/core/test/test_blang.ml | ocaml | b/c (if a b c) = (if (not a) c b)
b/c (if a b c) = (if (not a) c b)
all random values are generated from a fixed PRNG seed so that
unit tests are deterministic
an arbitrary [f] such that [f x = b] whenever [g x = `Known b]
If this test fails on `javascript-runtest`, then js-of-ocaml may have
a bug ... | open! Core
open! Import
open! Blang
let andalso = O.( && )
let orelse = O.( || )
let%test_module "Stable.V1" =
(module Stable_unit_test.Make (struct
type t = string Stable.V1.t [@@deriving bin_io, equal, sexp]
let test_blang =
if_
(base "foo")
(not_ (or_ [ base "bara"; ... |
5c696db7de4673cad9bc82d8df1aa5afc4495f142f371b27f46fcab628ebd535 | lvh/caesium | hash.clj | (ns caesium.crypto.hash
(:require [caesium.binding :as b]
[caesium.byte-bufs :as bb]))
(b/defconsts [sha256-bytes sha512-bytes])
(defn sha256-to-buf!
"Hashes a message with optional key into a given output buffer using
SHA-256.
You only want this to manage the output byte array yourself. Otherwis... | null | https://raw.githubusercontent.com/lvh/caesium/cb90a4325fa48a2e4fb6cad810f340125a53fc57/src/caesium/crypto/hash.clj | clojure | (ns caesium.crypto.hash
(:require [caesium.binding :as b]
[caesium.byte-bufs :as bb]))
(b/defconsts [sha256-bytes sha512-bytes])
(defn sha256-to-buf!
"Hashes a message with optional key into a given output buffer using
SHA-256.
You only want this to manage the output byte array yourself. Otherwis... | |
59983ddf6d24b29ab4613c84bdb5ad8d3431de3fa2f4c9c4ebc9d7c0fae7ac3b | FranklinChen/learn-you-some-erlang | discrep4.erl | -module(discrep4).
-export([run/0]).
-type cents() :: integer().
-type account() :: atom().
-type transaction() :: {'give', cents(), account()}.
run() ->
Tup = money(5, you),
some_op(item(count,Tup), item(account,Tup)).
-spec money(cents(), account()) -> transaction().
money(Num, Name) -> {give, Num, Name}.
... | null | https://raw.githubusercontent.com/FranklinChen/learn-you-some-erlang/878c8bc2011a12862fe72dd7fdc6c921348c79d6/discrep4.erl | erlang | -module(discrep4).
-export([run/0]).
-type cents() :: integer().
-type account() :: atom().
-type transaction() :: {'give', cents(), account()}.
run() ->
Tup = money(5, you),
some_op(item(count,Tup), item(account,Tup)).
-spec money(cents(), account()) -> transaction().
money(Num, Name) -> {give, Num, Name}.
... | |
8d42b971dfe72efd6afa479f457f08e5d2178166137e52d9abf271c49b2db87d | KaroshiBee/weevil | utils.ml | open Data_encoding
open Dapper.Dap
module Model = Mdb.Mdb_model
module PP = Tezos_micheline.Micheline_parser
let deduplicate_stable xs =
(* de-dups the string list but keeps it in order *)
let module SSet = Set.Make (String) in
let (_, ys) =
let init = (SSet.empty, []) in
List.fold_left
(fun (sset,... | null | https://raw.githubusercontent.com/KaroshiBee/weevil/1b166ba053062498c1ec05c885e04fba4ae7d831/lib/adapter/utils.ml | ocaml | de-dups the string list but keeps it in order | open Data_encoding
open Dapper.Dap
module Model = Mdb.Mdb_model
module PP = Tezos_micheline.Micheline_parser
let deduplicate_stable xs =
let module SSet = Set.Make (String) in
let (_, ys) =
let init = (SSet.empty, []) in
List.fold_left
(fun (sset, out) -> function
| x when SSet.mem x sset ->... |
67a649d09dd3bcd75af7c42cc482416813a9823ab3c1e4a18965877496c841b0 | shnarazk/mios | verbose2csv.hs | -- | Usage: by running as `runhaskell verbose2csv.hs < a.log > a.csv`
-- | convert a log with the following format:
> # # [ uf100-01.cnf ] NumOfBackjump : 156 , NumOfRestart : 1 , NumOfPropagation : 16067
-- to csv with the following format;
> 1 , uf100-01.cnf , 156 , 1 , 16067
-- with the header:
> n... | null | https://raw.githubusercontent.com/shnarazk/mios/d032d761d73224f981a07ec2ea90936db6f495e8/MultiConflict/utils/verbose2csv.hs | haskell | | Usage: by running as `runhaskell verbose2csv.hs < a.log > a.csv`
| convert a log with the following format:
to csv with the following format;
with the header: | > # # [ uf100-01.cnf ] NumOfBackjump : 156 , NumOfRestart : 1 , NumOfPropagation : 16067
> 1 , uf100-01.cnf , 156 , 1 , 16067
> num , problem , nbackjump , nrestart , npropagation
module Main where
import Data.List
import Text.ParserCombinators.ReadP
main :: IO ()
main = interact (merge . map f . lines)... |
58d256929234dcc1845d0107635e3c9e299c4e5c3694001730368c12deef423f | geneweb/geneweb | notesDisplay.mli | val print_linked_list :
Config.config ->
Gwdb.base ->
(Gwdb.iper, Gwdb.ifam) Def.NLDB.page list ->
unit
(** Displays the page list in argument *)
val print : Config.config -> Gwdb.base -> unit
(** Displays the base notes *)
val print_mod : Config.config -> Gwdb.base -> unit
(** Displays a text form for notes ... | null | https://raw.githubusercontent.com/geneweb/geneweb/747f43da396a706bd1da60d34c04493a190edf0f/lib/notesDisplay.mli | ocaml | * Displays the page list in argument
* Displays the base notes
* Displays a text form for notes creation/edition
* Updates notes
* Displays a menu to search in notes
* Same as `print_misc_notes`, with a default search | val print_linked_list :
Config.config ->
Gwdb.base ->
(Gwdb.iper, Gwdb.ifam) Def.NLDB.page list ->
unit
val print : Config.config -> Gwdb.base -> unit
val print_mod : Config.config -> Gwdb.base -> unit
val print_mod_ok : Config.config -> Gwdb.base -> unit
val print_misc_notes : Config.config -> Gwdb.base ->... |
a7bdde0a0f5fb32678119030b9f50f396dd31a85ad93bfa9fdbd4c4a1f1b2fce | cyverse-archive/DiscoveryEnvironmentBackend | workspace.clj | (ns metadactyl.workspace
(:use [kameleon.queries]
[korma.core :exclude [update]]
[metadactyl.user :only [current-user]]
[slingshot.slingshot :only [throw+]]))
(defn get-workspace
"Gets a workspace database entry for the given username or the current user."
([]
(get-workspace (:userna... | null | https://raw.githubusercontent.com/cyverse-archive/DiscoveryEnvironmentBackend/7f6177078c1a1cb6d11e62f12cfe2e22d669635b/services/metadactyl-clj/src/metadactyl/workspace.clj | clojure | (ns metadactyl.workspace
(:use [kameleon.queries]
[korma.core :exclude [update]]
[metadactyl.user :only [current-user]]
[slingshot.slingshot :only [throw+]]))
(defn get-workspace
"Gets a workspace database entry for the given username or the current user."
([]
(get-workspace (:userna... | |
3daceb537f5ecfa40fa5ae7882364faaa87bcd9abdeb7452b112975878785d3f | xapi-project/xen-api | xenops_interface.ml |
* Copyright ( C ) 2011 Citrix Systems Inc.
*
* This program is free software ; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published
* by the Free Software Foundation ; version 2.1 only . with the special
* exception on linking described in fi... | null | https://raw.githubusercontent.com/xapi-project/xen-api/bb38ada4a3c6e6012a6dce23429b74b1295e1319/ocaml/xapi-idl/xen/xenops_interface.ml | ocaml | register printer
Unique to this invocation of xenopsd
XXX: this code shouldn't care about the vswitch/bridge difference
* Name of a local switch
* Vm.id * switch
* Xcp_pci.address
SRIOV VF
all traffic permitted
no traffic permitted
An s-expression encoded Backtrace.t |
* Copyright ( C ) 2011 Citrix Systems Inc.
*
* This program is free software ; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published
* by the Free Software Foundation ; version 2.1 only . with the special
* exception on linking described in fi... |
c819ccf4c34ba7e97bb1b3d93607c1d761b080eb3f992aa773549e55e24ab9cd | coq/coq | resumption.ml | let doc =
"Definition a := Type.
Definition b := Prop.
Definition c :=
b.
Definition d :=
c.
(* this is a comment *)
Definition m :=
forall (x : Type), x.
"
let parse pa n =
let entry = Pvernac.Vernac_.main_entry in
let rec loop res n =
if n = 0 then res else
match Pcoq.Entry.parse entry pa... | null | https://raw.githubusercontent.com/coq/coq/686e9097959307e382f8889aa63fe8638ad76fc1/test-suite/unit-tests/parsing/resumption.ml | ocaml | this is a comment
Use junk
Use offset to set count and avoid the junk | let doc =
"Definition a := Type.
Definition b := Prop.
Definition c :=
b.
Definition d :=
c.
Definition m :=
forall (x : Type), x.
"
let parse pa n =
let entry = Pvernac.Vernac_.main_entry in
let rec loop res n =
if n = 0 then res else
match Pcoq.Entry.parse entry pa with
| None -> re... |
03da840ed9869fa67fd83245d989f5fc10119db052fceae0909922f67af6f400 | leo-project/leo_object_storage | leo_object_storage_api.erl | %%======================================================================
%%
%% Leo Object Storage
%%
Copyright ( c ) 2012 - 2017 Rakuten , Inc.
%%
This file is provided to you under the Apache License ,
%% Version 2.0 (the "License"); you may not use this file
except in compliance with the License . You may obt... | null | https://raw.githubusercontent.com/leo-project/leo_object_storage/139a3d8f174e334aaf54f4e53d2f4fb8db04fc83/src/leo_object_storage_api.erl | erlang | ======================================================================
Leo Object Storage
Version 2.0 (the "License"); you may not use this file
a copy of the License at
-2.0
Unless required by applicable law or agreed to in writing,
KIND, either express or implied. See the License for the
specific langu... | Copyright ( c ) 2012 - 2017 Rakuten , Inc.
This file is provided to you under the Apache License ,
except in compliance with the License . You may obtain
software distributed under the License is distributed on an
" AS IS " BASIS , WITHOUT WARRANTIES OR CONDITIONS OF ANY
-project/leo_object_storage/blob/... |
9b0f0867e4660dc5b4e6a8c88df62a685cf41c28c8d3a9f936140e4d11e8eccb | aeolus-project/zephyrus | load_settings.ml | (****************************************************************************)
(* *)
This file is part of Zephyrus .
(* *)
Z... | null | https://raw.githubusercontent.com/aeolus-project/zephyrus/0b52de4038bbab724e6a9628430165a7f09f77ae/src/input/load_settings.ml | ocaml | **************************************************************************
(at your option) any later version.
... | This file is part of Zephyrus .
Zephyrus is free software : you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation , either version 3 of the License , or
Zephyru... |
d1037dea0f65872d77185c581d949e4070cdf02195261f96b9c34585bd94f289 | JeffreyBenjaminBrown/digraphs-with-text | QNode.hs | module Dwt.Second.QNode (
QNode - > QNode
QNode - > QNode
QNode - > Either
, mkRoleMap -- QNode -> [QNode] -> RoleMap
) where
import Dwt.Initial.Types
import Dwt.Initial.Measure (extractTplt)
import Dwt.Second.MkTplt (jointsToTplt)
import qualified Data.Map as Map
qNodeTop :: QNode -> QNode
qNodeTop (QRel... | null | https://raw.githubusercontent.com/JeffreyBenjaminBrown/digraphs-with-text/34e47a52aa9abb6fd42028deba1623a92e278aae/src/Dwt/Second/QNode.hs | haskell | QNode -> [QNode] -> RoleMap
| Applies only when all the nodes the Rel involves are known. | module Dwt.Second.QNode (
QNode - > QNode
QNode - > QNode
QNode - > Either
) where
import Dwt.Initial.Types
import Dwt.Initial.Measure (extractTplt)
import Dwt.Second.MkTplt (jointsToTplt)
import qualified Data.Map as Map
qNodeTop :: QNode -> QNode
qNodeTop (QRel _ js qs) = QRel True js qs
qNodeTop x = x
q... |
d1dc71ea324218f0cb74f765045d191e391aead278395c253a9fff60a3687434 | alanz/ghc-exactprint | Arith.hs | {-# LANGUAGE GADTs #-}
{-# LANGUAGE RankNTypes #-}
module Arith where
data E a b = E (a -> b) (b -> a)
eqRefl :: E a a
eqRefl = E id id
-- just to construct unique strings
data W
data M a
-- terms
data Var a where
VarW :: Var W
VarM :: Var (M a)
-- expose s in the type level making sure it is a string
data Ab... | null | https://raw.githubusercontent.com/alanz/ghc-exactprint/b6b75027811fa4c336b34122a7a7b1a8df462563/tests/examples/ghc86/Arith.hs | haskell | # LANGUAGE GADTs #
# LANGUAGE RankNTypes #
just to construct unique strings
terms
expose s in the type level making sure it is a string
(x:ty) in G
typing derivations
the g,g0 makes sure that env is non-empty
G |- \x.x : a -> a
G |- (\x.x) Lit : Lit
G |- \x.\y. x y : (C -> C) -> C -> C
evaluation
existential... |
module Arith where
data E a b = E (a -> b) (b -> a)
eqRefl :: E a a
eqRefl = E id id
data W
data M a
data Var a where
VarW :: Var W
VarM :: Var (M a)
data Abs s e1 where
Abs :: (Var s) -> e1 -> Abs (Var s) e1
data App e1 e2 = App e1 e2
data Lit = Lit
data TyBase = TyBase
data TyArr t1 t2 = TyA... |
3883df56d66a28905a3d5069f264fa071aa8e603f2999496dd577b1f974edcad | brianhempel/maniposynth | btree_height.ml | type 'a btree = Node of 'a btree * 'a * 'a btree | Empty
let rec btree_height tree =
match tree with
| Node (l, _, r) ->
let l_height = btree_height l [@@pos 45, 0] in
let r_height = btree_height r [@@pos 447, 10] in
let child_max = max l_height r_height [@@pos 371, 168] in
1 + child_max
... | null | https://raw.githubusercontent.com/brianhempel/maniposynth/8cb8e0c84db2ffb51feae2fccb10dbff40c4e0e0/expert_eval_manual/btree_height.ml | ocaml | type 'a btree = Node of 'a btree * 'a * 'a btree | Empty
let rec btree_height tree =
match tree with
| Node (l, _, r) ->
let l_height = btree_height l [@@pos 45, 0] in
let r_height = btree_height r [@@pos 447, 10] in
let child_max = max l_height r_height [@@pos 371, 168] in
1 + child_max
... | |
5ff796b2a9a546492a7645b21881c625fc8c0c5d74c97f35de4638f13023630b | Jell/euroclojure-2016 | goal.cljs | (ns euroclojure.goal)
(defn slide [{:keys [speaker]}]
[:div.slide.centered
[:h1 "Goal"]
[:em "Get a flexible solution that can handle the upcoming features
we were planning"]])
| null | https://raw.githubusercontent.com/Jell/euroclojure-2016/a8ca883e8480a4616ede19995aaacd4a495608af/src/euroclojure/goal.cljs | clojure | (ns euroclojure.goal)
(defn slide [{:keys [speaker]}]
[:div.slide.centered
[:h1 "Goal"]
[:em "Get a flexible solution that can handle the upcoming features
we were planning"]])
| |
aab8f73d4e23eed24726e49275cebfe88c78afb3ec0e321b57218b8a57917016 | rescript-lang/bucklescript-addons | main_entry.ml |
Js.log "hello world"
| null | https://raw.githubusercontent.com/rescript-lang/bucklescript-addons/c544020712b9507b8b4900444320c2448f9c7ae5/examples/hello/main_entry.ml | ocaml |
Js.log "hello world"
| |
9f63ada7eb4bd3c88112679f59db3c4a271f5cedf09dfb6a3b291f384377ca7e | subtitle-master/subtitlemaster | organize.cljs | (ns smgui.organize
(:require-macros [wilkerdev.util.macros :refer [dochan <? go-catch]]
[cljs.core.async.macros :refer [go]])
(:require [om.dom :as dom]
[om.core :as om]
[sm.util :refer [episode-info]]
[smgui.core :refer [flux-channel]]
[smgui.gui :... | null | https://raw.githubusercontent.com/subtitle-master/subtitlemaster/d88c2fb007c6c3d4030fefbd4b7e3eafb0e797a9/src/cljs/smgui/organize.cljs | clojure | (ns smgui.organize
(:require-macros [wilkerdev.util.macros :refer [dochan <? go-catch]]
[cljs.core.async.macros :refer [go]])
(:require [om.dom :as dom]
[om.core :as om]
[sm.util :refer [episode-info]]
[smgui.core :refer [flux-channel]]
[smgui.gui :... | |
b96012871c47204679bc19ee21783f3e2adf69ecaaf7e46fb3adcb1def4ecfcb | ocaml/opam | opamSysInteract.mli | (**************************************************************************)
(* *)
Copyright 2019 - 2020 OCamlPro
(* *)
(* All right... | null | https://raw.githubusercontent.com/ocaml/opam/e7998adf4ccd4672f5cd654da172e7c505334e13/src/state/opamSysInteract.mli | ocaml | ************************************************************************
All rights reserved. This file is distributed under the terms of the
exception on linking descr... | Copyright 2019 - 2020 OCamlPro
GNU Lesser General Public License version 2.1 , with the special
open OpamStateTypes
Given a list of system packages , retrieve their installation status from the
system and returns a pair of [ sys_package ] set :
* fi... |
51eb802e97ef679e41b0156d5d5706f67169a172b19e7762ed506180d8b22f96 | penpot/penpot | constraints.cljs | This Source Code Form is subject to the terms of the Mozilla Public
License , v. 2.0 . If a copy of the MPL was not distributed with this
file , You can obtain one at /.
;;
;; Copyright (c) KALEIDOS INC
(ns app.main.ui.workspace.sidebar.options.menus.constraints
(:require
[app.common.data :as d]
[app.com... | null | https://raw.githubusercontent.com/penpot/penpot/3de217a52efd12759b2c0e821f190bf805db41e1/frontend/src/app/main/ui/workspace/sidebar/options/menus/constraints.cljs | clojure |
Copyright (c) KALEIDOS INC
CONSTRAINTS | This Source Code Form is subject to the terms of the Mozilla Public
License , v. 2.0 . If a copy of the MPL was not distributed with this
file , You can obtain one at /.
(ns app.main.ui.workspace.sidebar.options.menus.constraints
(:require
[app.common.data :as d]
[app.common.geom.shapes :as gsh]
[app.... |
024075140fc7e2ea1a1fc38a87d5154f937c0e0fd85755404a8a5c1e990fe457 | kongo2002/statser | statser_listener_udp.erl | Copyright 2017 - 2018
%
Licensed under the Apache License , Version 2.0 ( the " License " ) ;
% you may not use this file except in compliance with the License.
% You may obtain a copy of the License at
%
% -2.0
%
% Unless required by applicable law or agreed to in writing, software
distributed under the Li... | null | https://raw.githubusercontent.com/kongo2002/statser/1cb0498f56c97d8a010b979c5163dd2750064e98/src/statser_listener_udp.erl | erlang |
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
-2.0
Unless required by applicable law or agreed to in writing, software
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing perm... | Copyright 2017 - 2018
Licensed under the Apache License , Version 2.0 ( the " License " ) ;
distributed under the License is distributed on an " AS IS " BASIS ,
-module(statser_listener_udp).
-behaviour(gen_server).
-ifdef(TEST).
-include_lib("eunit/include/eunit.hrl").
-endif.
-include("statser.hrl").
-ex... |
f150a7e2956dc2369462a9de32b15f60b84250b77b6bd73c3f3630d8375c4039 | chefy-io/clojure-katas | sine_angle.clj | (ns clojure-katas.sine-angle
(:require [clojure-katas.core :as core]))
(core/defproblem sine
"The sine of an angle (specified in radians) can be computed
by making use of the approximation sin x x if x is sufficiently small,
and the trigonometric identity:
sin(r) = 3sin(r/3) -. 4sin^3(r/3)"
[angle]) | null | https://raw.githubusercontent.com/chefy-io/clojure-katas/81efe02dfe5add9e10146e10dd2b34f072f7686e/src/clojure_katas/sine_angle.clj | clojure | (ns clojure-katas.sine-angle
(:require [clojure-katas.core :as core]))
(core/defproblem sine
"The sine of an angle (specified in radians) can be computed
by making use of the approximation sin x x if x is sufficiently small,
and the trigonometric identity:
sin(r) = 3sin(r/3) -. 4sin^3(r/3)"
[angle]) | |
c4e38c4757c286e11843b420c75fc6c506f0d981770d8fcbbb56ceda460d8686 | bmeurer/ocaml-experimental | odoc_env.mli | (***********************************************************************)
(* OCamldoc *)
(* *)
, projet Cristal , INRIA Rocquencourt
(* ... | null | https://raw.githubusercontent.com/bmeurer/ocaml-experimental/fe5c10cdb0499e43af4b08f35a3248e5c1a8b541/ocamldoc/odoc_env.mli | ocaml | *********************************************************************
OCamldoc
... | , projet Cristal , INRIA Rocquencourt
Copyright 2001 Institut National de Recherche en Informatique et
en Automatique . All rights reserved . This file is distributed
under the terms of the Q Public License version 1.0 .
$ Id$
type env
val empty : env
val ... |
920f3a0b838b20eb397becaa4cd8a03c6666e70daede584dfdade9c81b1d0fd8 | FlowerWrong/mblog | counter2.erl | %% ---
Excerpted from " Programming Erlang , Second Edition " ,
published by The Pragmatic Bookshelf .
%% Copyrights apply to this code. It may not be used to create training material,
%% courses, books, articles, and the like. Contact us if you are in doubt.
%% We make no guarantees that this code is fit for... | null | https://raw.githubusercontent.com/FlowerWrong/mblog/3233ede938d2019a7b57391405197ac19c805b27/categories/erlang/demo/jaerlang2_code/counter2.erl | erlang | ---
Copyrights apply to this code. It may not be used to create training material,
courses, books, articles, and the like. Contact us if you are in doubt.
We make no guarantees that this code is fit for any purpose.
Visit for more book information.
--- | Excerpted from " Programming Erlang , Second Edition " ,
published by The Pragmatic Bookshelf .
-module(counter2).
-export([start/0, read/1]).
( 1 )
( 2 )
Pid ! {self(), read},
receive
{Pid, N} ->
N
end.
counter(N) ->
receive
bump ->
counter(N+1);
( 3 )... |
2e2d287cb0fb4173be5b04e148fae0ff70863eb8c7539dca0fda3da88fa2a7b0 | spurious/sagittarius-scheme-mirror | %3a17.scm | ;;; -*- Scheme -*-
;;;
;;; generalized-set! - SRFI-17 generalized set!
;;;
Copyright ( c ) 2010 - 2012 < >
;;;
;;; Redistribution and use in source and binary forms, with or without
;;; modification, are permitted provided that the following conditions
;;; are met:
;;;
;;; 1. Redistributions ... | null | https://raw.githubusercontent.com/spurious/sagittarius-scheme-mirror/53f104188934109227c01b1e9a9af5312f9ce997/sitelib/srfi/%253a17.scm | scheme | -*- Scheme -*-
generalized-set! - SRFI-17 generalized set!
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
1. Redistributions of source code must retain the above copyright
notice, this list of... | Copyright ( c ) 2010 - 2012 < >
" AS IS " AND ANY EXPRESS OR IMPLIED WARRANTIES , INCLUDING , BUT NOT
SPECIAL , EXEMPLARY , OR CONSEQUENTIAL DAMAGES ( INCLUDING , BUT NOT LIMITED
LIABILITY , WHETHER IN CONTRACT , STRICT LIABILITY , OR TORT ( INCLUDING
(library (srfi :17) (export :all) (import (s... |
d1b32f3409de700ba07f6094ab8a1cf21fcee97b58c44c3117d41b92f7bf2e9a | google/ormolu | overlapping.hs | deriving instance
{-# OVERLAPPABLE #-}
Ord
Foo
deriving instance
{-# OVERLAPPING #-}
Num
Foo
deriving instance
{-# OVERLAPS #-}
Read
Foo
deriving instance
# INCOHERENT #
Show
Foo
| null | https://raw.githubusercontent.com/google/ormolu/ffdf145bbdf917d54a3ef4951fc2655e35847ff0/data/examples/declaration/deriving/overlapping.hs | haskell | # OVERLAPPABLE #
# OVERLAPPING #
# OVERLAPS # | deriving instance
Ord
Foo
deriving instance
Num
Foo
deriving instance
Read
Foo
deriving instance
# INCOHERENT #
Show
Foo
|
260f295008851073efe19b358627d0b87036fcdb64204a6f4840df2a717d7ded | henry-hz/erlang-trader | fix_engine_server.erl | -module(fix_engine_server).
-behaviour(gen_server).
%% ====================================================================
%% API functions
%% ====================================================================
-export([add_listener/4, remove_listener/2]).
%% Internal exports
-export([start_link/0,
init/1... | null | https://raw.githubusercontent.com/henry-hz/erlang-trader/5ec6a20902a894e0c29712f199bb6be3fad68a3b/fix_engine/src/fix_engine_server.erl | erlang | ====================================================================
API functions
====================================================================
Internal exports
API
@doc Start the fix_engine gen_server.
Each worker will be a listener to Ranch module.
@doc Register/Unregister data receivers
| -module(fix_engine_server).
-behaviour(gen_server).
-export([add_listener/4, remove_listener/2]).
-export([start_link/0,
init/1,
handle_cast/2,
handle_info/2,
terminate/2,
code_change/3]).
-spec start_link() -> {ok, pid()}.
start_link() ->
gen_server:start_link({loca... |
8ae3d1829d9660612d04d065addae180bc6c58a9b038ddba005f4097656c84b8 | grin-compiler/grin | OptimiseAbstractProgram.hs | # LANGUAGE RecordWildCards #
# LANGUAGE LambdaCase #
# LANGUAGE ViewPatterns #
module AbstractInterpretation.OptimiseAbstractProgram where
import AbstractInterpretation.IR
import Data.List (sortBy)
import Data.Maybe (maybeToList)
import Data.Graph hiding (edges)
import qualified Data.Set as Set
import qualified Data.... | null | https://raw.githubusercontent.com/grin-compiler/grin/44ac2958810ecee969c8028d2d2a082d47fba51b/grin/src/AbstractInterpretation/OptimiseAbstractProgram.hs | haskell |
Optimisation needs further investigation.
| # LANGUAGE RecordWildCards #
# LANGUAGE LambdaCase #
# LANGUAGE ViewPatterns #
module AbstractInterpretation.OptimiseAbstractProgram where
import AbstractInterpretation.IR
import Data.List (sortBy)
import Data.Maybe (maybeToList)
import Data.Graph hiding (edges)
import qualified Data.Set as Set
import qualified Data.... |
8ad28c2d009f433fe471a4a7b635b9e0f82e28167682ee731f22efbb1273cd2c | dmp1ce/DMSS | Network.hs | -- |
Module :
-- License : Public Domain
--
-- Maintainer :
-- Stability : experimental
-- Portability : untested
--
-- Dead Man Switch System daemon network functions
--
module DMSS.Daemon.Network where
import DMSS.Daemon.Memory (DaemonTVar)
import DMSS.Storage.TH (Peer (Peer))
import DMSS.Storage (... | null | https://raw.githubusercontent.com/dmp1ce/DMSS/fd88690d97ed267e76f8345e6a76cd3727ef4efb/src-lib/DMSS/Daemon/Network.hs | haskell | |
License : Public Domain
Maintainer :
Stability : experimental
Portability : untested
Dead Man Switch System daemon network functions
| Listing for messages from connection
| Add connection to shared memory
| Attempt to create a connection with a listening peer
| Listen for incoming connections
T... | Module :
module DMSS.Daemon.Network where
import DMSS.Daemon.Memory (DaemonTVar)
import DMSS.Storage.TH (Peer (Peer))
import DMSS.Storage (Host (Host), Port (Port))
import Network.Socket
( close, accept, withSocketsDo, defaultHints, addrSocketType, getAddrInfo
, addrFamily, addrSocketType, addrProtocol, ... |
7e3afb2d417fd48b94be4147ffdddac9093c80cf275d4a4043ae48066b2bc5b5 | haskell-unordered-containers/unordered-containers | ByteString.hs | -- | Benchmarking utilities. For example, functions for generating
random ' ByteString 's .
module Util.ByteString where
import qualified Data.ByteString as S
import qualified Data.ByteString.Char8 as C
import qualified Util.String as String
| Generate a number of fixed length ' ByteString 's whe... | null | https://raw.githubusercontent.com/haskell-unordered-containers/unordered-containers/42a25dbc19babf7c1153ae19bdef609f8308de04/benchmarks/Util/ByteString.hs | haskell | | Benchmarking utilities. For example, functions for generating
of the strings are letters in ascending order.
^ Length of each string
^ Number of strings
of the strings are letters in random order.
^ Length of each string
^ Number of strings
of the strings are letters in random order, different from @rnd@.
^... | random ' ByteString 's .
module Util.ByteString where
import qualified Data.ByteString as S
import qualified Data.ByteString.Char8 as C
import qualified Util.String as String
| Generate a number of fixed length ' ByteString 's where the content
-> [S.ByteString]
asc strlen num = map C.pack $ S... |
1002eb38b0487a2a1fca12043720f524f4d4e91275b1ca64b388e44087069ba7 | michaelballantyne/ee-lib | datum-map.rkt | #lang racket/base
(provide datum-map)
;; datum-map copied from the Racket expander:
;; syntax/datum-map.rkt
(require racket/fixnum racket/prefab)
;; `(datum-map v f)` walks over `v`, traversing objects that
;; `datum->syntax` traverses to convert content to syntax objects.
;;
;; `(f tail? d)` is called on each ... | null | https://raw.githubusercontent.com/michaelballantyne/ee-lib/82d0129278c11641f34b9f145edb74a9e404b35f/private/datum-map.rkt | racket | datum-map copied from the Racket expander:
syntax/datum-map.rkt
`(datum-map v f)` walks over `v`, traversing objects that
`datum->syntax` traverses to convert content to syntax objects.
`(f tail? d)` is called on each datum `d`, where `tail?`
indicates that the value is a pair/null in a `cdr` --- so that it
... | #lang racket/base
(provide datum-map)
(require racket/fixnum racket/prefab)
on ` cdr`s that have been taken
(define (datum-map s f [gf f] [seen #f] [known-pairs #f])
(let loop ([tail? #f] [s s] [prev-depth 0])
(cond
[(and seen (depth . fx> . 32))
(datum-map-slow tail? s (lambda (tail? s) (gf ... |
b24f94543b19ae1ff860775974c4da719208d2a7b996ae3b62f62e27c5bea918 | CoNarrative/precept | core.cljs | (ns fullstack.core
(:require [reagent.core :as r]
[mount.core :as mount]
[fullstack.rules :refer [app-session]]
[fullstack.views :as views]
[fullstack.ws :as ws]
[precept.core :refer [start!]]))
(defn mount-components []
(r/render #'views/app (.getElemen... | null | https://raw.githubusercontent.com/CoNarrative/precept/6078286cae641b924a2bffca4ecba19dcc304dde/examples/fullstack/src/cljs/fullstack/core.cljs | clojure | (ns fullstack.core
(:require [reagent.core :as r]
[mount.core :as mount]
[fullstack.rules :refer [app-session]]
[fullstack.views :as views]
[fullstack.ws :as ws]
[precept.core :refer [start!]]))
(defn mount-components []
(r/render #'views/app (.getElemen... | |
b64ec888f6f94952b75c08bc9a3c864d65b7a0ca53f3a899fe9f25fb4f322f71 | mzp/coq-ruby | hashcons.ml | (************************************************************************)
v * The Coq Proof Assistant / The Coq Development Team
< O _ _ _ , , * CNRS - Ecole Polytechnique - INRIA Futurs - Universite Paris Sud
\VV/ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *... | null | https://raw.githubusercontent.com/mzp/coq-ruby/99b9f87c4397f705d1210702416176b13f8769c1/lib/hashcons.ml | ocaml | **********************************************************************
// * This file is distributed under the terms of the
* GNU Lesser General Public License Version 2.1
**********************************************************************
Hash consing of datastructures
Th... | v * The Coq Proof Assistant / The Coq Development Team
< O _ _ _ , , * CNRS - Ecole Polytechnique - INRIA Futurs - Universite Paris Sud
\VV/ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
$ I d : hashcons.ml 5920 ... |
ecb61b903e2fbba94cea4da5cb9dfbaf6f2e611a62b465a880059beecb7958e4 | oakes/play-cljc-examples | project.clj | (defproject dungeon-crawler "0.1.0-SNAPSHOT"
:license {:name "Public Domain"
:url ""}
:repositories [["clojars" {:url ""
:sign-releases false}]]
:clean-targets ^{:protect false} ["target"]
:main dungeon-crawler.start
:aot [dungeon-crawler.start])
| null | https://raw.githubusercontent.com/oakes/play-cljc-examples/76edebe22bf5d08f5eb78970dba1fd577c8be15a/dungeon-crawler/project.clj | clojure | (defproject dungeon-crawler "0.1.0-SNAPSHOT"
:license {:name "Public Domain"
:url ""}
:repositories [["clojars" {:url ""
:sign-releases false}]]
:clean-targets ^{:protect false} ["target"]
:main dungeon-crawler.start
:aot [dungeon-crawler.start])
| |
b39d215fa1ca2df27bd3ae015b1ac50d2e526bc28ab720224a7d77c55e72a4a1 | marick/Midje | t_expects.clj | (ns midje.parsing.2-to-lexical-maps.t-expects
(:require [clojure.test :refer :all] ;; This is used to check production mode with deftest.
[midje.sweet :refer :all]
[midje.parsing.2-to-lexical-maps.expects :refer :all]
[midje.parsing.2-to-lexical-maps.fakes :refer [fake]]
... | null | https://raw.githubusercontent.com/marick/Midje/2b9bcb117442d3bd2d16446b47540888d683c717/test/midje/parsing/2_to_lexical_maps/t_expects.clj | clojure | This is used to check production mode with deftest.
I don't know why `expect` (and it alone) has to be fully qualified for these
tests to pass, but it does. Because these tests are mostly holdovers from when
users could use `expect` directly, I'm not overly concerned.
RE-EXAMINE THE USEFULNESS OF THESE TESTS
The... | (ns midje.parsing.2-to-lexical-maps.t-expects
[midje.sweet :refer :all]
[midje.parsing.2-to-lexical-maps.expects :refer :all]
[midje.parsing.2-to-lexical-maps.fakes :refer [fake]]
[midje.parsing.2-to-lexical-maps.data-fakes :refer [data-fake]]
[midje.test-util... |
80002af049a06fefa5d37c298e241ec355b559c4f1dbee787a888a29a2e61045 | mstksg/inCode | NetworkTyped.hs | {-# LANGUAGE BangPatterns #-}
{-# LANGUAGE DataKinds #-}
# LANGUAGE GADTs #
{-# LANGUAGE KindSignatures #-}
# LANGUAGE LambdaCase #
# LANGUAGE ScopedTypeVariables #
{-# LANGUAGE StandaloneDeriving #-}
{-# LANGUAGE TypeOperators #-}
import Control.Monad
import Contr... | null | https://raw.githubusercontent.com/mstksg/inCode/e1f80a3dfd83eaa2b817dc922fd7f331cd1ece8a/code-samples/dependent-haskell/NetworkTyped.hs | haskell | # LANGUAGE BangPatterns #
# LANGUAGE DataKinds #
# LANGUAGE KindSignatures #
# LANGUAGE StandaloneDeriving #
# LANGUAGE TypeOperators #
an "o x i" layer
^ learning rate
^ input vector
^ target vector
^ network to train
^ input vector
^ network to train
the gradient (how much y affec... | # LANGUAGE GADTs #
# LANGUAGE LambdaCase #
# LANGUAGE ScopedTypeVariables #
import Control.Monad
import Control.Monad.Random
import Data.List
import Data.Maybe
import Data.Singletons
import Data.Singletons.Prelude
import Data.Singletons.TypeLits
import Numeric.LinearAlgebra.Static
import Syste... |
391e2d934b70f424f6440f6634050bdc45ebf6e9f1dc492b74a98a3e462472c8 | Clojure2D/clojure2d-examples | texture.clj | (ns rt4.the-next-week.ch05e.texture
(:require [fastmath.core :as m]
[fastmath.vector :as v]
[clojure2d.pixels :as p]
[clojure2d.core :as c2d]
[rt4.color :as color]
[rt4.the-next-week.ch05e.perlin :as perlin]))
(set! *warn-on-reflection* true)
(set! *uncheck... | null | https://raw.githubusercontent.com/Clojure2D/clojure2d-examples/ead92d6f17744b91070e6308157364ad4eab8a1b/src/rt4/the_next_week/ch05e/texture.clj | clojure | (ns rt4.the-next-week.ch05e.texture
(:require [fastmath.core :as m]
[fastmath.vector :as v]
[clojure2d.pixels :as p]
[clojure2d.core :as c2d]
[rt4.color :as color]
[rt4.the-next-week.ch05e.perlin :as perlin]))
(set! *warn-on-reflection* true)
(set! *uncheck... | |
17eaed9ffe260931d41cd5a90ca70a9df7fd82f713a9209824de32f37403c683 | softwarelanguageslab/maf | R5RS_scp1_animal-classification-2.scm | ; Changes:
* removed : 0
* added : 3
* swaps : 0
; * negated predicates: 0
; * swapped branches: 0
* calls to i d fun : 2
(letrec ((atom? (lambda (x)
(not (pair? x))))
(maak-dier (lambda (naam eigenschappen)
(<change>
(list naam eigenscha... | null | https://raw.githubusercontent.com/softwarelanguageslab/maf/11acedf56b9bf0c8e55ddb6aea754b6766d8bb40/test/changes/scheme/generated/R5RS_scp1_animal-classification-2.scm | scheme | Changes:
* negated predicates: 0
* swapped branches: 0 | * removed : 0
* added : 3
* swaps : 0
* calls to i d fun : 2
(letrec ((atom? (lambda (x)
(not (pair? x))))
(maak-dier (lambda (naam eigenschappen)
(<change>
(list naam eigenschappen)
((lambda (x) x) (list naam eig... |
aed45274c8478ff4cbbb74c5a9398391d6ee2f78fe026a77c58cbac65c1d7024 | fvm-project/fvm | project.clj | (defproject fvm-project/fvm "0.1.2"
:description "fvm is a Clojure library for writing self-optimizing interpreters"
:url "-project/fvm"
:license {:name "EPL-2.0 OR GPL-2.0-or-later WITH Classpath-exception-2.0"
:url "-2.0/"}
:dependencies [[org.clojure/clojure "1.10.1"]]
:target-path "target/%s"
... | null | https://raw.githubusercontent.com/fvm-project/fvm/65760b535cb3177ca276b9ebf006b70a10278d9e/project.clj | clojure | (defproject fvm-project/fvm "0.1.2"
:description "fvm is a Clojure library for writing self-optimizing interpreters"
:url "-project/fvm"
:license {:name "EPL-2.0 OR GPL-2.0-or-later WITH Classpath-exception-2.0"
:url "-2.0/"}
:dependencies [[org.clojure/clojure "1.10.1"]]
:target-path "target/%s"
... | |
4fc1ffe89be8c6ddb2ca934d20c8b27f89a365a700c8a5d0c4613b2947d1dcef | chrislloyd/kepler | coordinate_test.clj | (ns kepler.systems.coordinate-test
(:require [clojure.test :refer :all]
[kepler.systems.coordinate :refer :all]))
(deftest coordinate-system-test
(testing "any action"
(is (= (coordinate-system '() {})
'())))
(testing "tick action"
(let [state '()
action {:type :tick}]
... | null | https://raw.githubusercontent.com/chrislloyd/kepler/bd6f30c20ff9e5ad6749bab0d3589d9ccce6f14f/test/kepler/systems/coordinate_test.clj | clojure | (ns kepler.systems.coordinate-test
(:require [clojure.test :refer :all]
[kepler.systems.coordinate :refer :all]))
(deftest coordinate-system-test
(testing "any action"
(is (= (coordinate-system '() {})
'())))
(testing "tick action"
(let [state '()
action {:type :tick}]
... | |
6ea26148a637d83b17bcce1e7c2307db075b966d93ce7182a8693f84fed3f518 | vmchale/atspkg | Dependency.hs | {-# LANGUAGE OverloadedStrings #-}
module Language.ATS.Package.Dependency ( -- * Functions
fetchDeps
, buildHelper
-- * Types
, SetupScript
... | null | https://raw.githubusercontent.com/vmchale/atspkg/45be7ece6b9e9b09a7151efe53ff7e278112e84d/ats-pkg/src/Language/ATS/Package/Dependency.hs | haskell | # LANGUAGE OverloadedStrings #
* Functions
* Types
^ Shake verbosity
^ C compiler to use
^ Setup steps that can be performed concurrently
^ ATS dependencies
^ C Dependencies
^ ATS build dependencies
^ Path to configuration file
^ Whether to perform setup anyhow.
Set up actions
Fetch all packages & build com... |
fetchDeps
, buildHelper
, SetupScript
) where
import qualified Archive.Compression as Archive
import Codec.Archive.Zip ... |
13f74fe7f698f7b9cecd614facbd098ff497e9a05a949f2cc190cbc2b7c7f64e | haskell-repa/repa | Distro.hs |
-- | Describes the size of a vector, and how the elements are distributed
-- across the gang.
--
-- We have separate 'distroFragLength' and 'distroFragStart' functions
-- for performance reasons, and they must give coherent results,
-- else undefined.
--
module Data.Array.Repa.Flow.Par.Distro
( BB, BN
... | null | https://raw.githubusercontent.com/haskell-repa/repa/c867025e99fd008f094a5b18ce4dabd29bed00ba/icebox/abandoned/repa-flow/Data/Array/Repa/Flow/Par/Distro.hs | haskell | | Describes the size of a vector, and how the elements are distributed
across the gang.
We have separate 'distroFragLength' and 'distroFragStart' functions
for performance reasons, and they must give coherent results,
else undefined.
* Balanced Distributions
* Unbalanced Distributions
| Describes the ... |
module Data.Array.Repa.Flow.Par.Distro
( BB, BN
, Distro (..)
, balanced
, balancedFragStart
, balancedFragLength
, unbalanced)
where
import GHC.Exts
data family Distro d
data BB
data instance Distro BB
= DistroBalanced
distroBalancedFrags ... |
002f0effb5a266f7efbea847d556ecf5da5c8a4ddfa9cf5a5e45470c33e10f50 | dixel/huemoe | colors.clj | (ns dixel.huemoe.colors
(:require [clojure.math.numeric-tower :as math]))
;; formulas from [hue documentation](-conversions-rgb-xy) (needs login)
(defn rgb->xy
[[r g b]]
(let [rn (/ r 255.0)
gn (/ g 255.0)
bn (/ b 255.0)
normalize (fn [val]
(if (> val 0.04045)
... | null | https://raw.githubusercontent.com/dixel/huemoe/b190543ff3620cf3924da8a4483780645952f26a/src/dixel/huemoe/colors.clj | clojure | formulas from [hue documentation](-conversions-rgb-xy) (needs login) | (ns dixel.huemoe.colors
(:require [clojure.math.numeric-tower :as math]))
(defn rgb->xy
[[r g b]]
(let [rn (/ r 255.0)
gn (/ g 255.0)
bn (/ b 255.0)
normalize (fn [val]
(if (> val 0.04045)
(math/expt (/ (+ val 0.055) 1.055) 2.4)
... |
69b6c28d9cf5e9718ecc6d0ba1d42b94151e7d78b3840b987aebf66802aa62ca | hstreamdb/hstream | Exception.hs | {-# LANGUAGE CPP #-}
{-# LANGUAGE GADTs #-}
# LANGUAGE PatternSynonyms #
module HStream.Store.Exception
( -- * Store Exception
SomeHStoreException
, someHStoreExceptionToException
, someHStoreExceptionFromException
, SSEInfo (..)
, throwStreamError
, throwStreamErrorIfNotOK
, th... | null | https://raw.githubusercontent.com/hstreamdb/hstream/096165d5de88c0f280a3670d965dd94feb072dd8/hstream-store/HStream/Store/Exception.hs | haskell | # LANGUAGE CPP #
# LANGUAGE GADTs #
* Store Exception
* Custom Errors
* General Store Exception
** Specific Stream Exception
* Patterns
* Auxiliary functions
-----------------------------------------------------------------------------
| The root type of all stream exceptions, you can catch... | # LANGUAGE PatternSynonyms #
module HStream.Store.Exception
SomeHStoreException
, someHStoreExceptionToException
, someHStoreExceptionFromException
, SSEInfo (..)
, throwStreamError
, throwStreamErrorIfNotOK
, throwStreamErrorIfNotOK'
, SubmitError (..)
, throwSubmitError
, throwSubmitIfNotOK
... |
7f27e5991e3eb3e810ed5226ae767b6d2ac2477d713c2eedf3a997fece7ab2de | AbstractMachinesLab/caramel | fun.mli | TODO Replace with : { include module type of . Fun }
once we drop support for 4.07
once we drop support for 4.07 *)
(** [id] is the identity function. For any argument [x], [id x] is [x]. *)
external id : 'a -> 'a = "%identity"
(** [const c] is a function that always returns the value [c]. For any argume... | null | https://raw.githubusercontent.com/AbstractMachinesLab/caramel/7d4e505d6032e22a630d2e3bd7085b77d0efbb0c/vendor/ocaml-lsp-1.4.0/vendor/stdune/fun.mli | ocaml | * [id] is the identity function. For any argument [x], [id x] is [x].
* [const c] is a function that always returns the value [c]. For any argument
[x], [(const c) x] is [c].
* [flip f] reverses the argument order of the binary function [f]. For any
arguments [x] and [y], [(flip f) x y] is [f y x].
* [negate... | TODO Replace with : { include module type of . Fun }
once we drop support for 4.07
once we drop support for 4.07 *)
external id : 'a -> 'a = "%identity"
val const : 'a -> _ -> 'a
val flip : ('a -> 'b -> 'c) -> 'b -> 'a -> 'c
val negate : ('a -> bool) -> 'a -> bool
* { 1 : exception Exception handling ... |
8f1e845cfb6aeec488c8e7e65ca5a1f8dd1ba1a7297796a37649a9baafbfa51c | binaryage/chromex | echo_private.clj | (ns chromex.app.echo-private
" * available since Chrome 36"
(:refer-clojure :only [defmacro defn apply declare meta let partial])
(:require [chromex.wrapgen :refer [gen-wrap-helper]]
[chromex.callgen :refer [gen-call-helper gen-tap-all-events-call]]))
(declare api-table)
(declare gen-call)
-- fu... | null | https://raw.githubusercontent.com/binaryage/chromex/33834ba5dd4f4238a3c51f99caa0416f30c308c5/src/apps_private/chromex/app/echo_private.clj | clojure | -- convenience ------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------------
-- API TABLE --------------------------------------------------------... | (ns chromex.app.echo-private
" * available since Chrome 36"
(:refer-clojure :only [defmacro defn apply declare meta let partial])
(:require [chromex.wrapgen :refer [gen-wrap-helper]]
[chromex.callgen :refer [gen-call-helper gen-tap-all-events-call]]))
(declare api-table)
(declare gen-call)
-- fu... |
fec2203200b107cb44a8fea033685c3dcef805397756b9ec64e4b029cd93527a | jumper149/go | Main.hs | # LANGUAGE RecordWildCards #
module Main ( main
) where
import Data.Default.Class
import Data.Proxy
import qualified Data.Text as T
import Miso
import Miso.String (ms)
import Servant.API
import Go.Run.API
import Message
import Model
import Operation
main :: JSM ()
main = do currentURI <- getCurrentURI
... | null | https://raw.githubusercontent.com/jumper149/go/603e61f64e8e7c890bbc914fef6033b5ed7dd005/client/Main.hs | haskell | # LANGUAGE RecordWildCards #
module Main ( main
) where
import Data.Default.Class
import Data.Proxy
import qualified Data.Text as T
import Miso
import Miso.String (ms)
import Servant.API
import Go.Run.API
import Message
import Model
import Operation
main :: JSM ()
main = do currentURI <- getCurrentURI
... | |
9918dbf13880dc55df6aa170d1c5b2cf86a919a36e01ac867386c75c64ec8d6b | repl-acement/repl-acement | cljs_fn_specs.cljs | (ns replacement.protocol.cljs-fn-specs
(:require [cljs.spec.alpha :as s]))
;; DRAGONS BE HERE!!
;; This is a Cut and Paste from the CLJS core specs
;; Why such madness? Because it is not available to CLJS code, only to macros
Issue is tracked here -3016
;;;; destructure
(s/def ::local-name (s/and simple-symbol... | null | https://raw.githubusercontent.com/repl-acement/repl-acement/7aa8ba46d95f36d75efcedfd92dbe25543911a2f/repl-shared/replacement/protocol/cljs_fn_specs.cljs | clojure | DRAGONS BE HERE!!
This is a Cut and Paste from the CLJS core specs
Why such madness? Because it is not available to CLJS code, only to macros
destructure
sequential destructuring
map destructuring
bindings
defn, defn-, fn
ns
same as ::libspec-macros, but also supports the ::filters options in the libspec | (ns replacement.protocol.cljs-fn-specs
(:require [cljs.spec.alpha :as s]))
Issue is tracked here -3016
(s/def ::local-name (s/and simple-symbol? #(not= '& %)))
(s/def ::binding-form
(s/or :local-symbol ::local-name
:seq-destructure ::seq-binding-form
:map-destructure ::map-binding-form))
(... |
44b3f95b7e740bf78d6f92637ec13d0c9a81ae857f99c66e008c26ea4c6fe840 | LeventErkok/sbv | BaseIO.hs | -----------------------------------------------------------------------------
-- |
-- Module : Data.SBV.Control.BaseIO
Copyright : ( c )
-- License : BSD3
-- Maintainer:
-- Stability : experimental
--
-- Monomorphized versions of functions for simplified client use via
@Data . SBV.Contro... | null | https://raw.githubusercontent.com/LeventErkok/sbv/cfaa40b8c8ff8e1b7ff9ab71304654f6f531ba72/Data/SBV/Control/BaseIO.hs | haskell | ---------------------------------------------------------------------------
|
Module : Data.SBV.Control.BaseIO
License : BSD3
Maintainer:
Stability : experimental
Monomorphized versions of functions for simplified client use via
---------------------------------------------------------------------------
# ... | Copyright : ( c )
@Data . SBV.Control@ , where we restrict the underlying monad to be IO .
module Data.SBV.Control.BaseIO where
import Data.SBV.Control.Query (Assignment)
import Data.SBV.Control.Types (CheckSatResult, SMTInfoFlag, SMTInfoResponse, SMTOption, SMTReasonUnknown)
import Data.SB... |
8dde99e438f3fda7f325e3771cf4880508a93af7df6fb0509120135995230773 | ekmett/ersatz | Z3.hs | --------------------------------------------------------------------
-- |
Copyright : © 2010 - 2014 , 2013
-- License : BSD3
Maintainer : < >
-- Stability : experimental
-- Portability: non-portable
--
--------------------------------------------------------------------
module Ersatz.Solver.Z3
( z3... | null | https://raw.githubusercontent.com/ekmett/ersatz/b410081dd47000aa6a004a30077ca921569af751/src/Ersatz/Solver/Z3.hs | haskell | ------------------------------------------------------------------
|
License : BSD3
Stability : experimental
Portability: non-portable
------------------------------------------------------------------
| 'Solver' for 'SAT' problems that tries to invoke the @z3@ executable from the @PATH@
| 'Solver' for 'SAT'... | Copyright : © 2010 - 2014 , 2013
Maintainer : < >
module Ersatz.Solver.Z3
( z3
, z3Path
) where
import Data.ByteString.Builder
import Control.Monad.IO.Class
import Ersatz.Problem
import Ersatz.Solution
import Ersatz.Solver.Common
import System.IO
import System.Process (readProcessWithExitCode)
z3... |
8ca9e5a585977dc9fb3824e4782ad2c771c70922f4b80dd80c4d49727baa0503 | haskell/ghcide | A.hs | module A where
import B( TB(..) )
newtype TA = MkTA Int
f :: TB -> TA
f (MkTB x) = MkTA x
| null | https://raw.githubusercontent.com/haskell/ghcide/3ef4ef99c4b9cde867d29180c32586947df64b9e/test/data/boot/A.hs | haskell | module A where
import B( TB(..) )
newtype TA = MkTA Int
f :: TB -> TA
f (MkTB x) = MkTA x
| |
590fa1d2b4e8061665b585a3bbf955c6caa82ecd51272d757694a35de25a4f4d | o1-labs/ppx_version | lint_version_syntax.ml | lint_version_syntax.ml -- static enforcement of syntactic items relating to proper versioning
- " deriving bin_io " and " deriving version " never appear in types defined inside functor bodies
- otherwise , " bin_io " may appear in a " deriving " attribute only if " version " also appears in that extension... | null | https://raw.githubusercontent.com/o1-labs/ppx_version/72108f76042b0a64095c429a9fecc613fad9b017/src/lint_version_syntax.ml | ocaml | N.B.: Uuid is in core_kernel library, but not in Core_kernel module
N.B.: most versioned modules are within "Stable" modules, but that's not true
for modules in RPC type definitions, so we can't rely on that name
this case will go away when all versioned modules have %%versioned
this case goes away when all v... | lint_version_syntax.ml -- static enforcement of syntactic items relating to proper versioning
- " deriving bin_io " and " deriving version " never appear in types defined inside functor bodies
- otherwise , " bin_io " may appear in a " deriving " attribute only if " version " also appears in that extension... |
331ee98e2e4059039089f721131d16088f331e0f40bfbb2c6e30fad0ac669108 | naoiwata/sicp | q-1.23.scm | ;;
;; @author naoiwata
SICP Chapter1
;; q-1.23
;;
(define (square n)
(* n n))
(define (smallest-divisor n)
(find-divisor n 2))
(define (find-divisor n a)
(cond
((< n (square a)) n)
((divisors? n a) a)
( + a 1 ) - > ( next a )
(define (divisors? n a)
(= (remainder n a) 0))
(define (prime? n)
(= n (smalle... | null | https://raw.githubusercontent.com/naoiwata/sicp/7314136c5892de402015acfe4b9148a3558b1211/chapter1/q-1.23.scm | scheme |
@author naoiwata
q-1.23
test
discussion
but ratio is not always twise... :(
on more large number
q-1.22 algorithm
then, oncreased the number, this was go well:)
-> アルゴリズムの改変により、増加の速度は2倍短縮すると予想され、
-> 実験結果は、約2倍処理時間が短縮されているので、仮説は正しいと確認された。
END | SICP Chapter1
(define (square n)
(* n n))
(define (smallest-divisor n)
(find-divisor n 2))
(define (find-divisor n a)
(cond
((< n (square a)) n)
((divisors? n a) a)
( + a 1 ) - > ( next a )
(define (divisors? n a)
(= (remainder n a) 0))
(define (prime? n)
(= n (smallest-divisor n)))
(define (next a)
(... |
b538061720eebde813bc97ef221deafeaaa9b96b9a6518c8cd11d87f60874744 | ptaoussanis/truss | impl.cljc | (ns taoensso.truss.impl
"Private implementation details."
(:refer-clojure :exclude [some?])
(:require
[clojure.set :as set]
#?(:cljs [cljs.analyzer]))
#?(:cljs (:require-macros [taoensso.truss.impl :refer [catching]])))
(comment (require '[taoensso.encore :as enc]))
TODO
- Namespaced kw registry lik... | null | https://raw.githubusercontent.com/ptaoussanis/truss/62a37ccf071a274dddc744cc2a371c96de727f3f/src/taoensso/truss/impl.cljc | clojure | A bit of a nuisance but:
- Allows Truss to be entirely dependency free.
Very unfortunate that CLJ-1293 has not yet been addressed
Truss
Pred composition
Support recursive expansion:
all-of
any-of
complement/none-of
Note that it's a little ambiguous whether we'd want
safe (non-throwing) behaviour here or no... | (ns taoensso.truss.impl
"Private implementation details."
(:refer-clojure :exclude [some?])
(:require
[clojure.set :as set]
#?(:cljs [cljs.analyzer]))
#?(:cljs (:require-macros [taoensso.truss.impl :refer [catching]])))
(comment (require '[taoensso.encore :as enc]))
TODO
- Namespaced kw registry lik... |
b570b233fc3153457640623ad412ba21b1700a4bbe11436dbcb9eb047151a5ab | thi-ng/demos | project.clj | (defproject ws-ldn-11-ex02 "0.1.0-SNAPSHOT"
:description "thi.ng Clojurescript workshop WS-LDN-11"
:url ""
:min-lein-version "2.5.3"
:dependencies [[org.clojure/clojure "1.8.0"]
[org.clojure/clojurescript "1.8.51"]
[org.clojure/core.async "0.2.374" :exclusions [org.... | null | https://raw.githubusercontent.com/thi-ng/demos/048cd131099a7db29be56b965c053908acad4166/ws-ldn-11/day1/ex02/project.clj | clojure | (defproject ws-ldn-11-ex02 "0.1.0-SNAPSHOT"
:description "thi.ng Clojurescript workshop WS-LDN-11"
:url ""
:min-lein-version "2.5.3"
:dependencies [[org.clojure/clojure "1.8.0"]
[org.clojure/clojurescript "1.8.51"]
[org.clojure/core.async "0.2.374" :exclusions [org.... | |
54948a74df2b0ccbd81cfbc3d2f30440457117853cfbbc1e13364b42406a71fc | aaronallen8455/jq-bindings | Main.hs | # LANGUAGE QuasiQuotes #
{-# LANGUAGE OverloadedStrings #-}
# LANGUAGE LambdaCase #
# LANGUAGE QualifiedDo #
module Main where
import Control.Concurrent (forkIO, threadDelay)
import qualified Control.Functor.Linear as FL
import Control.Monad.IO.Class.Linear (liftSystemIO, liftSystemIOU)
import qual... | null | https://raw.githubusercontent.com/aaronallen8455/jq-bindings/5dccec45979afb3f5e37b74c1dec55654228f9de/jq-codec/app/Main.hs | haskell | # LANGUAGE OverloadedStrings # | # LANGUAGE QuasiQuotes #
# LANGUAGE LambdaCase #
# LANGUAGE QualifiedDo #
module Main where
import Control.Concurrent (forkIO, threadDelay)
import qualified Control.Functor.Linear as FL
import Control.Monad.IO.Class.Linear (liftSystemIO, liftSystemIOU)
import qualified Data.ByteString.Char8 as BS
i... |
38a3f509522511412e63ec434efde03af4975a366f6ec477972cbe454ba0da5f | samrushing/irken-compiler | frb.scm | ;; -*- Mode: Irken -*-
;; For the almighty tallest, a quick translation of okasaki's pure
;; functional "red-purple" trees.
;; This was originally in lib/frb.scm, but was replaced by lib/aa_map.scm
;; A more 'natural' representation might be:
;; (datatype node (union (empty) (full bool node node ? ?)))
;; where th... | null | https://raw.githubusercontent.com/samrushing/irken-compiler/690da48852d55497f873738df54f14e8e135d006/demo/frb.scm | scheme | -*- Mode: Irken -*-
For the almighty tallest, a quick translation of okasaki's pure
functional "red-purple" trees.
This was originally in lib/frb.scm, but was replaced by lib/aa_map.scm
A more 'natural' representation might be:
(datatype node (union (empty) (full bool node node ? ?)))
where the color is stored... |
(datatype tree
(:red (tree 'a 'b) (tree 'a 'b) 'a 'b)
(:purple (tree 'a 'b) (tree 'a 'b) 'a 'b)
(:empty)
)
(define (tree/empty) (tree:empty))
(define (tree/insert root < k v)
these two functions detect that condition and adjust the tree to
(define lbalance
(tree:red (tree:red A B k0 v0) C k1... |
8581ec7b0d2fd24ec82ab86cfcafe37b6719d2adf5501870d3d3949bc5187c17 | herbelin/coq-hh | logic.ml | (************************************************************************)
v * The Coq Proof Assistant / The Coq Development Team
< O _ _ _ , , * INRIA - CNRS - LIX - LRI - PPS - Copyright 1999 - 2010
\VV/ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *... | null | https://raw.githubusercontent.com/herbelin/coq-hh/296d03d5049fea661e8bdbaf305ed4bf6d2001d2/proofs/logic.ml | ocaml | **********************************************************************
// * This file is distributed under the terms of the
* GNU Lesser General Public License Version 2.1
**********************************************************************
Errors raised by the refiner
Erro... | v * The Coq Proof Assistant / The Coq Development Team
< O _ _ _ , , * INRIA - CNRS - LIX - LRI - PPS - Copyright 1999 - 2010
\VV/ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
open Compat
open Pp
open Util... |
5139726567c78876e62419c28b2433ff6cbb916d4e6f00e7c06eac5c923a29ac | rescript-lang/rescript-compiler | ext_log.mli | Copyright ( C ) 2015 - 2016 Bloomberg Finance L.P.
*
* This program is free software : you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation , either version 3 of the License , or
* ( at your option ) any later... | null | https://raw.githubusercontent.com/rescript-lang/rescript-compiler/e60482c6f6a69994907b9bd56e58ce87052e3659/jscomp/common/ext_log.mli | ocaml | * A Poor man's logging utility
Example:
{[
err __LOC__ "xx"
]}
| Copyright ( C ) 2015 - 2016 Bloomberg Finance L.P.
*
* This program is free software : you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation , either version 3 of the License , or
* ( at your option ) any later... |
fe25b20f0a7ec459fc802a0afda7077393e26eeac12d8c96899409145a2705dd | gonzojive/elephant | package.lisp | -*- Mode : Lisp ; Syntax : ANSI - Common - Lisp ; Base : 10 -*-
;;;
;;; package.lisp -- package definition
;;;
Initial version 2/3/2007 by
;;; <>
;;;
;;; part of
;;;
Elephant : an object - oriented database for Common Lisp
;;;
Copyright ( c ) 2004 by and
;;; <> <>
;;;
Portions Copyright ( c ) 2005 - 2... | null | https://raw.githubusercontent.com/gonzojive/elephant/b29a012ab75ccea2fc7fc4f1e9d5e821f0bd60bf/src/utils/package.lisp | lisp | Syntax : ANSI - Common - Lisp ; Base : 10 -*-
package.lisp -- package definition
<>
part of
<> <>
Elephant users are granted the rights to distribute and use this software
(), also known as the LLGPL.
| Initial version 2/3/2007 by
Elephant : an object - oriented database for Common Lisp
Copyright ( c ) 2004 by and
Portions Copyright ( c ) 2005 - 2007 by and
< common - lisp net > < ieslick common - lisp net >
as governed by the terms of the Lisp Lesser GNU Public License
(in-package :cl-user)
(... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.