_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 |
|---|---|---|---|---|---|---|---|---|
deb0916a5489f327ef991ba9a1003a47df921f57de832692b78c35945aa7f97f | conjure-cp/conjure | Table.hs | # LANGUAGE DeriveGeneric , DeriveDataTypeable , DeriveFunctor , , DeriveFoldable #
module Conjure.Language.Expression.Op.Table where
import Conjure.Prelude
import Conjure.Language.Expression.Op.Internal.Common
import qualified Data.Aeson as JSON -- aeson
import qualified Data.HashMap.Strict as M -... | null | https://raw.githubusercontent.com/conjure-cp/conjure/dd5a27df138af2ccbbb970274c2b8f22ac6b26a0/src/Conjure/Language/Expression/Op/Table.hs | haskell | aeson
unordered-containers
vector | # LANGUAGE DeriveGeneric , DeriveDataTypeable , DeriveFunctor , , DeriveFoldable #
module Conjure.Language.Expression.Op.Table where
import Conjure.Prelude
import Conjure.Language.Expression.Op.Internal.Common
data OpTable x = OpTable x x
deriving (Eq, Ord, Show, Data, Functor, Traversable, Foldable, Typeable... |
f9b9a222b57310aff9311d1c36d5b31f327918dad44adde1f6ef96f143286302 | craigfe/sink | ppx_deriving_phantom.ml | open Ppxlib
(** Given a module type of the form:
{[
module type S1 = sig
type 'a t
val map : ('a -> 'b) -> 'a t -> 'b t
end
[@@deriving phantom]
]}
generate a new module type in which [t] has an extra phantom type parameter
that is unified across all occurrences:
... | null | https://raw.githubusercontent.com/craigfe/sink/c5431edfa1b06f1a09845a481c4afcb3e92f0667/src/ppx_deriving_phantom/ppx_deriving_phantom.ml | ocaml | * Given a module type of the form:
{[
module type S1 = sig
type 'a t
val map : ('a -> 'b) -> 'a t -> 'b t
end
[@@deriving phantom]
]}
generate a new module type in which [t] has an extra phantom type parameter
that is unified across all occurrences:
{[
(**... | open Ppxlib
module type S2 = sig
type ('a, 'phan) t
val map : ('a -> 'b) -> ('a, 'phan) t -> ('b, 'phan) t
end
]} *)
let add_phantom_parameter_to (module A : Ast_builder.S) id =
let tvar = A.ptyp_var "phantom" in
object
inherit Ast_traverse.map as super
method! type_decla... |
b8ff912a93ac70a146b04b74edded351ddc9f736318bf387668211a6a71cc0b5 | deadpendency/deadpendency | WriteChecksGitHubC.hs | module Common.Effect.GitHub.WriteChecks.Carrier.WriteChecksGitHubC
( WriteChecksGitHubIOC (..),
)
where
import Common.Effect.AppEventEmit.AppEventEmit
import Common.Effect.AppEventEmit.Model.AppEventAdditional
import Common.Effect.AppEventEmit.Model.AppEventMessage
import Common.Effect.GitHub.InstallationAuth.Inst... | null | https://raw.githubusercontent.com/deadpendency/deadpendency/170d6689658f81842168b90aa3d9e235d416c8bd/apps/common/src/Common/Effect/GitHub/WriteChecks/Carrier/WriteChecksGitHubC.hs | haskell | currently the checkRunOutput can be huge, so can't always log it | module Common.Effect.GitHub.WriteChecks.Carrier.WriteChecksGitHubC
( WriteChecksGitHubIOC (..),
)
where
import Common.Effect.AppEventEmit.AppEventEmit
import Common.Effect.AppEventEmit.Model.AppEventAdditional
import Common.Effect.AppEventEmit.Model.AppEventMessage
import Common.Effect.GitHub.InstallationAuth.Inst... |
03d6e090dff7598d1623e27259b9920a0a45d2660427a96c08cd70846b26a901 | nandor/llir-ocaml | t210-setfield0.ml | TEST
include tool - ocaml - lib
flags = " -w a "
ocaml_script_as_argument = " true "
* setup - ocaml - build - env
* *
include tool-ocaml-lib
flags = "-w a"
ocaml_script_as_argument = "true"
* setup-ocaml-build-env
** ocaml
*)
open Lib;;
type t = {
mutable a : int;
};;
let x = {a = 7} in
x.a <- 11;
if... | null | https://raw.githubusercontent.com/nandor/llir-ocaml/9c019f15c444e30c825b1673cbe827e0497868fe/testsuite/tests/tool-ocaml/t210-setfield0.ml | ocaml | TEST
include tool - ocaml - lib
flags = " -w a "
ocaml_script_as_argument = " true "
* setup - ocaml - build - env
* *
include tool-ocaml-lib
flags = "-w a"
ocaml_script_as_argument = "true"
* setup-ocaml-build-env
** ocaml
*)
open Lib;;
type t = {
mutable a : int;
};;
let x = {a = 7} in
x.a <- 11;
if... | |
85cc2c9d27eb6ff0aefc8b840ebba9a06c8e28e6dd838b21c561cab11c3b3fd0 | pmatos/racket-binaryen | common.rkt | #lang typed/racket/base
;; ---------------------------------------------------------------------------------------------------
(provide fits-int? fits-uint?)
;; ---------------------------------------------------------------------------------------------------
(: fits-int? (-> Integer Integer Boolean))
(define (fits... | null | https://raw.githubusercontent.com/pmatos/racket-binaryen/3535a9400b20f5e64d799bb70916d85466802e6d/common.rkt | racket | ---------------------------------------------------------------------------------------------------
--------------------------------------------------------------------------------------------------- | #lang typed/racket/base
(provide fits-int? fits-uint?)
(: fits-int? (-> Integer Integer Boolean))
(define (fits-int? n bits)
(<= (expt 2 (- bits 1))
n
(- (expt 2 (- bits 1)) 1)))
(: fits-uint? (-> Integer Integer Boolean))
(define (fits-uint? n bits)
(<= 0
n
(- (expt 2 bits) 1)))
|
a9415545b21a8f13beb2b94fb9c3742a374079f395d67d04c0aa690e000fbe8f | Zulu-Inuoe/clution | keep-alive-stream.lisp | (in-package :cl-user)
(defpackage dexador.keep-alive-stream
(:use :cl)
(:import-from :trivial-gray-streams
:fundamental-input-stream
:stream-read-byte
:stream-read-sequence
:stream-element-type
:open-stream-p)
(:import-from :alexandri... | null | https://raw.githubusercontent.com/Zulu-Inuoe/clution/b72f7afe5f770ff68a066184a389c23551863f7f/cl-clution/qlfile-libs/dexador-20171130-git/src/keep-alive-stream.lisp | lisp | Read CR
Read CRLF
Read CRLFCR | (in-package :cl-user)
(defpackage dexador.keep-alive-stream
(:use :cl)
(:import-from :trivial-gray-streams
:fundamental-input-stream
:stream-read-byte
:stream-read-sequence
:stream-element-type
:open-stream-p)
(:import-from :alexandri... |
4cc9190d1325f06cfa28886ff4bb855defb620739a85acbe1f3d6581b5898bc4 | kelamg/HtDP2e-workthrough | ex125.rkt | The first three lines of this file were inserted by . They record metadata
;; about the language level of this file in a form that our tools can easily process.
#reader(lib "htdp-beginner-reader.ss" "lang")((modname ex125) (read-case-sensitive #t) (teachpacks ()) (htdp-settings #(#t constructor repeating-decimal #f ... | null | https://raw.githubusercontent.com/kelamg/HtDP2e-workthrough/ec05818d8b667a3c119bea8d1d22e31e72e0a958/HtDP/Fixed-size-Data/ex125.rkt | racket | about the language level of this file in a form that our tools can easily process.
legal
legal
illegal
(define-struct oops []) is legal because it follows the syntax rules for
a structure definition. Even though it has no variables in the enclosing
parenthesis, it is still syntactically legal.
variable names en... | The first three lines of this file were inserted by . They record metadata
#reader(lib "htdp-beginner-reader.ss" "lang")((modname ex125) (read-case-sensitive #t) (teachpacks ()) (htdp-settings #(#t constructor repeating-decimal #f #t none #f () #f)))
( define - struct child [ parents date ] ) is legal becaus... |
3f8377ca558cf164b46da3b4faec20c9132bd8c5d76c9c11b33630d3d9ee623b | janestreet/async_kernel | throttled.ml | open! Core
open! Import
open! Deferred_std
module Deferred = Deferred1
module Counting_semaphore : sig
type t
val wait_to_acquire_job_token : t -> unit Deferred.t
val release_job_token : t -> unit
val abort : t -> unit
val create : max_concurrent_jobs:int -> t
end = struct
type t =
{ mutable max_concu... | null | https://raw.githubusercontent.com/janestreet/async_kernel/5807f6d4ef415408e8ec5afe74cdff5d27f277d4/src/throttled.ml | ocaml | open! Core
open! Import
open! Deferred_std
module Deferred = Deferred1
module Counting_semaphore : sig
type t
val wait_to_acquire_job_token : t -> unit Deferred.t
val release_job_token : t -> unit
val abort : t -> unit
val create : max_concurrent_jobs:int -> t
end = struct
type t =
{ mutable max_concu... | |
e1db7f317e41f846f5254f4a3ac45992071d9743308599d6ffebcc688f6aae9c | kdltr/chicken-core | callback-tests.scm | ;;;; callback-tests.scm
(import (only (chicken process-context) command-line-arguments))
(define k1)
(define-external (foo) void
(call/cc
(lambda (k) (set! k1 k)))
(print "hi!"))
#>
extern void foo();
static void bar() { foo(); }
<#
(print "callbacks ...")
((foreign-safe-lambda void "bar"))
(when (member "... | null | https://raw.githubusercontent.com/kdltr/chicken-core/b2e6c5243dd469064bec947cb3b49dafaa1514e5/tests/callback-tests.scm | scheme | callback-tests.scm
} |
(import (only (chicken process-context) command-line-arguments))
(define k1)
(define-external (foo) void
(call/cc
(lambda (k) (set! k1 k)))
(print "hi!"))
#>
<#
(print "callbacks ...")
((foreign-safe-lambda void "bar"))
(when (member "twice" (command-line-arguments))
(k1 #f))
|
6e4afab1626e142cde50d92a724fe244e2ff5946dd6bb03be78539a44bfa899e | denisidoro/rosebud | resolvers.clj | (ns rosebud.resolvers
(:require [rosebud.components.bucket.protocols.provider :as p.bucket]
[rosebud.logic.investment.core :as l.investment]))
(defn yielding-cdi-investments
[{{:keys [bucket]} :components}]
(->> (p.bucket/get-investments bucket)
l.investment/fixed-income-yielding
(map l... | null | https://raw.githubusercontent.com/denisidoro/rosebud/90385528d9a75a0e17803df487a4f6cfb87e981c/server/src/rosebud/resolvers.clj | clojure | (ns rosebud.resolvers
(:require [rosebud.components.bucket.protocols.provider :as p.bucket]
[rosebud.logic.investment.core :as l.investment]))
(defn yielding-cdi-investments
[{{:keys [bucket]} :components}]
(->> (p.bucket/get-investments bucket)
l.investment/fixed-income-yielding
(map l... | |
b8da4ffcf56ad7f86f4377f7496eea2386856d66b446455be4ea00415af522ce | erlangbureau/jamdb_oracle | jamdb_oracle_crypt.erl | -module(jamdb_oracle_crypt).
%% API
-export([generate/1]).
-export([validate/1]).
-include("jamdb_oracle.hrl").
%% API
o3logon(#logon{auth = Sess , key = KeySess , password = Pass } ) - >
% IVec = <<0:64>>,
block_decrypt(des_cbc , binary : part(KeySess,0,8 ) , IVec , ) ,
N = ( 8 - ( length(Pass ) rem... | null | https://raw.githubusercontent.com/erlangbureau/jamdb_oracle/bc9b7c8701b3ef517a23a93e34a028139da0c67b/src/jamdb_oracle_crypt.erl | erlang | API
API
IVec = <<0:64>>,
internal | -module(jamdb_oracle_crypt).
-export([generate/1]).
-export([validate/1]).
-include("jamdb_oracle.hrl").
o3logon(#logon{auth = Sess , key = KeySess , password = Pass } ) - >
block_decrypt(des_cbc , binary : part(KeySess,0,8 ) , IVec , ) ,
N = ( 8 - ( length(Pass ) rem 8 ) ) rem 8 ,
= < < ( list_to... |
87372fc01a61421426cebcddc337f95c0986d12eaf9fa781b4e36c91fba1590e | inaka/sumo_db | blog.erl | %%% @doc Main module for the blog example.
%%%
Copyright 2012 Inaka & lt;> ;
%%%
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 applic... | null | https://raw.githubusercontent.com/inaka/sumo_db/331ea718c13a01748a7739ad4078b0032f4d32e5/examples/blog/src/blog.erl | erlang | @doc Main module for the blog example.
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... | Copyright 2012 Inaka & lt;> ;
Licensed under the Apache License , Version 2.0 ( the " License " ) ;
distributed under the License is distributed on an " AS IS " BASIS ,
< >
-module(blog).
-author("Marcelo Gornstein <>").
-github("").
-license("Apache License 2.0").
-export([
total_posts/0, new_post/3, ... |
572aeac98e9585b7ea015270c8d48e319d14783162ab7079b73ede593b8c5e86 | Chris00/ocaml-cairo | image_create.ml | open Printf
open Cairo
open Bigarray
let create() =
let data = Array1.create int8_unsigned c_layout 360_000 in
Gc.finalise (fun _ -> eprintf "DESTROY bigarray 'data'\n%!") data;
let surf = Image.create_for_data8 data Image.RGB24 ~w:300 ~h:300 in
Cairo.create surf
let () =
let cr = create() in
printf "With... | null | https://raw.githubusercontent.com/Chris00/ocaml-cairo/202674a8d0c533b689ceacdb523ca167611e1b4c/tests/image_create.ml | ocaml | Test for stride < 0 (not handled for now) and for incoherent width
/ stride | open Printf
open Cairo
open Bigarray
let create() =
let data = Array1.create int8_unsigned c_layout 360_000 in
Gc.finalise (fun _ -> eprintf "DESTROY bigarray 'data'\n%!") data;
let surf = Image.create_for_data8 data Image.RGB24 ~w:300 ~h:300 in
Cairo.create surf
let () =
let cr = create() in
printf "With... |
025b6e1759ce1c84fe215d872413d5be5bcc3e79896525c14f5e7d5acda8386a | potapenko/playphraseme-site | permission.clj | (ns playphraseme.api.queries.user.permission
(:require [playphraseme.db.users-db :refer :all]))
(def coll "permissions")
(defn insert-permission!
"Inserts a single permission into the permission table"
[permission]
(when-not (get-doc coll {:permission permission})
(add-doc coll {:permission permission})))... | null | https://raw.githubusercontent.com/potapenko/playphraseme-site/d50a62a6bc8f463e08365dca96b3a6e5dde4fb12/src/clj/playphraseme/api/queries/user/permission.clj | clojure | (ns playphraseme.api.queries.user.permission
(:require [playphraseme.db.users-db :refer :all]))
(def coll "permissions")
(defn insert-permission!
"Inserts a single permission into the permission table"
[permission]
(when-not (get-doc coll {:permission permission})
(add-doc coll {:permission permission})))... | |
7e17414c5679e30d3f14617d6e436a97326f67142a46eb930adb573b3ec0cebf | brawnski/git-annex | Bup.hs | Using bup as a remote .
-
- Copyright 2011 < >
-
- Licensed under the GNU GPL version 3 or higher .
-
- Copyright 2011 Joey Hess <>
-
- Licensed under the GNU GPL version 3 or higher.
-}
module Remote.Bup (remote) where
import qualified Data.ByteString.Lazy.Char8 as L
import System.IO
import ... | null | https://raw.githubusercontent.com/brawnski/git-annex/8b847517a810d384a79178124b9766141b89bc17/Remote/Bup.hs | haskell | verify configuration is sane
bup init will create the repository.
(If the repository already exists, bup init again appears safe.)
The buprepo is stored in git config, as well as this repo's
persistant state, so it can vary between hosts.
make way for bup output
make way for bup output
Store UUID in the annex.u... | Using bup as a remote .
-
- Copyright 2011 < >
-
- Licensed under the GNU GPL version 3 or higher .
-
- Copyright 2011 Joey Hess <>
-
- Licensed under the GNU GPL version 3 or higher.
-}
module Remote.Bup (remote) where
import qualified Data.ByteString.Lazy.Char8 as L
import System.IO
import ... |
bbd82923aecab96794d6503fcb0372ae35f00277fd4a10f3ebbecda57eda2342 | Sword-Smith/Sword | TypeChecker.hs | MIT License
--
Copyright ( c ) 2019 and
--
-- Permission is hereby granted, free of charge, to any person obtaining a copy
-- of this software and associated documentation files (the "Software"), to deal
in the Software without restriction , including without limitation the rights
-- to use, copy, modify, mer... | null | https://raw.githubusercontent.com/Sword-Smith/Sword/214da8011eec75fb949bdc52418b269ab329b2c6/src/TypeChecker.hs | haskell |
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
furnished to do so, subject to the following conditions:
The above copyright notice... | MIT License
Copyright ( c ) 2019 and
in the Software without restriction , including without limitation the rights
copies of the Software , and to permit persons to whom the Software is
copies or substantial portions of the Software .
THE SOFTWARE IS PROVIDED " AS IS " , WITHOUT WARRANTY OF ANY KIND , E... |
2cab8604d56a326edbfae7007451c066267fc95f7fbc6fbddb3143fff27d93b1 | fyquah/hardcaml_zprize | test_load_store_sm.ml | open! Core
open Hardcaml
open Hardcaml_waveterm
module Store_sm = Zprize_ntt.Store_sm.Make (struct
let logn = 4
let support_4step_twiddle = false
let logcores = 0
let logblocks = 0
let memory_layout = Zprize_ntt.Memory_layout.Optimised_layout_single_port
end)
module Sim = Cyclesim.With_interface (Store_sm.I... | null | https://raw.githubusercontent.com/fyquah/hardcaml_zprize/553b1be10ae9b977decbca850df6ee2d0595e7ff/zprize/ntt/hardcaml/test/test_load_store_sm.ml | ocaml | open! Core
open Hardcaml
open Hardcaml_waveterm
module Store_sm = Zprize_ntt.Store_sm.Make (struct
let logn = 4
let support_4step_twiddle = false
let logcores = 0
let logblocks = 0
let memory_layout = Zprize_ntt.Memory_layout.Optimised_layout_single_port
end)
module Sim = Cyclesim.With_interface (Store_sm.I... | |
ffc76da61bf5671ddd38ead266ad617cba9e1d8c5fc3b96a875caa32c9cd433f | sbcl/sbcl | methods.lisp | This software is part of the SBCL system . See the README file for
;;;; more information.
This software is derived from software originally released by Xerox
;;;; Corporation. Copyright and release statements follow. Later modifications
;;;; to the software are in the public domain and are provided with
;;;; absol... | null | https://raw.githubusercontent.com/sbcl/sbcl/63b95f9e7d9c7fbb02da834dc16edfe8eae24e6a/src/pcl/methods.lisp | lisp | more information.
Corporation. Copyright and release statements follow. Later modifications
to the software are in the public domain and are provided with
absolutely no warranty. See the COPYING and CREDITS files for more
information.
All rights reserved.
Use and copying of this software and preparation of der... | This software is part of the SBCL system . See the README file for
This software is derived from software originally released by Xerox
copyright information from original PCL sources :
Copyright ( c ) 1985 , 1986 , 1987 , 1988 , 1989 , 1990 Xerox Corporation .
derivative works must comply with all applicabl... |
c7a93981c00f377b1ba0e93590a3d442078fabfa9b07d14c881c2e668fe78d5c | racket/eopl | lang.rkt | #lang eopl
;; grammar for the CLASSES language. Based on IMPLICIT-REFS, plus
;; multiple-argument procedures, multiple-declaration letrecs, and
;; multiple-declaration lets.
(provide (all-defined-out))
;;;;;;;;;;;;;;;; grammatical specification ;;;;;;;;;;;;;;;;
(define the-lexical-spec
'((whitespace (whitespace... | null | https://raw.githubusercontent.com/racket/eopl/43575d6e95dc34ca6e49b305180f696565e16e0f/tests/chapter9/classes/lang.rkt | racket | grammar for the CLASSES language. Based on IMPLICIT-REFS, plus
multiple-argument procedures, multiple-declaration letrecs, and
multiple-declaration lets.
grammatical specification ;;;;;;;;;;;;;;;;
new productions for oop
method formals
this is special-cased to prevent it from mutation
sllgen boilerplate ;;;;;... | #lang eopl
(provide (all-defined-out))
(define the-lexical-spec
'((whitespace (whitespace) skip)
(comment ("%" (arbno (not #\newline))) skip)
(identifier
(letter (arbno (or letter digit "_" "-" "?")))
symbol)
(number (digit (arbno digit)) number)
(number ("-" digit (arbno digit)) number)... |
5f1fc2aad94cace7e64bab6609e977f69bf8d9c5ad066d35ce38aa4f21bd9a1f | Apress/practical-webdev-haskell | Main.hs | module Adapter.HTTP.API.Main where
import Domain.Auth
import ClassyPrelude
import Web.Scotty.Trans
import Network.HTTP.Types.Status
import qualified Adapter.HTTP.API.Auth as Auth
import Adapter.HTTP.API.Common
import Katip
import Network.Wai
import Network.Wai.Middleware.Gzip
main :: ( MonadIO m, KatipContext m, Auth... | null | https://raw.githubusercontent.com/Apress/practical-webdev-haskell/17b90c06030def254bb0497b9e357f5d3b96d0cf/08/src/Adapter/HTTP/API/Main.hs | haskell | module Adapter.HTTP.API.Main where
import Domain.Auth
import ClassyPrelude
import Web.Scotty.Trans
import Network.HTTP.Types.Status
import qualified Adapter.HTTP.API.Auth as Auth
import Adapter.HTTP.API.Common
import Katip
import Network.Wai
import Network.Wai.Middleware.Gzip
main :: ( MonadIO m, KatipContext m, Auth... | |
93000d7312dcee8c315751450489d96417a35828df0fd9d4c54c722813c5c09c | erlangonrails/devdb | exmpp_compress.erl | Copyright ProcessOne 2006 - 2010 . All Rights Reserved .
%%
The contents of this file are subject to the Erlang Public License ,
Version 1.1 , ( the " License " ) ; you may not use this file except in
%% compliance with the License. You should have received a copy of the
%% Erlang Public License along with this s... | null | https://raw.githubusercontent.com/erlangonrails/devdb/0e7eaa6bd810ec3892bfc3d933439560620d0941/dev/exmpp-0.9.5/src/core/exmpp_compress.erl | erlang |
compliance with the License. You should have received a copy of the
Erlang Public License along with this software. If not, it can be
retrieved online at /.
basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
the License for the specific language governing rights and limitations
under the Licens... | Copyright ProcessOne 2006 - 2010 . All Rights Reserved .
The contents of this file are subject to the Erlang Public License ,
Version 1.1 , ( the " License " ) ; you may not use this file except in
Software distributed under the License is distributed on an " AS IS "
@author < >
-module(exmpp_compress... |
94865d4cafcc257ee5fd88ed507d217a2710ff3a1660c627ffa1d5488f5fb8af | pkpkpk/fress | bytestream.clj | (ns fress.impl.bytestream
(:import java.nio.ByteBuffer
org.fressian.impl.BytesOutputStream)
(:gen-class
:implements [clojure.lang.IDeref]
:extends org.fressian.impl.BytesOutputStream))
(defn -deref [^BytesOutputStream this]
(ByteBuffer/wrap (.internalBuffer this) 0 (.length this)))
| null | https://raw.githubusercontent.com/pkpkpk/fress/7ed0f063692263f1209ec05ffd740afaf54a0157/src/main/clj/fress/impl/bytestream.clj | clojure | (ns fress.impl.bytestream
(:import java.nio.ByteBuffer
org.fressian.impl.BytesOutputStream)
(:gen-class
:implements [clojure.lang.IDeref]
:extends org.fressian.impl.BytesOutputStream))
(defn -deref [^BytesOutputStream this]
(ByteBuffer/wrap (.internalBuffer this) 0 (.length this)))
| |
e817642eb32d37c40e0a7a1da61106d9be7ebaa3ba2c362de32a29f33ace0e40 | triffon/fp-2022-23 | 03.count-palindromes.rkt | #lang racket
(require rackunit)
(require rackunit/text-ui)
(require "common.03.rkt")
# # # Зад 3
интервала [ a , b ] .
(define (count-palindromes a b)
'тук)
(run-tests
(test-suite "count-palindromes tests"
(check-eq? (count-palindromes 100 200)
10)
(check-eq? (count-palindromes 1 2... | null | https://raw.githubusercontent.com/triffon/fp-2022-23/27f1575529dfd29ac756303e40c95cd3bd9098dc/exercises/cs2/03.scheme.hof-accumulate/03.count-palindromes.rkt | racket | #lang racket
(require rackunit)
(require rackunit/text-ui)
(require "common.03.rkt")
# # # Зад 3
интервала [ a , b ] .
(define (count-palindromes a b)
'тук)
(run-tests
(test-suite "count-palindromes tests"
(check-eq? (count-palindromes 100 200)
10)
(check-eq? (count-palindromes 1 2... | |
0c9d6d0df800a7b9ad970221c52f47d5c7fad311c25e9774f7c7d9400d03c4e3 | damn/cdq | update_ingame.clj | (ns game.update-ingame
(:require (engine [input :as input]
[statebasedgame :as state]))
(:use [game.settings :only (get-setting debug-mode)]
[game.ingame-gui :only (some-visible-frame? close-all-frames options-hotkey)]
(game.components [core :only (update-removelist player-body)]... | null | https://raw.githubusercontent.com/damn/cdq/5dbe979da6c198091ad86748f04054ebe1df7981/src/game/update_ingame.clj | clojure | when game is paused and/or the player is dead, let player be able to drop item-in-hand?
or drop it automatically when dead?
need to drop it here else in options menu it is still item-in-hand at cursor!
items vor components da items leftm-consumed vlt
Erst map-independent, da: | (ns game.update-ingame
(:require (engine [input :as input]
[statebasedgame :as state]))
(:use [game.settings :only (get-setting debug-mode)]
[game.ingame-gui :only (some-visible-frame? close-all-frames options-hotkey)]
(game.components [core :only (update-removelist player-body)]... |
5780789e444946473fcaa8d09a79e3b81a835a19e6ed2844ab8b82b1b4d79619 | Stratus3D/programming_erlang_exercises | nano_client.erl | -module(nano_client).
-export([send/3]).
send(Mod, Func, Args) ->
{ok, Socket} = gen_udp:open(0, [binary]),
ok = gen_udp:send(Socket, "localhost", 2345, term_to_binary({Mod, Func, Args})),
Value = receive
{udp, Socket, _, _, Bin} ->
io:format("Client received binary = ~p~n", [Bin]),
... | null | https://raw.githubusercontent.com/Stratus3D/programming_erlang_exercises/e4fd01024812059d338facc20f551e7dff4dac7e/chapter_17/exercise_3/nano_client.erl | erlang | -module(nano_client).
-export([send/3]).
send(Mod, Func, Args) ->
{ok, Socket} = gen_udp:open(0, [binary]),
ok = gen_udp:send(Socket, "localhost", 2345, term_to_binary({Mod, Func, Args})),
Value = receive
{udp, Socket, _, _, Bin} ->
io:format("Client received binary = ~p~n", [Bin]),
... | |
54d6f3309df02d076a45db5885a6463a884a30e3c45aa5042b51ad1ac06883fd | samrocketman/home | noclayto-hue-change-animator.scm | ;
; The GIMP -- an image manipulation program
Copyright ( C ) 1995 and
;
Hue Change Animator script for GIMP 2.4
; Original author: noclayto <www.gimptalk.com>
;
; Tags: animation
;
; Author statement:
;
;; Will cycle through the HUE-MODE by a step.
;; This script is mainly for learning. Use at your own risk... | null | https://raw.githubusercontent.com/samrocketman/home/63a8668a71dc594ea9ed76ec56bf8ca43b2a86ca/dotfiles/.gimp/scripts/noclayto-hue-change-animator.scm | scheme |
The GIMP -- an image manipulation program
Original author: noclayto <www.gimptalk.com>
Tags: animation
Author statement:
Will cycle through the HUE-MODE by a step.
This script is mainly for learning. Use at your own risk.
--------------------------------------------------------------------
--------------... | Copyright ( C ) 1995 and
Hue Change Animator script for GIMP 2.4
Distributed by Gimp FX Foundry project
it under the terms of the GNU General Public License as published by
the Free Software Foundation , either version 3 of the License , or
You should have received a copy of the GNU General P... |
e4fd0675110e42c1935b7ce96b1c4a9f5b09bd0d370d070200cdffdf56366839 | basho/riak_core | hashtree_tree.erl | %% -------------------------------------------------------------------
%%
Copyright ( c ) 2013 Basho Technologies , Inc. All Rights Reserved .
%%
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 ob... | null | https://raw.githubusercontent.com/basho/riak_core/abbcca3cfb7da10798d8fc169043955638d4d9db/src/hashtree_tree.erl | erlang | -------------------------------------------------------------------
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 language governing permissio... | Copyright ( c ) 2013 Basho Technologies , Inc. All Rights Reserved .
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
two s... |
56d36c18ff3aed70f0f7e4445f1ca8ad3faf7f6e97c12ef095d67f5ea0363cd6 | 2600hz-archive/whistle | rebar_asn1_compiler.erl | -*- erlang - indent - level : 4;indent - tabs - mode : nil -*-
%% ex: ts=4 sw=4 et
%% -------------------------------------------------------------------
%%
rebar : Erlang Build Tools
%%
Copyright ( c ) 2009 , 2010 ( )
%%
%% Permission is hereby granted, free of charge, to any person obtaining a copy
%% of thi... | null | https://raw.githubusercontent.com/2600hz-archive/whistle/1a256604f0d037fac409ad5a55b6b17e545dcbf9/utils/rebar/src/rebar_asn1_compiler.erl | erlang | ex: ts=4 sw=4 et
-------------------------------------------------------------------
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
to use, copy, modify, merge, publish, distribute, sublicense, and/or sel... | -*- erlang - indent - level : 4;indent - tabs - mode : nil -*-
rebar : Erlang Build Tools
Copyright ( c ) 2009 , 2010 ( )
in the Software without restriction , including without limitation the rights
copies of the Software , and to permit persons to whom the Software is
all copies or substantial portions... |
b9714c0025a38566d21d317d9f368c684cb919c964c8327f2b503af3e12a66e9 | pdarragh/parsing-with-zippers-paper-artifact | pwz_abstract_types.ml | type pos = int ref (* Using ref makes it easy to create values that are not pointer equal *)
let p_bottom = ref (-1)
type sym = string
let s_bottom = "<s_bottom>"
type tok = string
let t_eof = "<t_eof>"
| null | https://raw.githubusercontent.com/pdarragh/parsing-with-zippers-paper-artifact/c5c08306cfe4eec588237c7fa45b794649ccb68a/appendix/pwz_abstract_types.ml | ocaml | Using ref makes it easy to create values that are not pointer equal | let p_bottom = ref (-1)
type sym = string
let s_bottom = "<s_bottom>"
type tok = string
let t_eof = "<t_eof>"
|
83972ac76c4b900fbb003cfe9f0c3e272fc8c6d3778131b004cdf9ec31988919 | tidalcycles/tidal-midi | Stream.hs | |
Entry functions for interacting with MIDI devices through Tidal .
Entry functions for interacting with MIDI devices through Tidal.
-}
module Sound.Tidal.MIDI.Stream (midiStream, midiBackend, midiState, midiSetters, midiDevices, displayOutputDevices) where
-- generics
import Control.Concurrent
import ... | null | https://raw.githubusercontent.com/tidalcycles/tidal-midi/0f806c31daee46bb54053dc3407349001a0e00b8/Sound/Tidal/MIDI/Stream.hs | haskell | generics
Tidal specific
MIDI specific
^ A list of MIDI output devices
^ The name of the output device to connect
^ The MIDI Channel to use
^ The definition of params to be usable
^ a method to get the current time | |
Entry functions for interacting with MIDI devices through Tidal .
Entry functions for interacting with MIDI devices through Tidal.
-}
module Sound.Tidal.MIDI.Stream (midiStream, midiBackend, midiState, midiSetters, midiDevices, displayOutputDevices) where
import Control.Concurrent
import Cont... |
5d470dde777c6d50a6c35a5c80ac1f2f43e7b648b3ee56c4c2b551e25d154367 | robert-strandh/SICL | package-name-defun.lisp | (cl:in-package #:sicl-package)
(defun package-name (package-designator)
(let ((package (package-designator-to-package package-designator)))
(name package)))
| null | https://raw.githubusercontent.com/robert-strandh/SICL/65d7009247b856b2c0f3d9bb41ca7febd3cd641b/Code/Package/package-name-defun.lisp | lisp | (cl:in-package #:sicl-package)
(defun package-name (package-designator)
(let ((package (package-designator-to-package package-designator)))
(name package)))
| |
10bb2aa260c3d7d5e990d41a35afa899e216429ad72e894c12fe64033fd6602a | Plutonomicon/plutarch-plutus | MonadicSpec.hs | # LANGUAGE OverloadedRecordDot #
# LANGUAGE QualifiedDo #
module Plutarch.MonadicSpec (spec) where
import Control.Monad.Trans.Cont (cont, runCont)
import Plutarch.Api.V1 (
PAddress (PAddress),
PCredential,
PMaybeData,
PPubKeyHash,
PScriptContext,
PScriptPurpose (PSpending),
PStakingCredential,
)
import... | null | https://raw.githubusercontent.com/Plutonomicon/plutarch-plutus/9b83892057f2aaaed76e3af6193ad1ae242244cc/plutarch-test/tests/Plutarch/MonadicSpec.hs | haskell | We expect all these benchmarks to produce equivalent numbers
The checkSignatory family of functions implicitly use tracing due to
> PScriptContext :--> PUnit)
Signature not present.
> PDataRecord '["credential" ':= PCredential, "stakingCredential" ':= PMaybeData PStakingCredential]) | # LANGUAGE OverloadedRecordDot #
# LANGUAGE QualifiedDo #
module Plutarch.MonadicSpec (spec) where
import Control.Monad.Trans.Cont (cont, runCont)
import Plutarch.Api.V1 (
PAddress (PAddress),
PCredential,
PMaybeData,
PPubKeyHash,
PScriptContext,
PScriptPurpose (PSpending),
PStakingCredential,
)
import... |
5adc13adc5886e7dfb8799c7daa0a57126a5b8c8532298cbdfbaf252da1134dc | graninas/Functional-Design-and-Architecture | Hdl.hs | module Andromeda.Hardware.Language.Hdl where
import Andromeda.Hardware.Common
import Andromeda.Hardware.Domain
import Control.Monad.Free (Free (..), liftF)
data HdlMethod next
= SetupController DeviceName ControllerName ComponentPassport (Controller -> next)
| RegisterComponent Controller ComponentIndex Compon... | null | https://raw.githubusercontent.com/graninas/Functional-Design-and-Architecture/b6a78f80a2a2e0b913bcab1d2279fc137a90db4c/Second-Edition-Manning-Publications/BookSamples/CH08/Section8p1/src/Andromeda/Hardware/Language/Hdl.hs | haskell | module Andromeda.Hardware.Language.Hdl where
import Andromeda.Hardware.Common
import Andromeda.Hardware.Domain
import Control.Monad.Free (Free (..), liftF)
data HdlMethod next
= SetupController DeviceName ControllerName ComponentPassport (Controller -> next)
| RegisterComponent Controller ComponentIndex Compon... | |
681e4b28998ec2fe069e8a15cf878d2eba171c99b63bb3444b87fb5764fa7ba1 | lkuper/lvar-examples | map-lvar-waitsize.hs | # LANGUAGE TypeFamilies #
import Control.LVish
import Data.LVar.PureMap
import qualified Data.Map as M
data Item = Book | Shoes
deriving (Show, Ord, Eq)
Bug in ? : this program occasionally raises put - after - freeze
errors , even though I think the ` waitSize 2 ` should be enough
-- synchronization to preve... | null | https://raw.githubusercontent.com/lkuper/lvar-examples/681c0ed83366dbb8f7d4a1f1285c0ad3e42a436b/2.0/map-lvar-waitsize.hs | haskell | synchronization to prevent that.
Returns an ordinary Data.Map, because `freezeMap` turns a | # LANGUAGE TypeFamilies #
import Control.LVish
import Data.LVar.PureMap
import qualified Data.Map as M
data Item = Book | Shoes
deriving (Show, Ord, Eq)
Bug in ? : this program occasionally raises put - after - freeze
errors , even though I think the ` waitSize 2 ` should be enough
` Data . LVar . PureMap ... |
a8af544e698daa7ba5bd216c4b386c2085e01d06be259bf913b44f7795403499 | BranchTaken/Hemlock | test_pp.ml | open! Basis.Rudiments
open! Basis
open Unit
let test () =
File.Fmt.stdout
|> Fmt.fmt "pp "
|> Fmt.fmt (to_string ())
|> Fmt.fmt " -> "
|> pp ()
|> Fmt.fmt "\n"
|> ignore
let _ = test ()
| null | https://raw.githubusercontent.com/BranchTaken/Hemlock/f3604ceda4f75cf18b6ee2b1c2f3c5759ad495a5/bootstrap/test/basis/unit/test_pp.ml | ocaml | open! Basis.Rudiments
open! Basis
open Unit
let test () =
File.Fmt.stdout
|> Fmt.fmt "pp "
|> Fmt.fmt (to_string ())
|> Fmt.fmt " -> "
|> pp ()
|> Fmt.fmt "\n"
|> ignore
let _ = test ()
| |
a32cc730e99fce94b0d6d10cda919f76d2b15606903a2b627a45bda9b2818816 | oliyh/re-graph | core_test.cljc | (ns re-graph.core-test
(:require [re-graph.core :as re-graph]
[re-graph.internals :as internals :refer [default-instance-id]]
[re-frame.core :as re-frame]
[re-frame.db :refer [app-db]]
[day8.re-frame.test :refer [run-test-sync run-test-async wait-for]
:refe... | null | https://raw.githubusercontent.com/oliyh/re-graph/abffdc040461ffe1cac540d2dfce987127707afe/test/re_graph/core_test.cljc | clojure | create a subscription and wait for it to be sent | (ns re-graph.core-test
(:require [re-graph.core :as re-graph]
[re-graph.internals :as internals :refer [default-instance-id]]
[re-frame.core :as re-frame]
[re-frame.db :refer [app-db]]
[day8.re-frame.test :refer [run-test-sync run-test-async wait-for]
:refe... |
dd2e0c1153c56234ee689eef127b89a05985ffd13e5f71b81cc26691d558125c | Feldspar/feldspar-language | CRC.hs | {-# LANGUAGE GADTs #-}
--
Copyright ( c ) 2009 - 2011 , ERICSSON AB
-- All rights reserved.
--
-- Redistribution and use in source and binary forms, with or without
-- modification, are permitted provided that the following conditions are met:
--
-- * Redistributions of source code must retain the above copyri... | null | https://raw.githubusercontent.com/Feldspar/feldspar-language/499e4e42d462f436a5267ddf0c2f73d5741a8248/src/Feldspar/Algorithm/CRC.hs | haskell | # LANGUAGE GADTs #
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice,
this list of conditions and the following d... |
Copyright ( c ) 2009 - 2011 , ERICSSON AB
* Neither the name of the ERICSSON AB nor the names of its contributors
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS " AS IS "
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED . IN NO EVENT SHALL THE... |
54cd00bf963e18d141908e49704e591a164b8343505c9c3a0ed427699554c819 | dharmatech/surfage | test.scm | ;;; array test
2001
(define past
(let ((stones '()))
(lambda stone
(if (null? stone)
(reverse stones)
(set! stones (cons (apply (lambda (stone) stone) stone) stones))))))
(define (tail n)
(if (< n (length (past)))
(list-tail (past) (- (length (past)) n))
(past)))
;;;... | null | https://raw.githubusercontent.com/dharmatech/surfage/895f16af83d9ce3c190f69626c9baba8c44d76bc/s25/test.scm | scheme | array test
Simple tests
Share and change:
Check that arrays copy the shape specification
Check that index arrays work even when they share
Check that shape arrays work even when they share
2 10 11 12 13 1 10 11 1 11 13 1 11 12 1 12 12
2 12 16
... | 2001
(define past
(let ((stones '()))
(lambda stone
(if (null? stone)
(reverse stones)
(set! stones (cons (apply (lambda (stone) stone) stone) stones))))))
(define (tail n)
(if (< n (length (past)))
(list-tail (past) (- (length (past)) n))
(past)))
(or (and (shape)
... |
f9a7cabd0f5e5638bff0bdd4a583d617b13b163bedb01046a277b7297dc663f1 | juhp/stack-clean-old | Types.hs | module Types (
Deletion (..),
isDelete
)
where
data Deletion = Dryrun | Delete
deriving Eq
isDelete :: Deletion -> Bool
isDelete = (== Delete)
| null | https://raw.githubusercontent.com/juhp/stack-clean-old/810798c26801db367766ed50a15328017a154c0f/src/Types.hs | haskell | module Types (
Deletion (..),
isDelete
)
where
data Deletion = Dryrun | Delete
deriving Eq
isDelete :: Deletion -> Bool
isDelete = (== Delete)
| |
2f7780944f3c05f12d39b6262a5a62b42a987b536e9beaf9f26de9c65b25cabc | csabahruska/jhc-components | Main.hs | module FrontEnd.Tc.Main (tiExpr, tiProgram, makeProgram, isTypePlaceholder ) where
import Control.Monad.Reader
import Control.Monad.Writer
import Data.Graph(stronglyConnComp, SCC(..))
import System.IO(hPutStr,stderr)
import Text.Printf
import qualified Data.Map as Map
import qualified Data.Set as Set
import qualified ... | null | https://raw.githubusercontent.com/csabahruska/jhc-components/a7dace481d017f5a83fbfc062bdd2d099133adf1/jhc-frontend/src/FrontEnd/Tc/Main.hs | haskell | we do not further sub-divide the implicitly typed declarations in
a binding group.
fall through if the type isn't arrowy enough (will produce type error)
fall through if this is a recursive call to oneself
the fall through case
GEN1
(_,False,_) <- unbox t
I know this looks weird but it appears to be correct
e1 ... | module FrontEnd.Tc.Main (tiExpr, tiProgram, makeProgram, isTypePlaceholder ) where
import Control.Monad.Reader
import Control.Monad.Writer
import Data.Graph(stronglyConnComp, SCC(..))
import System.IO(hPutStr,stderr)
import Text.Printf
import qualified Data.Map as Map
import qualified Data.Set as Set
import qualified ... |
7d345d622835651605279407c248727e6152e81c27eb0fdfbedc0dda3b9f18a4 | alesaccoia/festival_flinger | darpa_phones.scm | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;; ;;
Centre for Speech Technology Research ; ;
University of Edinburgh , UK ; ;
... | null | https://raw.githubusercontent.com/alesaccoia/festival_flinger/87345aad3a3230751a8ff479f74ba1676217accd/lib/darpa_phones.scm | scheme |
;;
;
;
;
;
;;
Permission is hereby granted, free of charge, to use and distribute ;;
this software and its documentation without restriction, including ;;
without l... | Author :
Date : April 1999
(require 'phoneset)
(set! darpa_fs (cadr
(defPhoneSet
darpa
(Features
(vowel (syllabic + -)
(length long short diphthong schwa)
(height high mid low)
(front front mid back)
(round + -))
(consonant
(syllabic ... |
b5b0c67d37c75cc83ce30eece2b61b6c3ef262d963968c6bb44bbdd13fcb5207 | arachne-framework/factui | basic_rules.cljc | (ns factui.bench.basic-rules
(:require
#?(:cljs [factui.api :as api :include-macros true]
:clj [factui.api :as api])
#?(:clj [clara.rules :as cr]
:cljs [clara.rules :as cr :include-macros true])
[clojure.pprint :refer [pprint]]
#?(:clj [clojure.test :as t :refer [deftest is testing run-tests]]... | null | https://raw.githubusercontent.com/arachne-framework/factui/818ea79d7f84dfe80ad23ade0b6b2ed5bb1c6287/test/factui/bench/basic_rules.cljc | clojure | (ns factui.bench.basic-rules
(:require
#?(:cljs [factui.api :as api :include-macros true]
:clj [factui.api :as api])
#?(:clj [clara.rules :as cr]
:cljs [clara.rules :as cr :include-macros true])
[clojure.pprint :refer [pprint]]
#?(:clj [clojure.test :as t :refer [deftest is testing run-tests]]... | |
8569a13dd57d88dc37e7671f0d2c3a0d31accd37d9a74fbbc08ab16680a4442d | janestreet/core_kernel | total_map.ml | include Total_map_intf
module Stable = struct
open Core.Core_stable
module V1 = struct
type ('key, 'a, 'cmp, 'enum) t = ('key, 'a, 'cmp) Map.V1.t
module type S =
Stable_V1_S with type ('key, 'a, 'cmp, 'enum) total_map := ('key, 'a, 'cmp, 'enum) t
module type For_include_functor =
Stable_... | null | https://raw.githubusercontent.com/janestreet/core_kernel/597299d11c2ee99f219592d89a5890f8f0b6dfe7/total_map/src/total_map.ml | ocaml | include Total_map_intf
module Stable = struct
open Core.Core_stable
module V1 = struct
type ('key, 'a, 'cmp, 'enum) t = ('key, 'a, 'cmp) Map.V1.t
module type S =
Stable_V1_S with type ('key, 'a, 'cmp, 'enum) total_map := ('key, 'a, 'cmp, 'enum) t
module type For_include_functor =
Stable_... | |
7a83a08ce70b5f6b5c5f733a247d9aab34b8887e183fff98ad25359f8476da0f | goblint/analyzer | topDown.ml | * Top down solver using box / warrow . This is superseded by td3 but kept as a simple version without term & space ( & incremental ) .
open Prelude
open Analyses
open Constraints
open Messages
module WP =
functor (S:EqConstrSys) ->
functor (HM:Hashtbl.S with type key = S.v) ->
struct
open SolverBox.Warrow (... | null | https://raw.githubusercontent.com/goblint/analyzer/b9f527f6d3066d548c5551716366fbed8acecf35/src/solvers/topDown.ml | ocaml | y -> xs
y -> xs
side-effected variables
x,y -> d
iterate until there are no more new side-effects | * Top down solver using box / warrow . This is superseded by td3 but kept as a simple version without term & space ( & incremental ) .
open Prelude
open Analyses
open Constraints
open Messages
module WP =
functor (S:EqConstrSys) ->
functor (HM:Hashtbl.S with type key = S.v) ->
struct
open SolverBox.Warrow (... |
2eba7f3823a14fb9e9f21845cea62ee4d74fa051795e8a48c3d8259233582cd2 | avsm/ocaml-ssh | mpl_typechk.ml |
* Copyright ( c ) 2005 < >
*
* Permission to use , copy , modify , and distribute this software for any
* purpose with or without fee is hereby granted , provided that the above
* copyright notice and this permission notice appear in all copies .
*
* THE SOFTWARE IS PROVIDED " AS IS " AND THE AU... | null | https://raw.githubusercontent.com/avsm/ocaml-ssh/26577d1501e7a43e4b520239b08da114c542eda4/mpl/mpl_typechk.ml | ocaml | Types for variables
Base types for statements that target language needs support for
Higher level constructs
id,size,type
id,ty,(match,label,guard,xs)
id,int size,xs
Type checking environment
Types for expressions
XXX we check values later
Ensure expression is a constant
Convert expression to a con... |
* Copyright ( c ) 2005 < >
*
* Permission to use , copy , modify , and distribute this software for any
* purpose with or without fee is hereby granted , provided that the above
* copyright notice and this permission notice appear in all copies .
*
* THE SOFTWARE IS PROVIDED " AS IS " AND THE AU... |
82f8f5de4d80f74ed1038b3035a543c516e7ae3b9ef2ab630f49fe22c4907305 | aws-beam/aws-erlang | aws_lambda.erl | %% WARNING: DO NOT EDIT, AUTO-GENERATED CODE!
See -beam/aws-codegen for more details .
%% @doc Lambda
%%
%% Overview
%%
%% Lambda is a compute service that lets you run code without provisioning or
%% managing servers.
%%
%% Lambda runs your code on a high-availability compute infrastructure and
%% performs all of t... | null | https://raw.githubusercontent.com/aws-beam/aws-erlang/699287cee7dfc9dc8c08ced5f090dcc192c9cba8/src/aws_lambda.erl | erlang | WARNING: DO NOT EDIT, AUTO-GENERATED CODE!
@doc Lambda
Overview
Lambda is a compute service that lets you run code without provisioning or
managing servers.
Lambda runs your code on a high-availability compute infrastructure and
performs all of the administration of the compute resources, including
server an... | See -beam/aws-codegen for more details .
The Lambda API Reference provides information about each of the API
You can use Software Development Kits ( SDKs ) , Integrated Development
installation instructions , see Tools for Amazon Web Services .
endpoints and quotas in the Amazon Web Services General Referenc... |
37a51949240ec426ddfead293ce009712928164d48487c0308757c13ae11b5ac | ssor/erlangDemos | myapp_app.erl | %% @author {{author}}
myapp { { author } }
%% @doc Callbacks for the myapp application.
-module(myapp_app).
% -author("{{author}}").
-behaviour(application).
-export([start/2,stop/1]).
, _ ) - > ServerRet
%% @doc application start callback for myapp.
start(_Type, _StartArgs) ->
io:format("type => ~p _Sta... | null | https://raw.githubusercontent.com/ssor/erlangDemos/632cd905be2c4f275f1c1ae15238e711d7bb9147/myapp/src/myapp_app.erl | erlang | @author {{author}}
@doc Callbacks for the myapp application.
-author("{{author}}").
@doc application start callback for myapp.
@doc application stop callback for myapp. | myapp { { author } }
-module(myapp_app).
-behaviour(application).
-export([start/2,stop/1]).
, _ ) - > ServerRet
start(_Type, _StartArgs) ->
io:format("type => ~p _StartArgs => ~p~n",[_Type,_StartArgs]),
myapp_deps:ensure(),
io:format("start_link ->~n"),
myapp_sup:start_link().
@spec stop(... |
02aa44b436f4216b0b19cbecc090ffaa1f8372675208fd4757b6ff477c88a83d | SmallImprovements/spring-clean | Class.hs | module Java.Class (
getQualifyingClassName
) where
import Language.Java.Syntax
import Java.Helper (concatIdent, getPackageDeclName)
import Data.Maybe (listToMaybe)
getQualifyingClassName :: CompilationUnit -> String
getQualifyingClassName (CompilationUnit package _ typeDecls) =
getPackageDeclName package ++ maybe... | null | https://raw.githubusercontent.com/SmallImprovements/spring-clean/000b10dcb570847d60fed3eb4539781ab20ae5b5/src/Java/Class.hs | haskell | module Java.Class (
getQualifyingClassName
) where
import Language.Java.Syntax
import Java.Helper (concatIdent, getPackageDeclName)
import Data.Maybe (listToMaybe)
getQualifyingClassName :: CompilationUnit -> String
getQualifyingClassName (CompilationUnit package _ typeDecls) =
getPackageDeclName package ++ maybe... | |
df7dbf3b74fcb609201f436da363019435fe54addb8c2cd28b043fbc0288c797 | teknql/wing | walk_test.cljc | (ns wing.core.walk-test
(:require [wing.core.walk :as sut]
#?(:clj [clojure.test :as t :refer [deftest testing is]]
:cljs [cljs.test :as t :include-macros true :refer [deftest testing is]])
[clojure.walk :as walk]))
(deftest pathwalk-pre-test
(testing "calls in the same order... | null | https://raw.githubusercontent.com/teknql/wing/de8148bf48210eac0c0e3f8e31346b5b2ead39c2/test/wing/core/walk_test.cljc | clojure | (ns wing.core.walk-test
(:require [wing.core.walk :as sut]
#?(:clj [clojure.test :as t :refer [deftest testing is]]
:cljs [cljs.test :as t :include-macros true :refer [deftest testing is]])
[clojure.walk :as walk]))
(deftest pathwalk-pre-test
(testing "calls in the same order... | |
57d12f603cf4b1cc359106329135591719528fe3ffb1d539c7cc74290c1f0bfc | blambo/accelerate-repa | Repa.hs | -- {-# LANGUAGE GADTs #-}
-- |
Module : Data . Array . Accelerate .
--
Maintainer : < blambo+ >
--
This module implements the back - end for the accelerate EDSL
-- The current structure follows closely on
-- Data.Array.Accelerate.Interpreter
module Data.Array.Accelerate.Repa
( Arrays
, accToRep... | null | https://raw.githubusercontent.com/blambo/accelerate-repa/5ea4d40ebcca50d5b952e8783a56749cea4431a4/Data/Array/Accelerate/Repa.hs | haskell | {-# LANGUAGE GADTs #-}
|
The current structure follows closely on
Data.Array.Accelerate.Interpreter
for execution
Write source code to temporary file in /tmp
compile
execute compiled, checking for error
Delete temporary file
| Compiles the given file name
^ The source file
| Executes the given function ... | Module : Data . Array . Accelerate .
Maintainer : < blambo+ >
This module implements the back - end for the accelerate EDSL
module Data.Array.Accelerate.Repa
( Arrays
, accToRepa
, compile
, exec
, run
)
where
import Data.Array.Accelerate
import qualified Data.Array.Accelerate.Sm... |
389bbb9c3e23df9a4b01e7fc60a272b2eb77b30be87c945a958ff7da384d2da7 | cooldaemon/ermlia | ermlia_data_store.erl | @author < > [ / ]
@copyright 2008
%% @doc This module is store for key-value data.
Copyright 2008
%%
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
%%
%% Unles... | null | https://raw.githubusercontent.com/cooldaemon/ermlia/fa5f8acf5965893b33f405de048e6d570d4aba53/src/ermlia_data_store.erl | erlang | @doc This module is store for key-value data.
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 Licen... | @author < > [ / ]
@copyright 2008
Copyright 2008
Licensed under the Apache License , Version 2.0 ( the " License " ) ;
distributed under the License is distributed on an " AS IS " BASIS ,
-module(ermlia_data_store).
-export([start_link/1, stop/1]).
-export([put/4, get/2]).
-export([dump/1]).
-export... |
a9481b2057bb1262cd9fdc8f990d98ce1b3b67d7bd984be34bd3b56d0fa4346b | jeopard/haskell-checking-account | StatementSpec.hs | module Models.StatementSpec (spec) where
import Data.Scientific
import Data.Time.Calendar
import Data.UUID
import Test.Hspec
import Models.Statement
import Models.StatementDate
import qualified Models.Operation as O
spec :: Spec
spec = do
fromOperationsSpec
fromOperationsSpec :: Spec
fromOperationsSpec = do
de... | null | https://raw.githubusercontent.com/jeopard/haskell-checking-account/27a889e507ad830ccb476a9663a5ab62aba8baa7/test/Models/StatementSpec.hs | haskell | module Models.StatementSpec (spec) where
import Data.Scientific
import Data.Time.Calendar
import Data.UUID
import Test.Hspec
import Models.Statement
import Models.StatementDate
import qualified Models.Operation as O
spec :: Spec
spec = do
fromOperationsSpec
fromOperationsSpec :: Spec
fromOperationsSpec = do
de... | |
0f8f7edf5bea97b425505a94280abf4dd2d934fdbf740663441c9a113cf67319 | aziem/binaryninja-ocaml | functiongraph.ml | open Ctypes
open Foreign
module B = Ffi_bindings.Bindings(Ffi_generated_types)(Ffi_generated)
open Ffi_bindings
open B
type bn_functiongraph = Typedefs.bn_functiongraph Ctypes.structure Ctypes_static.ptr
type bn_functiongraphblock = Typedefs.bn_functiongraphblock Ctypes.structure Ctypes_static.ptr
type bn_function_... | null | https://raw.githubusercontent.com/aziem/binaryninja-ocaml/5773d791ebb717816b8c47863bce8122f39764b4/lib/functiongraph.ml | ocaml | open Ctypes
open Foreign
module B = Ffi_bindings.Bindings(Ffi_generated_types)(Ffi_generated)
open Ffi_bindings
open B
type bn_functiongraph = Typedefs.bn_functiongraph Ctypes.structure Ctypes_static.ptr
type bn_functiongraphblock = Typedefs.bn_functiongraphblock Ctypes.structure Ctypes_static.ptr
type bn_function_... | |
8ff0d35035ef779ab0789f4c2b8032f5eba612379f9e2b0fe44b646a2ccc0837 | gchrupala/morfette | Assoc.hs | # LANGUAGE MultiParamTypeClasses , FunctionalDependencies
, FlexibleInstances #
, FlexibleInstances #-}
module GramLab.Data.Assoc ( Assoc
, fromAssoc
)
where
import qualified Data.Map as Map
import qualified Data.IntMap as IntMap
import qualified Data.List as... | null | https://raw.githubusercontent.com/gchrupala/morfette/be40676c975d660bbb893953d354168506069862/src/GramLab/Data/Assoc.hs | haskell | # LANGUAGE MultiParamTypeClasses , FunctionalDependencies
, FlexibleInstances #
, FlexibleInstances #-}
module GramLab.Data.Assoc ( Assoc
, fromAssoc
)
where
import qualified Data.Map as Map
import qualified Data.IntMap as IntMap
import qualified Data.List as... | |
c2775eae2b221dd11a70e67dd7da57d7fc03716de0f7b6741f04f884600e4fc1 | eburlingame/arinc-parser | sample_records.clj | (ns arinc424.sample-records
(:require [clojure.test :refer :all]))
(def sample-records
[{:icao-code "K5",
:frequency-protection-distance nil,
:dme-ident "",
:vor-ndb-freq 113.1,
:vor-longitude -83.63869444444445,
:vor-name... | null | https://raw.githubusercontent.com/eburlingame/arinc-parser/1bef86924aef21888c27301bf51af90262ec4c52/test/arinc424/sample_records.clj | clojure | (ns arinc424.sample-records
(:require [clojure.test :refer :all]))
(def sample-records
[{:icao-code "K5",
:frequency-protection-distance nil,
:dme-ident "",
:vor-ndb-freq 113.1,
:vor-longitude -83.63869444444445,
:vor-name... | |
ee817ef7deefdc01dc183e12ee17200255cdd7bf4fd9d8a660e2e6fb1ec84f27 | roehst/tapl-implementations | core.mli | module Core
Core typechecking and evaluation functions
Core typechecking and evaluation functions
*)
open Syntax
open Support.Error
val typeof : context -> term -> ty
type store
val emptystore : store
val shiftstore : int -> store -> store
val eval : context -> store -> term -> term * store
val kindof ... | null | https://raw.githubusercontent.com/roehst/tapl-implementations/23c0dc505a8c0b0a797201a7e4e3e5b939dd8fdb/fullomega/core.mli | ocaml | module Core
Core typechecking and evaluation functions
Core typechecking and evaluation functions
*)
open Syntax
open Support.Error
val typeof : context -> term -> ty
type store
val emptystore : store
val shiftstore : int -> store -> store
val eval : context -> store -> term -> term * store
val kindof ... | |
ba61b830a5e6f3d692e1b763d26471039e6cc219c0d26e2fa3e72c5985fba767 | fp-works/2019-winter-Haskell-school | PartySpec.hs | import Data.Tree
import Employee
import Party
import Test.Hspec
main :: IO ()
main =
hspec $ do
describe "Party" $ do
let gl1 = GL [Emp {empName = "Emp 1", empFun = 10}] 10
let gl2 = GL [Emp {empName = "Emp 2", empFun = 15}] 15
describe "exercie 1" $ do
describe "1.1" $ do
it ... | null | https://raw.githubusercontent.com/fp-works/2019-winter-Haskell-school/823b67f019b9e7bc0d3be36711c0cc7da4eba7d2/cis194/week8/tien/test/PartySpec.hs | haskell | import Data.Tree
import Employee
import Party
import Test.Hspec
main :: IO ()
main =
hspec $ do
describe "Party" $ do
let gl1 = GL [Emp {empName = "Emp 1", empFun = 10}] 10
let gl2 = GL [Emp {empName = "Emp 2", empFun = 15}] 15
describe "exercie 1" $ do
describe "1.1" $ do
it ... | |
95ac5179c4345e483d79e63f39d734bbba12440ee4ce6874f33b715d4121c22e | justin2004/git_to_rdf | project.clj | (defproject git_to_rdf "0.1.0-SNAPSHOT"
:description "FIXME: write description"
:url ""
:license {:name "TODO"
:url "TODO"}
:dependencies [[org.clojure/clojure "1.10.0"]
[org.apache.jena/apache-jena-libs "4.5.0" :extension "pom"]
[org.clojure/data.csv "1.0.1"]
... | null | https://raw.githubusercontent.com/justin2004/git_to_rdf/708e5d86fd723642482e0685f0cf73f554c21529/project.clj | clojure | (defproject git_to_rdf "0.1.0-SNAPSHOT"
:description "FIXME: write description"
:url ""
:license {:name "TODO"
:url "TODO"}
:dependencies [[org.clojure/clojure "1.10.0"]
[org.apache.jena/apache-jena-libs "4.5.0" :extension "pom"]
[org.clojure/data.csv "1.0.1"]
... | |
ca77bfbfcf82c9ec78d5932cde6f517453235fab2441d0e166a9af484f71c518 | kowainik/piece-of-cake-slayer | Schema.hs | -- | Helper functions to create and drop database from @.sql@ files.
module Piece.Db.Schema
( prepareDb
) where
import CakeSlayer.Db (WithDb, executeRaw_)
| Prepare data base for the testing environment :
1 . Drop all existing tables .
2 . Created tables from scratch .
1. Drop all existing t... | null | https://raw.githubusercontent.com/kowainik/piece-of-cake-slayer/98c44dae5cf8ffce896292beb042c315800ed0ae/src/Piece/Db/Schema.hs | haskell | | Helper functions to create and drop database from @.sql@ files.
| Create tables from the @sql/schema.sql@ file.
| Insert values from the @sql/seed.sql@ file.
| Delete tables using the @sql/drop.sql@ file. |
module Piece.Db.Schema
( prepareDb
) where
import CakeSlayer.Db (WithDb, executeRaw_)
| Prepare data base for the testing environment :
1 . Drop all existing tables .
2 . Created tables from scratch .
1. Drop all existing tables.
2. Created tables from scratch.
-}
prepareDb :: (WithDb env m)... |
372cce1838e93e25c77f84894d90cedea8d6a0f99add6e17ff810cfd5ccde8d8 | ogaml/ogaml | OS_impl_osx.ml |
type os =
| Windows
| Linux
| OSX
let os = OSX
let resources_dir = Cocoa.resource_path () ^ "/"
let canonical_path s =
if Sys.file_exists s then
Cocoa.realpath s
else
invalid_arg ("File not found : " ^ s)
| null | https://raw.githubusercontent.com/ogaml/ogaml/5e74597521abf7ba2833a9247e55780eabfbab78/src/core/OS_impl_osx.ml | ocaml |
type os =
| Windows
| Linux
| OSX
let os = OSX
let resources_dir = Cocoa.resource_path () ^ "/"
let canonical_path s =
if Sys.file_exists s then
Cocoa.realpath s
else
invalid_arg ("File not found : " ^ s)
| |
2a3ddbf4d2b9b1b3225f051455845bf9a5325db4ada300021ab5aae10c81e2d5 | returntocorp/ocaml-tree-sitter-core | Json_rule_adapter.mli |
Convert between tree - sitter 's representation of variants
e.g. { " type " : " SYMBOL " , " name " : " foo " } and atd 's convention
e.g. [ " SYMBOL " , " foo " ] .
This is used in Tree_sitter.atd .
Convert between tree-sitter's representation of variants
e.g. {"type": "SYMBOL", "name": "f... | null | https://raw.githubusercontent.com/returntocorp/ocaml-tree-sitter-core/28f750bb894ea4c0a7f6b911e568ab9d731cc0b5/src/gen/lib/Json_rule_adapter.mli | ocaml |
Convert between tree - sitter 's representation of variants
e.g. { " type " : " SYMBOL " , " name " : " foo " } and atd 's convention
e.g. [ " SYMBOL " , " foo " ] .
This is used in Tree_sitter.atd .
Convert between tree-sitter's representation of variants
e.g. {"type": "SYMBOL", "name": "f... | |
46e1bf6325dbc5e9f06147d9d41661030dda395b7d5d98ea113b861c33b6102f | haskell/parsec | Text.hs | {-# LANGUAGE Safe #-}
-----------------------------------------------------------------------------
-- |
Module : Text . Parsec . String
-- Copyright : (c) Antoine Latter 2011
-- License : BSD-style (see the file libraries/parsec/LICENSE)
--
-- Maintainer :
-- Stability : provisional
-- Portabi... | null | https://raw.githubusercontent.com/haskell/parsec/88cc9e006ddf944da74285471bd7120237d8c191/src/Text/Parsec/Text.hs | haskell | # LANGUAGE Safe #
---------------------------------------------------------------------------
|
Copyright : (c) Antoine Latter 2011
License : BSD-style (see the file libraries/parsec/LICENSE)
Maintainer :
Stability : provisional
Portability : portable
Convenience definitions for working with 'Te... |
Module : Text . Parsec . String
module Text.Parsec.Text
( Parser, GenParser, parseFromFile
) where
import qualified Data.Text as Text
import qualified Data.Text.IO as T
import Text.Parsec.Prim
import Text.Parsec.Error
type Parser = Parsec Text.Text ()
type GenParser st = Parsec Text.Text st
in... |
09b21145c8fd0bdc5483fcee290cdea0bef4a44b19d701634be98d83d9f5be68 | ppaml-op3/insomnia | Summary.hs | | Intermediate results collected in the course of the Insomnia→FΩ translation .
module Insomnia.ToF.Summary where
import Data.Monoid (Endo)
import Unbound.Generics.LocallyNameless (Embed)
import qualified FOmega.Syntax as F
import qualified FOmega.SemanticSig as F
| An unpacked form of an ' FOmega . SemanticSig... | null | https://raw.githubusercontent.com/ppaml-op3/insomnia/5fc6eb1d554e8853d2fc929a957c7edce9e8867d/src/Insomnia/ToF/Summary.hs | haskell |
We make use of the fact that a 'SigSummary' is a 'Monoid'.
| The result of translating a signature, in unpacked form.
the signature summary gives the type of the module. The field
assignments provide a list of terms that will be used to populate
field assigns (for example by unpacking existentials, etc). The
... | | Intermediate results collected in the course of the Insomnia→FΩ translation .
module Insomnia.ToF.Summary where
import Data.Monoid (Endo)
import Unbound.Generics.LocallyNameless (Embed)
import qualified FOmega.Syntax as F
import qualified FOmega.SemanticSig as F
| An unpacked form of an ' FOmega . SemanticSig... |
b117314949585f6924e827790fa484e671ac266a1b3b6eda4e66f18ff960a5ca | nikita-volkov/rebase | Bind.hs | module Rebase.Data.Functor.Bind
(
module Data.Functor.Bind
)
where
import Data.Functor.Bind
| null | https://raw.githubusercontent.com/nikita-volkov/rebase/7c77a0443e80bdffd4488a4239628177cac0761b/library/Rebase/Data/Functor/Bind.hs | haskell | module Rebase.Data.Functor.Bind
(
module Data.Functor.Bind
)
where
import Data.Functor.Bind
| |
77e7c46bc41ec6e188a86ee918ffae06536f22bec729cb7ed7bfb3d8c9f2bb95 | phantomics/seed | package.lisp | package.lisp
(defpackage #:demo-blog
(:use #:cl))
| null | https://raw.githubusercontent.com/phantomics/seed/f128969c671c078543574395d6b23a1a5f2723f8/demo-blog/package.lisp | lisp | package.lisp
(defpackage #:demo-blog
(:use #:cl))
| |
d2398cb366358436157e7e090dbe796ebc31c942a484b2493f8c07405d7fa80a | frenchy64/fully-satisfies | everyp_test.clj | (ns io.github.frenchy64.fully-satisfies.everyp-test
(:refer-clojure :exclude [every-pred])
(:require [clojure.test :refer [is]]
[clojure.math.combinatorics :as comb]
[com.gfredericks.test.chuck.clojure-test :refer [checking]]
[io.github.frenchy64.fully-satisfies.never :refer [nev... | null | https://raw.githubusercontent.com/frenchy64/fully-satisfies/ccaa09a62f2f3454d856b4f47be40b0e628fea6b/test/io/github/frenchy64/fully_satisfies/everyp_test.clj | clojure | (ns io.github.frenchy64.fully-satisfies.everyp-test
(:refer-clojure :exclude [every-pred])
(:require [clojure.test :refer [is]]
[clojure.math.combinatorics :as comb]
[com.gfredericks.test.chuck.clojure-test :refer [checking]]
[io.github.frenchy64.fully-satisfies.never :refer [nev... | |
cb8f67a9de87412d776936c230d14e8e81e3d07b9e10b5e6b899ed7ae2bcc0d6 | windorg/app-old | Reply.hs | module Web.Controller.Reply where
import Data.Functor (void)
import qualified Data.Set as Set
import Debug.Trace (traceShowId)
import qualified Optics
import Web.Controller.Authorization
import Web.Controller.Prelude
import Web.Helper.Common
import Web.Helper.ReplySource
import Web.View.Reply.Edit
import Web.View.Repl... | null | https://raw.githubusercontent.com/windorg/app-old/ed9c5322c8ab8a0275bdcd479be12a3f230da8c9/Web/Controller/Reply.hs | haskell | will redirect to login when logged out
When replying to a thread: subscribe the user to that thread
Send out notifications
ON DELETE CASCADE won't work on subscribers, so we just delete the subscriber when we know
the user doesn't exist anymore
TODO: not sure why we fill both cardUpdateId and replyId
TODO: am I ... | module Web.Controller.Reply where
import Data.Functor (void)
import qualified Data.Set as Set
import Debug.Trace (traceShowId)
import qualified Optics
import Web.Controller.Authorization
import Web.Controller.Prelude
import Web.Helper.Common
import Web.Helper.ReplySource
import Web.View.Reply.Edit
import Web.View.Repl... |
564f09171b226d796299a52f5667f2636780004966372ee5146d741b6efa2cf9 | ralsei/bingus | info.rkt | #lang info
(define collection "bingus-quickscript")
(define pkg-desc "A DrRacket Quickscript to run Bingus")
(define version "0.0001")
(define deps '("bingus-lib"
"base"
"quickscript"))
| null | https://raw.githubusercontent.com/ralsei/bingus/c08cf67534088a19987c6c35bf7006d9a3a39171/bingus-quickscript/info.rkt | racket | #lang info
(define collection "bingus-quickscript")
(define pkg-desc "A DrRacket Quickscript to run Bingus")
(define version "0.0001")
(define deps '("bingus-lib"
"base"
"quickscript"))
| |
cd68566fe0674b49fe7da4a8a175761d94a536882ca0a58bfed6ed4e9eeb09cf | acieroid/scala-am | countA-1.scm | (letrec ((count (lambda (n) (if (= n 0) "done" (count (- n 1))))))
(count 10))
| null | https://raw.githubusercontent.com/acieroid/scala-am/13ef3befbfc664b77f31f56847c30d60f4ee7dfe/test/changesBenevolPaper/countA-1.scm | scheme | (letrec ((count (lambda (n) (if (= n 0) "done" (count (- n 1))))))
(count 10))
| |
95ec9300fab4c7bf518b39cce8b13bde339163e53ca059b6fa605ab39cfc1987 | tip-org/tools | SplitFormulas.hs | -- Split up formulas into smaller parts.
1 . forall x1 .. xn . ( t & u ) = = = > ( forall x1 .. xn . t ) & ( forall x1 .. xn ) . u
2 . forall x1 .. xn . ( t = u ) = = = > ( forall x1 .. xn . t = > u ) & ( forall x1 .. xn . u = > t )
-- if t, u have boolean type.
module Tip.Pass.SplitFormulas where
import Tip.Ty... | null | https://raw.githubusercontent.com/tip-org/tools/34350072587bd29157d18331eb895a1b2819555f/tip-lib/src/Tip/Pass/SplitFormulas.hs | haskell | Split up formulas into smaller parts.
if t, u have boolean type. | 1 . forall x1 .. xn . ( t & u ) = = = > ( forall x1 .. xn . t ) & ( forall x1 .. xn ) . u
2 . forall x1 .. xn . ( t = u ) = = = > ( forall x1 .. xn . t = > u ) & ( forall x1 .. xn . u = > t )
module Tip.Pass.SplitFormulas where
import Tip.Types
import Tip.Core
splitFormulas :: Ord a => Theory a -> Theory a
splitF... |
1a451d036a81f16445c333e4b2544261c269ba21fb975ad6b70e7e3edf47fd27 | hamidreza-s/Tnesia | tnesia_common_bench_SUITE.erl | -module(tnesia_common_bench_SUITE).
-compile(export_all).
-include_lib("common_test/include/ct.hrl").
-include("tnesia.hrl").
-record(tnesia_record, {id, value}).
-define(VALUE(ByteSize), [X || X <- lists:seq(1, ByteSize)]).
-define(TIMELINE(Int), list_to_binary("timeline-" ++ integer_to_list(Int))).
-define(DEBUG(F... | null | https://raw.githubusercontent.com/hamidreza-s/Tnesia/52a3a88a52b423fbc5959978c0bba61654166d47/bench/tnesia_common_bench_SUITE.erl | erlang | ====================================================================
CT Callbacks
====================================================================
--------------------------------------------------------------------
suite | groups | all
--------------------------------------------------------------------
--------... | -module(tnesia_common_bench_SUITE).
-compile(export_all).
-include_lib("common_test/include/ct.hrl").
-include("tnesia.hrl").
-record(tnesia_record, {id, value}).
-define(VALUE(ByteSize), [X || X <- lists:seq(1, ByteSize)]).
-define(TIMELINE(Int), list_to_binary("timeline-" ++ integer_to_list(Int))).
-define(DEBUG(F... |
3879b6e6e2740a8af013221c63eaefe46109a533cb9609ebb14d0208b302ccf2 | gulige/neuroevo | gstk_editor.erl | %%
%% %CopyrightBegin%
%%
Copyright Ericsson AB 1996 - 2016 . All Rights Reserved .
%%
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 applic... | null | https://raw.githubusercontent.com/gulige/neuroevo/09e67928c2417f2b27ec6522acc82f8b3c844949/apps/gs/src/gstk_editor.erl | erlang |
%CopyrightBegin%
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 l... | Copyright Ericsson AB 1996 - 2016 . All Rights Reserved .
Licensed under the Apache License , Version 2.0 ( the " License " ) ;
distributed under the License is distributed on an " AS IS " BASIS ,
-module(gstk_editor).
-compile([{nowarn_deprecated_function,{gs,assq,2}},
{nowarn_deprecated_function,{gs... |
1d8e73e199721e84806792f2c5bf1e81b5d5f1ace9d73f1eb9d224e729df554b | pallet/pallet | converge_test.clj | (ns pallet.task.converge-test
(:require
[clojure.test :refer :all]
[pallet.api :refer [group-spec lift]]
[pallet.task.converge :refer :all]
[pallet.test-utils :refer :all]))
(def a (group-spec "a"))
(def b (group-spec "b"))
(with-private-vars [pallet.task.converge [build-args]]
(deftest build-args-tes... | null | https://raw.githubusercontent.com/pallet/pallet/30226008d243c1072dcfa1f27150173d6d71c36d/test/pallet/task/converge_test.clj | clojure | (ns pallet.task.converge-test
(:require
[clojure.test :refer :all]
[pallet.api :refer [group-spec lift]]
[pallet.task.converge :refer :all]
[pallet.test-utils :refer :all]))
(def a (group-spec "a"))
(def b (group-spec "b"))
(with-private-vars [pallet.task.converge [build-args]]
(deftest build-args-tes... | |
b8465fdd8b02d9a81dab2a13286e7f7905c50ec566a4dda65c6f3d06087fd13b | sicmutils/sicmutils | deps.cljs | ;; These dependencies are required for the cljs build of the library. They are
;; also included as cljsjs dependencies in the build... I THINK the cljsjs
;; versions only matter for the externs they provide, but my confusion is on
;; full display here so please file an issue if you run into trouble.
{:npm-deps
{"compl... | null | https://raw.githubusercontent.com/sicmutils/sicmutils/77c64da79dd86fe490d9171585258a6a923655d5/src/deps.cljs | clojure | These dependencies are required for the cljs build of the library. They are
also included as cljsjs dependencies in the build... I THINK the cljsjs
versions only matter for the externs they provide, but my confusion is on
full display here so please file an issue if you run into trouble. | {:npm-deps
{"complex.js" "^2.0.11"
"fraction.js" "^4.0.12"
"odex" "^2.0.4"}}
|
2599da48f8ccec2f56d21ec9d9198f69e59265653edee85ec137f8c4eb2707c9 | uw-unsat/serval | xchg.rkt | #lang rosette
(require
"common.rkt")
(provide
xchg-r/m32-r32
xchg-r/m64-r64)
(define (interpret-xchg cpu dst src)
(define mm (cpu-memmgr cpu))
(when mm
(core:memmgr-atomic-begin mm))
(define temp (cpu-gpr-ref cpu dst))
(cpu-gpr-set! cpu dst (cpu-gpr-ref cpu src))
(cpu-gpr-set! cpu src temp)
(w... | null | https://raw.githubusercontent.com/uw-unsat/serval/be11ecccf03f81b8bd0557acf8385a6a5d4f51ed/serval/x86/interp/xchg.rkt | racket | REX.W + 87 /r | #lang rosette
(require
"common.rkt")
(provide
xchg-r/m32-r32
xchg-r/m64-r64)
(define (interpret-xchg cpu dst src)
(define mm (cpu-memmgr cpu))
(when mm
(core:memmgr-atomic-begin mm))
(define temp (cpu-gpr-ref cpu dst))
(cpu-gpr-set! cpu dst (cpu-gpr-ref cpu src))
(cpu-gpr-set! cpu src temp)
(w... |
2fdb53ca8f98b1271adb53d40b60f512e994a7ab79877ef6c6378a57b021b94c | rowangithub/DOrder | cav2014.ml | let rec loop i (j:int) k p n =
if i < n then
if (i >= p ) then loop (i+1) k k p n
else loop (i+1) j k p n
else j
let main p n =
let i = 0 in
let j = 0 in
let k = 3 in
let res = loop i j k p n in
if (p > 0 && n > p) then
assert (res = k)
else ()
let _ = main (-1) (-3) | null | https://raw.githubusercontent.com/rowangithub/DOrder/e0d5efeb8853d2a51cc4796d7db0f8be3185d7df/tests/icfp/cav2014.ml | ocaml | let rec loop i (j:int) k p n =
if i < n then
if (i >= p ) then loop (i+1) k k p n
else loop (i+1) j k p n
else j
let main p n =
let i = 0 in
let j = 0 in
let k = 3 in
let res = loop i j k p n in
if (p > 0 && n > p) then
assert (res = k)
else ()
let _ = main (-1) (-3) | |
13c3da4134f5dd66baa6498a92bfc7721f08f8dd08ef26f8439333f9dbe77a9b | facebookincubator/hsthrift | AsyncTest.hs | Copyright ( c ) Facebook , Inc. and its affiliates .
# LANGUAGE CPP #
{-# LANGUAGE OverloadedStrings #-}
# OPTIONS_GHC -fno - warn - type - defaults #
module AsyncTest (main) where
import Data.Monoid
import Test.HUnit
import TestRunner
import Util.Async
windowUnorderedReduceTest :: Test
windowUnorderedReduceTest... | null | https://raw.githubusercontent.com/facebookincubator/hsthrift/d3ff75d487e9d0c2904d18327373b603456e7a01/common/util/tests/AsyncTest.hs | haskell | # LANGUAGE OverloadedStrings # | Copyright ( c ) Facebook , Inc. and its affiliates .
# LANGUAGE CPP #
# OPTIONS_GHC -fno - warn - type - defaults #
module AsyncTest (main) where
import Data.Monoid
import Test.HUnit
import TestRunner
import Util.Async
windowUnorderedReduceTest :: Test
windowUnorderedReduceTest = TestLabel "windowUnorderedReduce... |
3b9b79d0ec7afbbc08c6864ecdfbcd37784a933e87ae111c576215121da2ff5b | martinslota/protocell | text_format.mli | open Base
type t
type sort
val show_sort : sort -> string
type id = string
type serialization_error = Field_value.validation_error
val show_serialization_error : serialization_error -> string
type parse_error =
[ `Unexpected_character of char
| `Invalid_number_string of string
| `Identifier_expected
| `N... | null | https://raw.githubusercontent.com/martinslota/protocell/62545c7fb63ff76c95449ba015e40e0c3e0d94a5/src/runtime/text_format.mli | ocaml | open Base
type t
type sort
val show_sort : sort -> string
type id = string
type serialization_error = Field_value.validation_error
val show_serialization_error : serialization_error -> string
type parse_error =
[ `Unexpected_character of char
| `Invalid_number_string of string
| `Identifier_expected
| `N... | |
49a20fd5e9e95cb851c3026c31e58a013c3576cc09609200ef3303de1d13659a | thattommyhall/offline-4clojure | p91.clj | ;; Graph Connectivity - Hard
Given a graph , determine whether the graph is connected . A connected graph is such that a path exists between any two given nodes.<br/><br/>-Your function must return true if the graph is connected and false otherwise.<br/><br/>-You will be given a set of tuples representing the edges o... | null | https://raw.githubusercontent.com/thattommyhall/offline-4clojure/73e32fc6687816aea3c514767cef3916176589ab/src/offline_4clojure/p91.clj | clojure | Graph Connectivity - Hard
tags - graph-theory
restricted -
your solution here | Given a graph , determine whether the graph is connected . A connected graph is such that a path exists between any two given nodes.<br/><br/>-Your function must return true if the graph is connected and false otherwise.<br/><br/>-You will be given a set of tuples representing the edges of a graph . Each member of a ... |
86fe04aefe52ed3e1bfe6c57c68ac480435c5f897e8a95ad567c7ba80f623253 | damn/engine | input.clj | (ns engine.input
(:require [engine.graphics :refer (mouse-coords)])
(:import [com.badlogic.gdx Gdx Input Input$Buttons Input$Keys]))
- position / coords ( move to graphics ? )
(mouse-coords))
(defn- to-mouse-key [k]
(case k
:left Input$Buttons/LEFT
:right Input$Buttons/RIGHT))
(defn- is-mouse-... | null | https://raw.githubusercontent.com/damn/engine/3fff91e6f6610272b5d3a6f0ada6d89adb218397/src/engine/input.clj | clojure | when using is-...-pressed? it is probably useful also to check if is-...-consumed?
for example a bug occured:
waypoints menu opens with try-consume-..-pressed while is-...-pressed? closed it again in the same frame
TODO maybe is-...-pressed? always checks if not consumed yet (so it is really 'consumed')
TODO inste... | (ns engine.input
(:require [engine.graphics :refer (mouse-coords)])
(:import [com.badlogic.gdx Gdx Input Input$Buttons Input$Keys]))
- position / coords ( move to graphics ? )
(mouse-coords))
(defn- to-mouse-key [k]
(case k
:left Input$Buttons/LEFT
:right Input$Buttons/RIGHT))
(defn- is-mouse-... |
d94412bb658d6123c01306a868ead711a76b1562399327f3ec9fba70aa2ccea4 | jayrbolton/coursework | memo_change.hs | memoized coin change problem by
-- where
change ( 0,n ) = 0
-- change (c,n)
-- | v!!n <= c = min (mem_change c (n-1)) (1 + mem_change (c-(v!!n)) n)
-- | v!!n > c = mem_change c (n-1)
GetChange(0 , n ) = 0 \\
GetChange(C , n ) = min(GetChange(C , n-1 ) , 1 + GetChange(C - n , n ) ) \ \ \ \ \ & \text { ... | null | https://raw.githubusercontent.com/jayrbolton/coursework/f0da276527d42a6751fb8d29c76de35ce358fe65/student_originated_software/analysis/final/memo_change.hs | haskell | where
change (c,n)
| v!!n <= c = min (mem_change c (n-1)) (1 + mem_change (c-(v!!n)) n)
| v!!n > c = mem_change c (n-1)
GetChange(C, n) = GetChange(C, n-1) \ \ \ \ \ & \text{ if $v(n) > C$}\\
Generate our memoization matrix. There's probably a prettier way to do it. | memoized coin change problem by
change ( 0,n ) = 0
GetChange(0 , n ) = 0 \\
GetChange(C , n ) = min(GetChange(C , n-1 ) , 1 + GetChange(C - n , n ) ) \ \ \ \ \ & \text { if $ v(n ) \leq C$ } \\
vs = [1,5,10,25,100,200]
matrix c v = map (\(n,cs) -> (map (\c -> (n,c)) cs)) (zip [1..n] (replicate n [c,c-1..1])... |
5fe31431a6efa20bfefa638fac08ddd35427f1acf9e94e3cfd18b27cb6110085 | tmfg/mmtis-national-access-point | localization_test.clj | (ns ote.localization-test
(:require [clojure.test :as t :refer [deftest is]]
[ote.localization :as localization]
[clojure.set :as set]
[clojure.java.io :as io]))
(def languages ["fi" "sv" "en"])
(defn- deep-key-paths [prefix-path m]
(reduce-kv (fn [key-paths key val]
if is m... | null | https://raw.githubusercontent.com/tmfg/mmtis-national-access-point/a86cc890ffa1fe4f773083be5d2556e87a93d975/ote/test/clj/ote/localization_test.clj | clojure | TODO: Needs cljs testing support for more thorough testing of this feature. | (ns ote.localization-test
(:require [clojure.test :as t :refer [deftest is]]
[ote.localization :as localization]
[clojure.set :as set]
[clojure.java.io :as io]))
(def languages ["fi" "sv" "en"])
(defn- deep-key-paths [prefix-path m]
(reduce-kv (fn [key-paths key val]
if is m... |
b8341cd252052eb595689443e45866d4f2acb6446db2f401ed5751a75618a419 | diagrams/diagrams-builder | diagrams-builder-ps.hs | {-# LANGUAGE DeriveDataTypeable #-}
# LANGUAGE RecordWildCards #
module Main where
import System.Directory (copyFile,
createDirectoryIfMissing)
import qualified System.FilePath as FP
import System.Console.CmdArgs
import ... | null | https://raw.githubusercontent.com/diagrams/diagrams-builder/fa73414a1de8e9d8ba1117aa5ae023633859c0db/src/tools/diagrams-builder-ps.hs | haskell | # LANGUAGE DeriveDataTypeable # | # LANGUAGE RecordWildCards #
module Main where
import System.Directory (copyFile,
createDirectoryIfMissing)
import qualified System.FilePath as FP
import System.Console.CmdArgs
import Diagrams.Backend.Postscript
i... |
05aaa4734b3abb4bda5c9e363d9fa55db17ef943b70232b55281bc50a6866b4a | heroku/logplex | logplex_tlssyslog_drain.erl | %%%-------------------------------------------------------------------
Geoff Ca nt
@author nt < >
%% @version {@vsn}, {@date} {@time}
@doc Syslog / TLS drain
%% See #section-4.1
%% -lear-ietf-syslog-uri-00
%% @end
%%%-------------------------------------------------------------------
-module(logplex_tlssyslo... | null | https://raw.githubusercontent.com/heroku/logplex/fc520c44cf4687726d5d51464d3264ddc6abb0ba/src/logplex_tlssyslog_drain.erl | erlang | -------------------------------------------------------------------
@version {@vsn}, {@date} {@time}
See #section-4.1
-lear-ietf-syslog-uri-00
@end
-------------------------------------------------------------------
------------------------------------------------------------------
API Function Exports
---------... | Geoff Ca nt
@author nt < >
@doc Syslog / TLS drain
-module(logplex_tlssyslog_drain).
-behaviour(gen_fsm).
-define(SERVER, ?MODULE).
-define(RECONNECT_MSG, reconnect).
-define(TARGET_SEND_SIZE, 4096).
-define(SEND_TIMEOUT_MSG, send_timeout).
-define(SEND_TIMEOUT, timer:seconds(4)).
-define(HIBERNATE_TIMEOUT,... |
4cdd4d46751822500afecfb766831ebc999c1c9094d82ed8519929e34efcd5e8 | slipstream/SlipStreamServer | metering.clj | (ns sixsq.slipstream.metering.metering
"Core functions that copy a set of resource documents into 'metering'
documents."
(:require
[clj-time.core :as time]
[clojure.core.async :as async]
[clojure.string :as str]
[clojure.tools.logging :as log]
[qbits.spandex :as spandex]
[sixsq.slipstream... | null | https://raw.githubusercontent.com/slipstream/SlipStreamServer/3ee5c516877699746c61c48fc72779fe3d4e4652/metering/src/sixsq/slipstream/metering/metering.clj | clojure | (ns sixsq.slipstream.metering.metering
"Core functions that copy a set of resource documents into 'metering'
documents."
(:require
[clj-time.core :as time]
[clojure.core.async :as async]
[clojure.string :as str]
[clojure.tools.logging :as log]
[qbits.spandex :as spandex]
[sixsq.slipstream... | |
4ec4df4713dbb0cd3f9d2d58d656f52249e0c8548ab226a5aaf4c0f4c27d9d52 | coccinelle/coccinelle | bytearray.mli | (***************************************************************************)
Copyright 1999 - 2010 ,
(* *)
(* This library is free software: you can redistribute it and/or modify *)
(* it under the terms... | null | https://raw.githubusercontent.com/coccinelle/coccinelle/c0452be88e2670e82d8f69a345ae1f3dbabe048a/bundles/parmap/parmap/src/bytearray.mli | ocaml | *************************************************************************
This library is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
License, or (at your o... | Copyright 1999 - 2010 ,
published by the Free Software Foundation , either version 2 of the
exception to the GNU Lesser General Public License applies to this
type t =
(char, Bigarray.int8_unsigned_elt, Bigarray.c_layout) Bigarray.Array1.t
type tf =
(float, ... |
fd420315c990265936d6a93f21c2cd4bd320dad08d5af32a13334f8866e45b7b | caiorss/Functional-Programming | HighestClose.hs |
import qualified Data.ByteString.Lazy.Char8 as L
closing = readPrice . (!!4) . L.split ','
readPrice :: L.ByteString -> Maybe Int
readPrice str =
case L.readInt str of
Nothing -> Nothing
Just (dollars,rest) ->
case L.readInt (L.tail rest) of
Nothing -> Nothing
... | null | https://raw.githubusercontent.com/caiorss/Functional-Programming/ef3526898e3014e9c99bf495033ff36a4530503d/haskell/rwh/ch08/HighestClose.hs | haskell |
import qualified Data.ByteString.Lazy.Char8 as L
closing = readPrice . (!!4) . L.split ','
readPrice :: L.ByteString -> Maybe Int
readPrice str =
case L.readInt str of
Nothing -> Nothing
Just (dollars,rest) ->
case L.readInt (L.tail rest) of
Nothing -> Nothing
... | |
9ca20808b24c7df202a80e4ae77656fa3b3b02b9d8cfa0a9f7d6e971f6b2f27c | mirage/ocaml-fsevents | bindings.ml |
* Copyright ( c ) 2015 < >
* Copyright ( c ) 2014 < >
*
* Permission to use , copy , modify , and distribute this software for any
* purpose with or without fee is hereby granted , provided that the above
* copyright notice and this permission notice appear in all copies .
*
* THE SOFTWARE... | null | https://raw.githubusercontent.com/mirage/ocaml-fsevents/5c6abdcc20ce284d88003ce3300e637f7514e5e7/lib_gen/bindings.ml | ocaml | typedef struct __FSEventStream* FSEventStreamRef;
extern FSEventStreamEventId FSEventStreamGetLatestEventId(
ConstFSEventStreamRef streamRef
);
extern void FSEventStreamFlushSync(
FSEventStreamRef streamRef
);
extern void FSEventStreamStop(
FSEventStreamRef streamRef
);
exte... |
* Copyright ( c ) 2015 < >
* Copyright ( c ) 2014 < >
*
* Permission to use , copy , modify , and distribute this software for any
* purpose with or without fee is hereby granted , provided that the above
* copyright notice and this permission notice appear in all copies .
*
* THE SOFTWARE... |
c28cb2c26d5d15f42e16f360b60cfa91914c6d6a476b6536ddbd485d8935e2e1 | csabahruska/jhc-components | DataConstructors.hs | Generated by DrIFT ( Automatic class derivations for )
# LINE 1 " src / DataConstructors.hs " #
{-# LANGUAGE OverloadedStrings #-}
module DataConstructors(
AliasType(..),
boxPrimitive,
collectDeriving,
conSlots,
constructionExpression,
Constructor(..),
DataFamily(..),
DataTable(..),
... | null | https://raw.githubusercontent.com/csabahruska/jhc-components/a7dace481d017f5a83fbfc062bdd2d099133adf1/jhc-core/src/DataConstructors.hs | haskell | # LANGUAGE OverloadedStrings #
[ tVr n (kind k) | n <- [2,4..] | k <- xs ]
return $ tVr v (kind $ tyvarKind tv)
! derive: Binary !
these apply to types
abstract internal type, has children of representation unknown and irrelevant.
children don't apply. data constructor for instance
primitive type, children are all... | Generated by DrIFT ( Automatic class derivations for )
# LINE 1 " src / DataConstructors.hs " #
module DataConstructors(
AliasType(..),
boxPrimitive,
collectDeriving,
conSlots,
constructionExpression,
Constructor(..),
DataFamily(..),
DataTable(..),
DataTableMonad(..),
dataTabl... |
94d99a2755633fa7d9da70cb1a9bd2c6921c8bad300f9d2947668246b9efd70f | rabbitmq/rabbitmq-prometheus | rabbit_prometheus_handler.erl | 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 ) 2007 - 2020 VMware , Inc. or its affiliates . All rights reserved .
%%
-module(rabbit_prometheus_handler).
-export([init... | null | https://raw.githubusercontent.com/rabbitmq/rabbitmq-prometheus/8a700b69d3c10b80a898eb92b5834a5a052af0a5/src/rabbit_prometheus_handler.erl | erlang |
===================================================================
Cowboy Handler Callbacks
===================================================================
===================================================================
Private functions
=================================================================... | 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 ) 2007 - 2020 VMware , Inc. or its affiliates . All rights reserved .
-module(rabbit_prometheus_handler).
-export([init/2]).
... |
daf81ab08df5f682cd85a27bfa18df416a950b8d8d159fdd0b934ea1024b02e4 | rmloveland/scheme48-0.53 | package-defs.scm | Copyright ( c ) 1993 - 1999 by . See file COPYING .
; The intermediate language (node tree)
The structures VARIABLE and PRIMOP are contained in NODE . They are used
; in client language code where the NODE- names conflict.
(define-structures ((node node-interface)
(variable variable-interface)
... | null | https://raw.githubusercontent.com/rmloveland/scheme48-0.53/1ae4531fac7150bd2af42d124da9b50dd1b89ec1/ps-compiler/package-defs.scm | scheme | The intermediate language (node tree)
in client language code where the NODE- names conflict.
variable and node data structures
various small utilities
node equality
(define node
(let ()
(define-structure let-nodes (export expand-let-nodes)
(open scheme big-scheme arch)
(files (node let-nodes)))
... | Copyright ( c ) 1993 - 1999 by . See file COPYING .
The structures VARIABLE and PRIMOP are contained in NODE . They are used
(define-structures ((node node-interface)
(variable variable-interface)
(primop primop-interface))
(open scheme big-scheme comp-util arch parameters
defrecord)
... |
86e8de93ba6ed9bef2b4915c9041d68286938f6b8199b6d7027720ea912313a9 | janestreet/sexp_grammar | test_regression.ml | open! Core
open! Expect_test_helpers_base
module Traverse = Sexp_grammar.Fold_recursive (struct
type t = depth:int -> unit
type list_t = (depth:int -> unit) list
let atomic ~depth:_ = ()
let compound ts ~depth = List.iter ts ~f:(fun t -> t ~depth)
let any (_ : string) = atomic
let bool = atomi... | null | https://raw.githubusercontent.com/janestreet/sexp_grammar/85812f8e8288836cd0c75597090495aad750c67c/test/test_regression.ml | ocaml | Grammar validation should not fail when a type variable appears inside
the body type expression of a recursion expression, e.g.,
... (Recursive (Tycon r ((Tyvar a))) ...) ...
Grammar validation should not fail when an earlier-defined type constructor
appears inside the body type expression of a recursion ex... | open! Core
open! Expect_test_helpers_base
module Traverse = Sexp_grammar.Fold_recursive (struct
type t = depth:int -> unit
type list_t = (depth:int -> unit) list
let atomic ~depth:_ = ()
let compound ts ~depth = List.iter ts ~f:(fun t -> t ~depth)
let any (_ : string) = atomic
let bool = atomi... |
5625cf51407729d81e60ac137131d3d51b6f4350754280dae50a4b1687ccac6b | schell/odin | Pane.hs | {-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE LambdaCase #-}
# LANGUAGE MultiParamTypeClasses #
{-# LANGUAGE PatternSynonyms #-}
{-# LANGUAGE ScopedTypeVariables #-}
# LANGUAGE TupleSections #
module Odin.Engine.New.UI.Pane
( pane
, PaneCfg (..)
) where
import Control.... | null | https://raw.githubusercontent.com/schell/odin/97ae1610a7abd19aa150bc7dfc132082d88ca9ea/odin-engine/src/Odin/Engine/New/UI/Pane.hs | haskell | # LANGUAGE FlexibleContexts #
# LANGUAGE LambdaCase #
# LANGUAGE PatternSynonyms #
# LANGUAGE ScopedTypeVariables #
| The minimum (but negative) offset the content should move in each dimension
of a window pane.
| The suggested size of the horizontal and vertical scroll bars.
| The maximum d... | # LANGUAGE MultiParamTypeClasses #
# LANGUAGE TupleSections #
module Odin.Engine.New.UI.Pane
( pane
, PaneCfg (..)
) where
import Control.Monad (msum, guard)
import Control.Monad.Trans (lift)
import Data.Word (Word64)
import ... |
08e64c95706d6cc89af8e8f8a0e9b23e8113af5403d624c0be976f176c564e70 | softwarelanguageslab/maf | R5RS_WeiChenRompf2019_fermat-3.scm | ; Changes:
* removed : 1
* added : 0
* swaps : 0
; * negated predicates: 0
* swapped branches : 2
* calls to i d fun : 3
(letrec ((square (lambda (x)
(* x x)))
(modulo-power (lambda (base exp n)
(if (= exp 0)
1
... | null | https://raw.githubusercontent.com/softwarelanguageslab/maf/11acedf56b9bf0c8e55ddb6aea754b6766d8bb40/test/changes/scheme/generated/R5RS_WeiChenRompf2019_fermat-3.scm | scheme | Changes:
* negated predicates: 0 | * removed : 1
* added : 0
* swaps : 0
* swapped branches : 2
* calls to i d fun : 3
(letrec ((square (lambda (x)
(* x x)))
(modulo-power (lambda (base exp n)
(if (= exp 0)
1
(if (odd? exp)
... |
114f7f5176a10e8468a25a37fdbbb006eb3c5e2f26d7fb5bd90568caae4484f9 | swannodette/mies-om | core.cljs | (ns {{name}}.core
(:require [om.core :as om]
[om.dom :as dom]))
(enable-console-print!)
(def app-state (atom {:text "Hello world!"}))
(om/root
(fn [app owner]
(reify om/IRender
(render [_]
(dom/h1 nil (:text app)))))
app-state
{:target (. js/document (getElementById "app"))})
| null | https://raw.githubusercontent.com/swannodette/mies-om/4a9fde582b083f59dcb59761391a8a66713a8380/src/leiningen/new/mies_om/core.cljs | clojure | (ns {{name}}.core
(:require [om.core :as om]
[om.dom :as dom]))
(enable-console-print!)
(def app-state (atom {:text "Hello world!"}))
(om/root
(fn [app owner]
(reify om/IRender
(render [_]
(dom/h1 nil (:text app)))))
app-state
{:target (. js/document (getElementById "app"))})
| |
c59697f5731613a086ec19a2f5bc55cae37233207b67f0f59f8f1bb219d95202 | CryptoKami/cryptokami-core | Event.hs | # LANGUAGE TypeFamilies #
module Test.Pos.Block.Logic.Event
(
-- * Running events and scenarios
runBlockEvent
, runBlockScenario
, BlockScenarioResult(..)
-- * Exceptions
, SnapshotMissingEx(..)
, DbNotEquivalentToSnapshot(..)
) where
import ... | null | https://raw.githubusercontent.com/CryptoKami/cryptokami-core/12ca60a9ad167b6327397b3b2f928c19436ae114/generator/src/Test/Pos/Block/Logic/Event.hs | haskell | * Running events and scenarios
* Exceptions
| Execute a single block event.
| Execute a snapshot operation.
| Execute a block scenario: a sequence of block events that either ends with
an expected failure or with a rollback to the initial state. | # LANGUAGE TypeFamilies #
module Test.Pos.Block.Logic.Event
(
runBlockEvent
, runBlockScenario
, BlockScenarioResult(..)
, SnapshotMissingEx(..)
, DbNotEquivalentToSnapshot(..)
) where
import Universum
import Control.Exception.Safe (fromExceptio... |
cdf68b3f13ee7d8496b36a532d572b61441cea05ceeee9d5be641c69ab74ae4d | bos/stanford-cs240h | St.hs | import Control.Monad.ST
import Data.STRef
whee :: Int -> ST s Int
whee z = do
r <- newSTRef z
modifySTRef r (+1)
readSTRef r
| null | https://raw.githubusercontent.com/bos/stanford-cs240h/ef304e15ae74bb13bdcbb432b18519b9b24a1a14/notes/l7/St.hs | haskell | import Control.Monad.ST
import Data.STRef
whee :: Int -> ST s Int
whee z = do
r <- newSTRef z
modifySTRef r (+1)
readSTRef r
| |
a94284f0c442701727a3a7a502a87e1967306135781f833b82a16e075a51e055 | johnlawrenceaspden/hobby-code | deterministicrandom.clj | There should be 64 bits in a random long . Each random number in 0 .. 7 is three bits
So we can get 21 random numbers in 0 .. 7 out of a random long , with a bit left
(def doom (java.util.Random. 0)) ;-> #'user/doom
(unpack (repeat 21 8) (.nextLong doom)) ;-> (0 7 4 0 5 2 6 6 4 2 7 7 5 0 5 5 0 4 4 5 3)
;; Attempts... | null | https://raw.githubusercontent.com/johnlawrenceaspden/hobby-code/48e2a89d28557994c72299962cd8e3ace6a75b2d/deterministicrandom.clj | clojure | -> #'user/doom
-> (0 7 4 0 5 2 6 6 4 2 7 7 5 0 5 5 0 4 4 5 3)
Attempts to get more are somewhat unsuccessful
-> (0 3 5 7 0 4 6 4 3 7 3 7 2 6 4 4 6 3 0 6 7 7 7)
-> (1 6 3 0 5 1 3 0 5 5 0 1 7 1 5 5 5 6 3 0 7 7 7) | There should be 64 bits in a random long . Each random number in 0 .. 7 is three bits
So we can get 21 random numbers in 0 .. 7 out of a random long , with a bit left
- > ( 6 7 2 0 7 2 6 1 3 3 6 4 7 6 2 6 3 2 6 6 3 0 )
- > ( 2 7 0 0 7 3 7 0 7 1 1 3 7 3 2 6 5 5 4 1 2 7 7 )
- > ( 3 0 4 2 2 0 5 7 5 3 4 3 3 1 4 3 1 5 ... |
5c6f7d4467ffc7697feeb94fc96e8e2ed849c9a24ff34a0f138be98d6ef56515 | thephoeron/quipper-language | Circuit.hs | This file is part of Quipper . Copyright ( C ) 2011 - 2014 . Please see the
-- file COPYRIGHT for a list of authors, copyright holders, licensing,
-- and other details. All rights reserved.
--
-- ======================================================================
{-# LANGUAGE BangPatterns #-}
# LANGUAGE Existent... | null | https://raw.githubusercontent.com/thephoeron/quipper-language/15e555343a15c07b9aa97aced1ada22414f04af6/quipper/Quipper/Circuit.hs | haskell | file COPYRIGHT for a list of authors, copyright holders, licensing,
and other details. All rights reserved.
======================================================================
# LANGUAGE BangPatterns #
# LANGUAGE DeriveDataTypeable #
| Low-level quantum circuit implementation. This is our backend
implementati... | This file is part of Quipper . Copyright ( C ) 2011 - 2014 . Please see the
# LANGUAGE ExistentialQuantification #
module Quipper.Circuit where
import other Quipper stuff
import Libraries.Auxiliary
import Data.List
import Data.Maybe
import Data.Set (Set)
import qualified Data.Set as Set
import Data.Map (Map)... |
d4e7732c0813b3231c48cc4e0c50ba754e0dc3cab3438321e4a426e681a57b75 | softlab-ntua/bencherl | class_ResultProducer.erl | Copyright ( C ) 2010 - 2014 EDF R&D
This file is part of Sim - Diasca .
Sim - Diasca 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 ) a... | null | https://raw.githubusercontent.com/softlab-ntua/bencherl/317bdbf348def0b2f9ed32cb6621e21083b7e0ca/app/sim-diasca/sim-diasca/src/core/src/data-management/result-management/class_ResultProducer.erl | erlang | it under the terms of the GNU Lesser General Public License as
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
If not, see </>.
Base class for all result producers.
It allows them to be declared automatically to the result manager, and
... | Copyright ( C ) 2010 - 2014 EDF R&D
This file is part of Sim - Diasca .
Sim - Diasca is free software : you can redistribute it and/or modify
published by the Free Software Foundation , either version 3 of
the License , or ( at your option ) any later version .
Sim - Diasca is distributed in the hope tha... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.