_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 |
|---|---|---|---|---|---|---|---|---|
58ff152546ee031c42dd291394e18df95fc4dfbdcb7fbc951b7bd05765e5fa8e | jimcrayne/jhc | T5573a.hs | # LANGUAGE MagicHash , UnboxedTuples , BangPatterns #
module T5573a where
import GHC.Exts
-- This is ok
foo1 x = (# x,x #)
bar y = let (# x, _ #) = foo1 y in x
-- Nested unboxed tuple not ok
foo2 x = (# x, (# True, False #) #)
tuple argument not ok
foo3 (# x,y #) = x
| null | https://raw.githubusercontent.com/jimcrayne/jhc/1ff035af3d697f9175f8761c8d08edbffde03b4e/regress/tests/1_typecheck/4_fail/ghc/T5573a.hs | haskell | This is ok
Nested unboxed tuple not ok | # LANGUAGE MagicHash , UnboxedTuples , BangPatterns #
module T5573a where
import GHC.Exts
foo1 x = (# x,x #)
bar y = let (# x, _ #) = foo1 y in x
foo2 x = (# x, (# True, False #) #)
tuple argument not ok
foo3 (# x,y #) = x
|
2ad13168e5c293933a1303f2f550227e6744b930c165db6c1112922ca9426aaa | theobat/massalia | Organization.hs | # LANGUAGE AllowAmbiguousTypes #
{-# LANGUAGE DeriveAnyClass #-}
{-# LANGUAGE DeriveDataTypeable #-}
# LANGUAGE DeriveGeneric #
# LANGUAGE FlexibleInstances #
{-# LANGUAGE OverloadedStrings #-}
# LANGUAGE StandaloneDeriving #
# LANGUAGE TypeFamilies #
# LANGUAGE TypeOperators #
module MassaliaSchema.Industry.Organizat... | null | https://raw.githubusercontent.com/theobat/massalia/66d65c3431132091107d07e041f33c907f9d08cb/dataseed/MassaliaSchema/Industry/Organization.hs | haskell | # LANGUAGE DeriveAnyClass #
# LANGUAGE DeriveDataTypeable #
# LANGUAGE OverloadedStrings # | # LANGUAGE AllowAmbiguousTypes #
# LANGUAGE DeriveGeneric #
# LANGUAGE FlexibleInstances #
# LANGUAGE StandaloneDeriving #
# LANGUAGE TypeFamilies #
# LANGUAGE TypeOperators #
module MassaliaSchema.Industry.Organization
( Organization (..),
)
where
import Data.Data (Data)
import Data.Text (Text)
import Data.UUID ... |
0f58d1a810dfb3de1aefd901e127b2926b8d52664faf739aacc80a0174fd6d73 | qfpl/reflex-tutorial | RecursiveDo.hs | {-# LANGUAGE OverloadedStrings #-}
# LANGUAGE ScopedTypeVariables #
{-# LANGUAGE GADTs #-}
# LANGUAGE RecursiveDo #
module Posts.RecursiveDo (
recursiveDoPostExamples
) where
import Data.Maybe (fromMaybe)
import Control.Monad.Fix (MonadFix)
import Reflex.Dom.Core
import GHCJS.DOM.Types (MonadJSM)
import Util.... | null | https://raw.githubusercontent.com/qfpl/reflex-tutorial/07c1e6fab387cbeedd031630ba6a5cd946cc612e/code/basics/src/Posts/RecursiveDo.hs | haskell | # LANGUAGE OverloadedStrings #
# LANGUAGE GADTs # | # LANGUAGE ScopedTypeVariables #
# LANGUAGE RecursiveDo #
module Posts.RecursiveDo (
recursiveDoPostExamples
) where
import Data.Maybe (fromMaybe)
import Control.Monad.Fix (MonadFix)
import Reflex.Dom.Core
import GHCJS.DOM.Types (MonadJSM)
import Util.Attach
import qualified Util.Bootstrap as B
recursiveDoPo... |
a1c034dca5a77c636be557ab30057764b5ad43f073384f4793acc333252d104c | dgiot/dgiot | emqx_request_responser_SUITE.erl | Copyright ( c ) 2013 - 2022 EMQ Technologies Co. , Ltd. 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 applicable law... | null | https://raw.githubusercontent.com/dgiot/dgiot/c601555e45f38d02aafc308b18a9e28c543b6f2c/test/emqx_request_responser_SUITE.erl | erlang |
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
-2.0
Unless required by applicable law or agreed to in writing, software
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing perm... | Copyright ( c ) 2013 - 2022 EMQ Technologies Co. , Ltd. 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(emqx_request_responser_SUITE).
-compile(export_all).
-compile(nowarn_export_all).
-inc... |
e179056e6a703fa95476c71c0dc724eb345d7cd4a023fdbc0d574ef9658e9ff0 | caradoc-org/caradoc | rc4.mli | (*****************************************************************************)
(* Caradoc: a PDF parser and validator *)
Copyright ( C ) 2016 - 2017
(* *)
(* This program ... | null | https://raw.githubusercontent.com/caradoc-org/caradoc/100f53bc55ef682049e10fabf24869bc019dc6ce/src/crypto/rc4.mli | ocaml | ***************************************************************************
Caradoc: a PDF parser and validator
This program is free software; you can redistribute it and/or modify
... | Copyright ( C ) 2016 - 2017
it under the terms of the GNU General Public License version 2 as
published by the Free Software Foundation .
You should have received a copy of the GNU General Public License along
with this program ; if... |
9d4736a32bf347c239cf58285feca2ca79b547a80fcc2ac309458037be0278f1 | DKurilo/hackerrank | solution.hs | # LANGUAGE OverloadedStrings , UnicodeSyntax #
module Main where
import Prelude.Unicode
import Control.Monad
import qualified Data.ByteString.Char8 as BSC
import qualified Data.IntMap as DM
import qualified Data.List as DL
import Debug.Trace
import System.Environment
import System.IO
find ∷ Int → [Int] → [Int]
find ... | null | https://raw.githubusercontent.com/DKurilo/hackerrank/37063170567b397b25a2b7123bc9c1299d34814a/filter-elements/solution.hs | haskell | # LANGUAGE OverloadedStrings , UnicodeSyntax #
module Main where
import Prelude.Unicode
import Control.Monad
import qualified Data.ByteString.Char8 as BSC
import qualified Data.IntMap as DM
import qualified Data.List as DL
import Debug.Trace
import System.Environment
import System.IO
find ∷ Int → [Int] → [Int]
find ... | |
66a94ff0d30dd910ef7ed2c101e6cfb85ebd489c8ec096f73d300490bdc26227 | rjray/advent-2020-clojure | day02.clj | (ns advent-of-code.day02
(:require [clojure.string :as str]))
(defn- get-lines [input]
(str/split-lines input))
(defn- valid-password [line]
(let [[r ch pw] (str/split line #" ")
[lo hi] (str/split r #"-")
ch (first ch)
pwparts (group-by identity (seq pw))
num (c... | null | https://raw.githubusercontent.com/rjray/advent-2020-clojure/631b36545ae1efdebd11ca3dd4dca032346e8601/src/advent_of_code/day02.clj | clojure | (ns advent-of-code.day02
(:require [clojure.string :as str]))
(defn- get-lines [input]
(str/split-lines input))
(defn- valid-password [line]
(let [[r ch pw] (str/split line #" ")
[lo hi] (str/split r #"-")
ch (first ch)
pwparts (group-by identity (seq pw))
num (c... | |
eec50b594fde44f9afbc2f31253aff241304178ab3298e4d605b6cf641ef204e | gafiatulin/codewars | Josephus1.hs |
module Codewars.G964.Josephus where
josephusSurvivor 1 k = 1
josephusSurvivor n k = ((josephusSurvivor (n-1) k + k - 1) `mod` n ) + 1
| null | https://raw.githubusercontent.com/gafiatulin/codewars/535db608333e854be93ecfc165686a2162264fef/src/5%20kyu/Josephus1.hs | haskell |
module Codewars.G964.Josephus where
josephusSurvivor 1 k = 1
josephusSurvivor n k = ((josephusSurvivor (n-1) k + k - 1) `mod` n ) + 1
| |
3580c1c9efe156b0ecf8b120598e46e4bb9d983ba03d517a6b3cbdd2235f3a40 | flipstone/orville | Identifier.hs | # LANGUAGE GeneralizedNewtypeDeriving #
|
Module : . PostgreSQL.Expr . Name . ColumnName
Copyright : Flipstone Technology Partners 2016 - 2021
License : MIT
Module : Orville.PostgreSQL.Expr.Name.ColumnName
Copyright : Flipstone Technology Partners 2016-2021
License : MIT
-}
module Orville.Postgr... | null | https://raw.githubusercontent.com/flipstone/orville/92f79f9500b421dfec8439d3da184fd3b7f8412d/orville-postgresql-libpq/src/Orville/PostgreSQL/Internal/Expr/Name/Identifier.hs | haskell | # LANGUAGE GeneralizedNewtypeDeriving #
|
Module : . PostgreSQL.Expr . Name . ColumnName
Copyright : Flipstone Technology Partners 2016 - 2021
License : MIT
Module : Orville.PostgreSQL.Expr.Name.ColumnName
Copyright : Flipstone Technology Partners 2016-2021
License : MIT
-}
module Orville.Postgr... | |
2593d441569465ab8d494720919570f0410f3f0e8ff4bb404e656bf3dca71bb4 | jjmrocha/kill-bill | kill_bill_app.erl | %%
Copyright 2013
%%
Licensed under the Apache License , Version 2.0 ( the " License " ) ;
%% you may not use this file except in compliance with the License.
%% You may obtain a copy of the License at
%%
%% -2.0
%%
%% Unless required by applicable law or agreed to in writing, software
distributed under the ... | null | https://raw.githubusercontent.com/jjmrocha/kill-bill/1ba409c39524f2b47ff1338214bc9b4de3f2659e/src/kill_bill_app.erl | erlang |
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
-2.0
Unless required by applicable law or agreed to in writing, software
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing perm... | Copyright 2013
Licensed under the Apache License , Version 2.0 ( the " License " ) ;
distributed under the License is distributed on an " AS IS " BASIS ,
-module(kill_bill_app).
-behaviour(application).
-export([start/2, stop/1]).
start(_Type, _StartArgs) ->
case kill_bill_sup:start_link() of
{ok, Pid} -... |
0079dce5f5509018fa4138b60252934df8a07e7aa34f18b603f3d598abcad431 | robert-strandh/SICL | io.lisp | (cl:in-package #:cleavir-io)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;
;;; Reader programming.
(defparameter *io-readtable* (copy-readtable))
(defun read-model-object (stream char)
(declare (ignore char))
(apply #'make-instance (read-delimited-list #\] stream t)))
(set-macro-character #\[ #'read-... | null | https://raw.githubusercontent.com/robert-strandh/SICL/b6b75ae9e065f659cdc40daaa8acaf1eba9ae98e/Code/Cleavir/Input-output/io.lisp | lisp |
Reader programming.
Class CLONEABLE-MIXIN
This class can be used as a superclass of classes with instances
that need to be serialized. We provide a method on PRINT-OBJECT
specialized to this class that prints an instance in a way that it
can be read back in to create a similar object.
I/O. | (cl:in-package #:cleavir-io)
(defparameter *io-readtable* (copy-readtable))
(defun read-model-object (stream char)
(declare (ignore char))
(apply #'make-instance (read-delimited-list #\] stream t)))
(set-macro-character #\[ #'read-model-object nil *io-readtable*)
(set-syntax-from-char #\] #\) *io-readtable*)
... |
6df4567bdb149ac9c74014ba3fa90835d5977e18dc52d0e22fdf8794f5079062 | craigfe/ppx_effects | scrutinee.ml | exception%effect E : string
let f () = Stdlib.Effect.perform E
let g () = f
(* If the scrutinee is already of the form [f x], where [f] and [x] are both
values, use [f] directly as the effect-raising function. *)
let _ = try f () with [%effect? E, _] -> ""
(* Negative test cases: *)
(* - [f] or [x] is not a valu... | null | https://raw.githubusercontent.com/craigfe/ppx_effects/ea728e6de95838c2c7df380b301b5e88dafa40d7/test/passing/scrutinee.ml | ocaml | If the scrutinee is already of the form [f x], where [f] and [x] are both
values, use [f] directly as the effect-raising function.
Negative test cases:
- [f] or [x] is not a value
- the scrutinee isn't of the form [f x]: | exception%effect E : string
let f () = Stdlib.Effect.perform E
let g () = f
let _ = try f () with [%effect? E, _] -> ""
let _ = try (Fun.id f) () with [%effect? E, _] -> ""
let _ = try f (Fun.id ()) with [%effect? E, _] -> ""
let _ = try g () () with [%effect? E, _] -> ""
let _ =
try
let () = () in
f ()... |
339f6b442bc095d81e27796d5f7a7671433afb9fa2be78bd6d70406ffb8119ff | mbj/stratosphere | BatchTransformInputProperty.hs | module Stratosphere.SageMaker.ModelBiasJobDefinition.BatchTransformInputProperty (
module Exports, BatchTransformInputProperty(..),
mkBatchTransformInputProperty
) where
import qualified Data.Aeson as JSON
import qualified Stratosphere.Prelude as Prelude
import Stratosphere.Property
import {-# SOURC... | null | https://raw.githubusercontent.com/mbj/stratosphere/c70f301715425247efcda29af4f3fcf7ec04aa2f/services/sagemaker/gen/Stratosphere/SageMaker/ModelBiasJobDefinition/BatchTransformInputProperty.hs | haskell | # SOURCE # | module Stratosphere.SageMaker.ModelBiasJobDefinition.BatchTransformInputProperty (
module Exports, BatchTransformInputProperty(..),
mkBatchTransformInputProperty
) where
import qualified Data.Aeson as JSON
import qualified Stratosphere.Prelude as Prelude
import Stratosphere.Property
import Stratosph... |
1108a4948c92bdc73d3876b1b8aec73db15965a0891b08416343f8e968175268 | karamaan/karamaan-opaleye | Values.hs | module Karamaan.Opaleye.Values where
import Prelude hiding (Integer)
import Karamaan.Opaleye.QueryArr (Query)
import Karamaan.Opaleye.TableColspec (col, TableColspec)
import Karamaan.Opaleye.QueryColspec (MWriter(Writer), Writer, runWriter)
import Karamaan.Opaleye.Table (makeTable)
import Data.List (intercalate)
impor... | null | https://raw.githubusercontent.com/karamaan/karamaan-opaleye/2863dc1dba9ea1e810cb0860a9b8de53f50af354/Karamaan/Opaleye/Values.hs | haskell | TODO: What's the correct location for this?
FIXME: any usage of this risks an SQL injection bug.
Need to come up with a principled way of dealing with these.
vv Just using show works currently, but there's no reason
it will for all the types we want to represent, so
consider this function as a "hack for now... | module Karamaan.Opaleye.Values where
import Prelude hiding (Integer)
import Karamaan.Opaleye.QueryArr (Query)
import Karamaan.Opaleye.TableColspec (col, TableColspec)
import Karamaan.Opaleye.QueryColspec (MWriter(Writer), Writer, runWriter)
import Karamaan.Opaleye.Table (makeTable)
import Data.List (intercalate)
impor... |
4e0587423ffe10acd25904f83fb444c131b4261a26c664b4bd524fe6ee7d6e41 | Abbath/Calculator | Requests.hs | # LANGUAGE DeriveGeneric #
# LANGUAGE FlexibleInstances #
{-# LANGUAGE OverloadedStrings #-}
| This module contains data objects which represents requests to Telegram Bot API
module Web.Telegram.API.Bot.Requests
( -- * Types
ChatId (..)
, SendMessageRequest (..)... | null | https://raw.githubusercontent.com/Abbath/Calculator/75985d5a9b4e602bc087462c8046bf2cf692a0e1/telegram-api-0.7.2.0/src/Web/Telegram/API/Bot/Requests.hs | haskell | # LANGUAGE OverloadedStrings #
* Types
* Functions
| This object represents data (image, video, ...) to upload.
| This object represents data (image, video, ...) with mime type to upload.
^ Mime type of the upload.
^ The payload/source to upload.
^ Upload your public key certificate so that the root certificate ... | # LANGUAGE DeriveGeneric #
# LANGUAGE FlexibleInstances #
| This module contains data objects which represents requests to Telegram Bot API
module Web.Telegram.API.Bot.Requests
ChatId (..)
, SendMessageRequest (..)
, ForwardMessageRequest (..)
, Fil... |
534f5e28b0af5523f181c98f688b659300d265b1afe1ab492d4ae82a14eb7beb | arenadotio/blue-http | scheme_host_port.ml | open Core_kernel
exception Unknown_uri_scheme of string [@@deriving sexp_of]
module T = struct
type t =
{ scheme : [ `Http | `Https ]
; host : string
; port : int
}
[@@deriving compare, hash, sexp]
end
include T
module Table = Hashtbl.Make (T)
let to_uri { scheme; host; port } =
let scheme =
... | null | https://raw.githubusercontent.com/arenadotio/blue-http/f0f4ace55a5a25e92c479c45948f5f2905570ed5/src/scheme_host_port.ml | ocaml | open Core_kernel
exception Unknown_uri_scheme of string [@@deriving sexp_of]
module T = struct
type t =
{ scheme : [ `Http | `Https ]
; host : string
; port : int
}
[@@deriving compare, hash, sexp]
end
include T
module Table = Hashtbl.Make (T)
let to_uri { scheme; host; port } =
let scheme =
... | |
5c0706e5b181d143f27bd8ade5e4f7539ce4cc2877452b999c6e65d95d78a665 | metosin/kekkonen | github.clj | (ns example.github.github
(:require [example.github.security :as security]
[org.httpkit.server :as server]
[kekkonen.cqrs :refer :all]
[plumbing.core :as p]
[schema.core :as s]))
;;
Schemas
;;
(s/defschema Repository
"A Repository"
{:id s/Int
:name s/Str
:... | null | https://raw.githubusercontent.com/metosin/kekkonen/5a38c52af34a0eb0f19d87e9f549e93e6d87885f/dev-src/example/github/github.clj | clojure |
testing
Application
| (ns example.github.github
(:require [example.github.security :as security]
[org.httpkit.server :as server]
[kekkonen.cqrs :refer :all]
[plumbing.core :as p]
[schema.core :as s]))
Schemas
(s/defschema Repository
"A Repository"
{:id s/Int
:name s/Str
:allowe... |
561b3251c3e7a4bab81fbb5f9c1f89e631abb9fce0cbcda573e3894fc59d17d5 | well-typed-lightbulbs/ocaml-esp32 | recvfrom_linux.ml | (* TEST
include unix
modules = "recvfrom.ml"
script = "sh ${test_source_directory}/is-linux.sh"
* hasunix
** script
*** bytecode
*** native
*)
open Recvfrom
let () =
let server_path = "ocaml-test-socket-linux" in
ensure_no_file server_path;
at_exit (fun () -> ensure_no_file server_path);
with_bound_socket serv... | null | https://raw.githubusercontent.com/well-typed-lightbulbs/ocaml-esp32/c24fcbfbee0e3aa6bb71c9b467c60c6bac326cc7/testsuite/tests/lib-unix/unix-socket/recvfrom_linux.ml | ocaml | TEST
include unix
modules = "recvfrom.ml"
script = "sh ${test_source_directory}/is-linux.sh"
* hasunix
** script
*** bytecode
*** native
abstract socket | open Recvfrom
let () =
let server_path = "ocaml-test-socket-linux" in
ensure_no_file server_path;
at_exit (fun () -> ensure_no_file server_path);
with_bound_socket server_path (fun server_addr server_socket ->
with_bound_socket "\x00ocaml-abstract-socket" (fun client_addr client_socket ->
test_sender... |
179910c696738f503c4b5a35118446f72eb776b0d12c7e06cf5bc852a574b77a | thepower/tpnode | smartcontract2.erl | -module(smartcontract2).
-callback deploy(Tx :: tx:tx(),
Ledger :: map(),
GasLimit :: integer(),
GetFun :: fun(),
Opaque :: map()) ->
{'ok', NewLedger :: map(), Opaque::map()} | {'error', Reason::term()}.
-callback handle_tx(Tx :: map(),
Ledger :: map(),
GasLi... | null | https://raw.githubusercontent.com/thepower/tpnode/11b8bf67be72b4ceea5a75e387cc33dcd8ec1898/apps/tpnode/src/smartcontract2.erl | erlang | success finish, emit new txs
atom unchanged if no state changed
success finish
atom unchanged if no state changed
error during execution
error during start | -module(smartcontract2).
-callback deploy(Tx :: tx:tx(),
Ledger :: map(),
GasLimit :: integer(),
GetFun :: fun(),
Opaque :: map()) ->
{'ok', NewLedger :: map(), Opaque::map()} | {'error', Reason::term()}.
-callback handle_tx(Tx :: map(),
Ledger :: map(),
GasLi... |
91b59b75d7147950d6ede5198f6a1d005415384cb1f7290197b054f822dfd762 | melisgl/mgl-pax | package.lisp | (mgl-pax:define-package :mgl-pax-test
(:use #:common-lisp #:mgl-pax #:try)
(:export #:test))
| null | https://raw.githubusercontent.com/melisgl/mgl-pax/093d8e49206c53594fbd5c1e0f792b1512cfd552/test/package.lisp | lisp | (mgl-pax:define-package :mgl-pax-test
(:use #:common-lisp #:mgl-pax #:try)
(:export #:test))
| |
230581486e591e257e81d3c822300f5c6fb5d79b1d53eb42a66be7a3278c21ca | mcorbin/tour-of-clojure | filter.clj | (ns tourofclojure.pages.filter
(:require [hiccup.element :refer [link-to]]
[clojure.java.io :as io]
[tourofclojure.pages.util :refer [navigation-block]]))
(def code
(slurp (io/resource "public/pages/code/filter.clj")))
(defn desc
[previous next lang]
(condp = lang
"fr" [:div
... | null | https://raw.githubusercontent.com/mcorbin/tour-of-clojure/57f97b68ca1a8c96904bfb960f515217eeda24a6/src/tourofclojure/pages/filter.clj | clojure | (ns tourofclojure.pages.filter
(:require [hiccup.element :refer [link-to]]
[clojure.java.io :as io]
[tourofclojure.pages.util :refer [navigation-block]]))
(def code
(slurp (io/resource "public/pages/code/filter.clj")))
(defn desc
[previous next lang]
(condp = lang
"fr" [:div
... | |
b5411bea3272ee3846de1cdf04a9318d524d220184e010061edf0abf3d46bd4e | zadean/xqerl | array_subarray_SUITE.erl | -module('array_subarray_SUITE').
-include_lib("common_test/include/ct.hrl").
-export([
all/0,
groups/0,
suite/0
]).
-export([
init_per_suite/1,
init_per_group/2,
end_per_group/2,
end_per_suite/1
]).
-export(['array-subarray-301'/1]).
-export(['array-subarray-302'/1]).
-export(['array-sub... | null | https://raw.githubusercontent.com/zadean/xqerl/1a94833e996435495922346010ce918b4b0717f2/test/array/array_subarray_SUITE.erl | erlang | -module('array_subarray_SUITE').
-include_lib("common_test/include/ct.hrl").
-export([
all/0,
groups/0,
suite/0
]).
-export([
init_per_suite/1,
init_per_group/2,
end_per_group/2,
end_per_suite/1
]).
-export(['array-subarray-301'/1]).
-export(['array-subarray-302'/1]).
-export(['array-sub... | |
3df5d22efb3e3a65dd65222bb4b4f2d09ef5c1a03a88ff2f7046f6440c3649a0 | well-typed/large-records | F090.hs | module Common.FunOfArity.F090 (F) where
import Bench.Types
type F r =
-- 00 .. 09
T 00
-> T 01
-> T 02
-> T 03
-> T 04
-> T 05
-> T 06
-> T 07
-> T 08
-> T 09
10 .. 19
-> T 10
-> T 11
-> T 12
-> T 13
-> T 14
-> T 15
-> T 16
-> T 17
... | null | https://raw.githubusercontent.com/well-typed/large-records/551f265845fbe56346988a6b484dca40ef380609/large-records-benchmarks/bench/typelet/Common/FunOfArity/F090.hs | haskell | 00 .. 09 | module Common.FunOfArity.F090 (F) where
import Bench.Types
type F r =
T 00
-> T 01
-> T 02
-> T 03
-> T 04
-> T 05
-> T 06
-> T 07
-> T 08
-> T 09
10 .. 19
-> T 10
-> T 11
-> T 12
-> T 13
-> T 14
-> T 15
-> T 16
-> T 17
-> T 18
-> T ... |
29ca47eeceb96279aaa958072d4c0e29af60fbd04b6f8827abeac9ddf5d02389 | ucsd-progsys/nate | frx_fillbox.ml | (***********************************************************************)
(* *)
MLTk , Tcl / Tk interface of Objective Caml
(* *)
, , and ... | null | https://raw.githubusercontent.com/ucsd-progsys/nate/8b1267cd8b10283d8bc239d16a28c654a4cb8942/eval/sherrloc/easyocaml%2B%2B/otherlibs/labltk/frx/frx_fillbox.ml | ocaml | *********************************************************************
described in file LICENSE found in the... | MLTk , Tcl / Tk interface of Objective Caml
, , and
projet Cristal , INRIA Rocquencourt
, Kyoto University RIMS
Copyright 2002 Institut National de Recherche en Informatique et
en Automatique and... |
b287a186132b36be36ec21a096b6ab959f71bb756028f706e5db19fcef5d2ffb | Deep-Symmetry/beat-link-trigger | xone-shared-noui.clj | (def xone-left-channels
"The set of channels assigned to the left side of the cross-fader"
< 1 >
(def xone-right-channels
"The set of channels assigned to the right side of the cross-fader"
< 2 >
(def xone-min-on-air-value
"The MIDI value of the fader must be this far from zero (or, in the
case of the cro... | null | https://raw.githubusercontent.com/Deep-Symmetry/beat-link-trigger/dbfbb2fa7e7bffe0d65befb2feaf0a331354f56c/doc/modules/ROOT/examples/xone-shared-noui.clj | clojure | <3>
Check if it is one of the faders we care about.
It is, so update known mixer state with the current fader value, and
calculate which channels are now on-air.
We need to convert the values to integers, rather than the longs | (def xone-left-channels
"The set of channels assigned to the left side of the cross-fader"
< 1 >
(def xone-right-channels
"The set of channels assigned to the right side of the cross-fader"
< 2 >
(def xone-min-on-air-value
"The MIDI value of the fader must be this far from zero (or, in the
case of the cro... |
538357c853cf62cf0bca29c83fa75a2381e6f0d62289831a6a244aaeb620d52f | returntocorp/semgrep | Gitignore_filter.ml | (*
Support for file tree filtering using the gitignore specification.
*)
module S = Gitignore_syntax
open Git_path.Ops
type t = {
project_root : Fpath.t;
higher_priority_levels : Gitignore_level.t list;
gitignore_file_cache : Gitignore_files.t;
lower_priority_levels : Gitignore_level.t list;
}
type status... | null | https://raw.githubusercontent.com/returntocorp/semgrep/88135d1c4affe447c98819b677160069fc4b3270/src/osemgrep/targeting/Gitignore_filter.ml | ocaml |
Support for file tree filtering using the gitignore specification.
Filter a path, assuming all its parents were deselected
(= not gitignored).
add a segment to the path and check if it's gitignored
load local gitignore file
check whether partial path should be gitignored
stop here, don't go deeper a... |
module S = Gitignore_syntax
open Git_path.Ops
type t = {
project_root : Fpath.t;
higher_priority_levels : Gitignore_level.t list;
gitignore_file_cache : Gitignore_files.t;
lower_priority_levels : Gitignore_level.t list;
}
type status = Not_ignored | Ignored
let create ?gitignore_filenames ?(higher_priority_... |
0e465ed269c97b31f787d6bb5907a4404800a9f2d8cf6bfd08c0510f2ff2054f | jyh/metaprl | hol_core.ml |
*
* ----------------------------------------------------------------
*
* @begin[license ]
* Copyright ( C ) 2004 Mojave Group , Caltech
*
* This program is free software ; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free S... | null | https://raw.githubusercontent.com/jyh/metaprl/51ba0bbbf409ecb7f96f5abbeb91902fdec47a19/theories/hol/hol_core.ml | ocaml |
* Judgments.
* Terms.
* Types.
* Random stuff.
***********************************************************************
* Typing rules.
***********************************************************************
* Core rules.
***********************************************************************
* Lo... |
*
* ----------------------------------------------------------------
*
* @begin[license ]
* Copyright ( C ) 2004 Mojave Group , Caltech
*
* This program is free software ; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free S... |
a85d372efd56615409784504d1e65caf9960097f0b3a8eea848e4f8b540cc7f4 | haskell/cabal | PackageDescription.hs | -----------------------------------------------------------------------------
-- |
-- Module : Distribution.PackageDescription
Copyright : 2003 - 2005
-- License : BSD3
--
-- Maintainer :
-- Portability : portable
--
-- Backwards compatibility reexport of most things you need to know
-- about @.... | null | https://raw.githubusercontent.com/haskell/cabal/0abbe37187f708e0a5daac8d388167f72ca0db7e/Cabal-syntax/src/Distribution/PackageDescription.hs | haskell | ---------------------------------------------------------------------------
|
Module : Distribution.PackageDescription
License : BSD3
Maintainer :
Portability : portable
Backwards compatibility reexport of most things you need to know
about @.cabal@ files.
* Components
** Library
** Executabl... | Copyright : 2003 - 2005
module Distribution.PackageDescription (
* PD and GPD
module Distribution.Types.PackageDescription,
module Distribution.Types.GenericPackageDescription,
module Distribution.Types.ComponentName,
module Distribution.Types.Library,
module Distribution.Types.LibraryNa... |
84aa710b3402afa674eedd4b0ffe37b3751f1718ed79819c0904ab83f3a29882 | blmstrm/loudmoauth | authflow_test.clj | (ns loudmoauth.authflow-test
(:require [clojure.test :refer :all]
[loudmoauth.authflow :refer :all]
[loudmoauth.util :as lmu]
[loudmoauth.test-fixtures :as tf]))
(use-fixtures :each tf/reset)
(deftest test-match-code-to-provider
(testing "Match a given state and code to a certa... | null | https://raw.githubusercontent.com/blmstrm/loudmoauth/a0f502b93e2d50a3fc7c4be68aaeade66199e023/test/loudmoauth/authflow_test.clj | clojure | (ns loudmoauth.authflow-test
(:require [clojure.test :refer :all]
[loudmoauth.authflow :refer :all]
[loudmoauth.util :as lmu]
[loudmoauth.test-fixtures :as tf]))
(use-fixtures :each tf/reset)
(deftest test-match-code-to-provider
(testing "Match a given state and code to a certa... | |
2460261cf4bf0946c839fbcd8ca9bc5d6af1f0681e624b99d5fd79531733a5b9 | lispbuilder/lispbuilder | image-example.lisp | Demonstration / Test of using SDL ( Simple Media Layer ) library
using CFFI for foreign function interfacing ...
( C)2006 Justin Heyes - Jones , .
;;;; see COPYING for license
(in-package #:sdl-image-examples)
(defun image-example ()
(sdl:load-library)
(sdl:with-init ()
(sdl:window 540 350 :title-cap... | null | https://raw.githubusercontent.com/lispbuilder/lispbuilder/589b3c6d552bbec4b520f61388117d6c7b3de5ab/lispbuilder-sdl-image/examples/image-example.lisp | lisp | see COPYING for license
libraries to be preloaded to speed subsequent
loading of these images.
And loaded by force
sdl-image:quit *if* sdl-image:init is used. | Demonstration / Test of using SDL ( Simple Media Layer ) library
using CFFI for foreign function interfacing ...
( C)2006 Justin Heyes - Jones , .
(in-package #:sdl-image-examples)
(defun image-example ()
(sdl:load-library)
(sdl:with-init ()
(sdl:window 540 350 :title-caption "Loading images of vario... |
a6f4e4b5cb069590fd1a752a081b428348bad55f9125d546c9daa7e5ae7e665c | parapluu/Concuerror | sync_start.erl | -module(sync_start).
-export([sync_start/0, sync_start/1]).
-export([scenarios/0]).
-concuerror_options_forced([{instant_delivery, false}]).
scenarios() -> [{?MODULE, inf, dpor}].
sync_start() ->
sync_start(2).
sync_start(N) ->
Parent = self(),
Pids = [spawn(fun() -> worker(I, Parent) end) || I <- list... | null | https://raw.githubusercontent.com/parapluu/Concuerror/152a5ccee0b6e97d8c3329c2167166435329d261/tests/suites/dpor_tests/src/sync_start.erl | erlang | -module(sync_start).
-export([sync_start/0, sync_start/1]).
-export([scenarios/0]).
-concuerror_options_forced([{instant_delivery, false}]).
scenarios() -> [{?MODULE, inf, dpor}].
sync_start() ->
sync_start(2).
sync_start(N) ->
Parent = self(),
Pids = [spawn(fun() -> worker(I, Parent) end) || I <- list... | |
a975b314b526f6b8c428ad72c0b60fb004f2aea8f2e658a658f1a17903c56d9d | ocamllabs/vscode-ocaml-platform | custom_requests.ml | open Import
type ('params, 'response) custom_request =
{ meth : string
; encode_params : 'params -> Jsonoo.t
; decode_response : Jsonoo.t -> 'response
}
let send_request client req params =
let data = req.encode_params params in
let open Promise.Syntax in
let+ response = LanguageClient.sendRequest clien... | null | https://raw.githubusercontent.com/ocamllabs/vscode-ocaml-platform/acf500fde064639493b68d818a910fa258b8cc90/src/custom_requests.ml | ocaml | open Import
type ('params, 'response) custom_request =
{ meth : string
; encode_params : 'params -> Jsonoo.t
; decode_response : Jsonoo.t -> 'response
}
let send_request client req params =
let data = req.encode_params params in
let open Promise.Syntax in
let+ response = LanguageClient.sendRequest clien... | |
23ead758e83a1ff934096883adaaf72bd347b852a8801a59eb4bce7767470bd2 | shayan-najd/NativeMetaprogramming | TH_spliceE5_prof_ext_Lib.hs | module TH_spliceE5_prof_ext_Lib where
import Language.Haskell.TH
expandVars :: [String] -> Q Exp
expandVars s = [| concat $(return (ListE (map f s))) |]
where
f x = VarE (mkName x)
| null | https://raw.githubusercontent.com/shayan-najd/NativeMetaprogramming/24e5f85990642d3f0b0044be4327b8f52fce2ba3/testsuite/tests/th/TH_spliceE5_prof_ext_Lib.hs | haskell | module TH_spliceE5_prof_ext_Lib where
import Language.Haskell.TH
expandVars :: [String] -> Q Exp
expandVars s = [| concat $(return (ListE (map f s))) |]
where
f x = VarE (mkName x)
| |
eb25e8037168e87ecf0b009a11a652c77ae202fd690b0d5ca2ed716b9bf5b3fb | freckle/stack-lint-extra-deps | Color.hs | module Color
( getColor
, Color(..)
) where
import RIO
data Color
= Red
| Green
| Yellow
| Cyan
| Magenta
| LightGray
getColor
:: (MonadReader env m, HasLogFunc env)
=> m (Color -> Utf8Builder -> Utf8Builder)
getColor = do
useColor <- view logFuncUseColorL
pure $ if useColor
... | null | https://raw.githubusercontent.com/freckle/stack-lint-extra-deps/f3e1886179ab7a4f99c3258983ee68d3511db8b9/src/Color.hs | haskell | module Color
( getColor
, Color(..)
) where
import RIO
data Color
= Red
| Green
| Yellow
| Cyan
| Magenta
| LightGray
getColor
:: (MonadReader env m, HasLogFunc env)
=> m (Color -> Utf8Builder -> Utf8Builder)
getColor = do
useColor <- view logFuncUseColorL
pure $ if useColor
... | |
80fb45fcae0639620811be468057b5a7950d0bcf308b2805753c50ecc74748e9 | tek/ribosome | Test.hs | module Ribosome.Test (
-- * Introduction
-- $intro
-- * Embedded testing
-- $embed
* testing
$ tmux
-- * Embedded test API
testPlugin,
testEmbed,
testPluginEmbed,
runEmbedTest,
runTest,
testPluginConf,
testPlugin_,
testEmbedConf,
testEmbed_,
testEmbedLevel,
testEmbedLevel_,
tes... | null | https://raw.githubusercontent.com/tek/ribosome/a676b4f0085916777bfdacdcc761f82d933edb80/packages/test/lib/Ribosome/Test.hs | haskell | * Introduction
$intro
* Embedded testing
$embed
* Embedded test API
* Error handling
* Assertions that are made repeatedly until the succeed
$intro
This module reexports "Ribosome.Test.Embed".
$embed
Most of the time this is only interesting if a handler has complex parameters and you want to test that... | module Ribosome.Test (
* testing
$ tmux
testPlugin,
testEmbed,
testPluginEmbed,
runEmbedTest,
runTest,
testPluginConf,
testPlugin_,
testEmbedConf,
testEmbed_,
testEmbedLevel,
testEmbedLevel_,
testEmbedDebug,
testEmbedDebug_,
testEmbedTrace,
testEmbedTrace_,
runTestConf,
runTest... |
0ac2f1ae52cff73adcbc056c845732cc28be3d820c43956b60e841499d10cea0 | 8c6794b6/guile-tjit | specialize-primcalls.scm | Continuation - passing style ( CPS ) intermediate language ( IL )
Copyright ( C ) 2013 , 2014 , 2015 Free Software Foundation , Inc.
;;;; This library 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 Founda... | null | https://raw.githubusercontent.com/8c6794b6/guile-tjit/9566e480af2ff695e524984992626426f393414f/module/language/cps/specialize-primcalls.scm | scheme | This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
either
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See ... | Continuation - passing style ( CPS ) intermediate language ( IL )
Copyright ( C ) 2013 , 2014 , 2015 Free Software Foundation , Inc.
version 3 of the License , or ( at your option ) any later version .
You should have received a copy of the GNU Lesser General Public
Foundation , Inc. , 51 Franklin Street , ... |
743b64498520abc922ce643da8b214b0f0c5f9d0ad1cc9341801031cbb56d0f7 | qrilka/xlsx | DataValidation.hs | # LANGUAGE CPP #
# LANGUAGE DeriveGeneric #
# LANGUAGE MultiParamTypeClasses #
{-# LANGUAGE OverloadedStrings #-}
# LANGUAGE RecordWildCards #
# LANGUAGE TemplateHaskell #
module Codec.Xlsx.Types.DataValidation
( ValidationExpression(..)
, ValidationType(..)
, dvAllowBlank
, dvError
, dvErrorStyle
... | null | https://raw.githubusercontent.com/qrilka/xlsx/c71992f20f78b444a5ff96254efc3a7bcf685abf/src/Codec/Xlsx/Types/DataValidation.hs | haskell | # LANGUAGE OverloadedStrings #
^ "Between" operator
^ "Equal to" operator
^ "Greater than" operator
^ "Greater than or equal to" operator
^ "Less than" operator
^ "Less than or equal to" operator
^ "Not between" operator
^ "Not equal to" operator
^ a plain list of elements
^ a cell or range reference
See 18.... | # LANGUAGE CPP #
# LANGUAGE DeriveGeneric #
# LANGUAGE MultiParamTypeClasses #
# LANGUAGE RecordWildCards #
# LANGUAGE TemplateHaskell #
module Codec.Xlsx.Types.DataValidation
( ValidationExpression(..)
, ValidationType(..)
, dvAllowBlank
, dvError
, dvErrorStyle
, dvErrorTitle
, dvPrompt
... |
583cb589b0a5e62bae5f279707324986fefc33af2e294be6c55aab283de5fcc7 | tkyshm/esnowflake | esnowflake.erl | @doc Generates uniq i d API which inspires Twiiter 's snowflake .
%%%
%%% @end
-module(esnowflake).
-include("esnowflake.hrl").
-export([generate_id/0,
generate_ids/1,
to_unixtime/1,
to_unixtime/2,
unixtime_to_id/1,
unixtime_to_id/2,
range_ids/2,
range_... | null | https://raw.githubusercontent.com/tkyshm/esnowflake/46de5b4bc465c7c4e7318be18fc7c163ae77f9f8/src/esnowflake.erl | erlang |
@end
@doc
Generate a uniq id.
@end
@doc
@end
@doc
Convert generated id to unix time (milli_seconds).
@end
@doc
Convert generated id to unix time (seconds or milli_seconds).
@end
@doc
Returns snowflake uniq id from unix timestamp.
@end
@doc
Returns snowflake uniq id from unix timestamp.
@end
@doc
Th... | @doc Generates uniq i d API which inspires Twiiter 's snowflake .
-module(esnowflake).
-include("esnowflake.hrl").
-export([generate_id/0,
generate_ids/1,
to_unixtime/1,
to_unixtime/2,
unixtime_to_id/1,
unixtime_to_id/2,
range_ids/2,
range_ids/3,
... |
d6a045662fec252f0dce7b714c2f0d2980e75613cccd96fd91a35c63fe4c4a58 | yangchenyun/learning-sicp | meval.scm | ;;;; MEVAL.SCM
Basic Metacircular Evaluator from section 4.1 ,
;;; Extended with Lazy Parameter Declarations
as in Exercise 4.14
(define (meval exp env)
(cond ((self-evaluating? exp) exp)
((quoted? exp) (text-of-quotation exp))
((variable? exp) (lookup-variable-value exp env))
((assignme... | null | https://raw.githubusercontent.com/yangchenyun/learning-sicp/99a19a06eddc282e0eb364536e297f27c32a9145/practices/assignments/14.evaluators/meval.scm | scheme | MEVAL.SCM
Extended with Lazy Parameter Declarations
this postpones argument evaluation until
parameter declarations are processed
CORRECTED to eliminate forcing
the last expression |
Basic Metacircular Evaluator from section 4.1 ,
as in Exercise 4.14
(define (meval exp env)
(cond ((self-evaluating? exp) exp)
((quoted? exp) (text-of-quotation exp))
((variable? exp) (lookup-variable-value exp env))
((assignment? exp) (eval-assignment exp env))
((definition? exp... |
005a5b069d1bea1f90e5ced2cd34f52c0322e2916a84e11f19eadae6f8340f00 | kupl/FixML | sub39.ml | type metro =
| STATION of name
| AREA of name * metro
| CONNECT of metro * metro
and
name = string
let rec checkMetro (m: metro) : bool =
match m with
| STATION n -> true
| CONNECT (m1, m2) -> (checkMetro m1) && (checkMetro m2)
| AREA (n, m) ->
( match m with
| STATION n2 -> (if (n=n2) t... | null | https://raw.githubusercontent.com/kupl/FixML/0a032a733d68cd8ccc8b1034d2908cd43b241fce/benchmarks/wellformedness/wellformedness1/submissions/sub39.ml | ocaml | type metro =
| STATION of name
| AREA of name * metro
| CONNECT of metro * metro
and
name = string
let rec checkMetro (m: metro) : bool =
match m with
| STATION n -> true
| CONNECT (m1, m2) -> (checkMetro m1) && (checkMetro m2)
| AREA (n, m) ->
( match m with
| STATION n2 -> (if (n=n2) t... | |
22ec20d9763636c156fab65f782983e68ed5440ab775e5ed53c1e348551cd710 | jarvinet/scheme | ch5-compiler.scm | COMPILER FROM SECTION 5.5 OF
;;;; STRUCTURE AND INTERPRETATION OF COMPUTER PROGRAMS
;;;;Matches code in ch5.scm
;;;;This file can be loaded into Scheme as a whole.
;;;;**NOTE**This file loads the metacircular evaluator's syntax procedures
from section 4.1.2
;;;; You may need to change the (load ...) expression to... | null | https://raw.githubusercontent.com/jarvinet/scheme/47633d7fc4d82d739a62ceec75c111f6549b1650/bin/compiler/ch5-compiler.scm | scheme | STRUCTURE AND INTERPRETATION OF COMPUTER PROGRAMS
Matches code in ch5.scm
This file can be loaded into Scheme as a whole.
**NOTE**This file loads the metacircular evaluator's syntax procedures
You may need to change the (load ...) expression to work in your
version of Scheme.
**implementation-dependent loading of ... | COMPILER FROM SECTION 5.5 OF
from section 4.1.2
Then you can compile Scheme programs as shown in section 5.5.5
SECTION 5.5.1
(define (compile exp target linkage)
(cond ((self-evaluating? exp)
(compile-self-evaluating exp target linkage))
((quoted? exp)
(compile-quoted exp target linkage))... |
b519a931f066f20d7e4dccb1c3f7ed6c96fc7de70355f501d30ca3a9b0b7d747 | silky/fashion | Main.hs | # LANGUAGE FlexibleContexts #
{-# LANGUAGE GADTs #-}
{-# LANGUAGE NoMonomorphismRestriction #-}
module Main where
import Diagrams.Prelude
import Diagrams.Backend.Cairo.CmdLine
import Nvds.Designs.WaveAxis
main :: IO ()
main = mainWith (d # frame 0.2) >> putStrLn "Done!"
| null | https://raw.githubusercontent.com/silky/fashion/2b01d1e5c385fe99e8e54f5828114551e9c8e309/Wave-Axis/src/Main.hs | haskell | # LANGUAGE GADTs #
# LANGUAGE NoMonomorphismRestriction # | # LANGUAGE FlexibleContexts #
module Main where
import Diagrams.Prelude
import Diagrams.Backend.Cairo.CmdLine
import Nvds.Designs.WaveAxis
main :: IO ()
main = mainWith (d # frame 0.2) >> putStrLn "Done!"
|
bf4b84911b5b6f6968f7af54e45cf2f7287b66e81a00f12eb62a0be5e1a00e1b | krtx/ws-ocaml | test_helper.ml | let in_channel_of_bytes b =
let fn = Filename.temp_file "in_channel_of_string" "" in
let cout = open_out fn in
output_bytes cout b;
flush cout;
close_out cout;
open_in fn
| null | https://raw.githubusercontent.com/krtx/ws-ocaml/f3710f1ef36d73440c10d96785c13e08bc638545/t/test_helper.ml | ocaml | let in_channel_of_bytes b =
let fn = Filename.temp_file "in_channel_of_string" "" in
let cout = open_out fn in
output_bytes cout b;
flush cout;
close_out cout;
open_in fn
| |
aabe9b27ec01d3a726f63c215ae74c5d4a1772d3398248740e7f3aefd78fcadb | ofmooseandmen/jord | Parser.hs | -- |
Module : Data . Geo . .
Copyright : ( c ) 2020
License : BSD3
Maintainer : < >
-- Stability: experimental
-- Portability: portable
--
-- internal 'ReadP' parsers.
module Data.Geo.Jord.Parser
( digits
, double
, integer
, natural
, number
) where
import Cont... | null | https://raw.githubusercontent.com/ofmooseandmen/jord/9acd8d9aec817ce05de6ed1d78e025437e1193bf/src/Data/Geo/Jord/Parser.hs | haskell | |
Stability: experimental
Portability: portable
internal 'ReadP' parsers.
| Parses the given number of digits and returns the read 'Int'.
| Parses optionally a @-@ followed by a 'natural'.'natural' and returns the read 'Double'.
| Parses optionally a @-@ followed by a 'natural' and returns the read 'Int'.
| ... | Module : Data . Geo . .
Copyright : ( c ) 2020
License : BSD3
Maintainer : < >
module Data.Geo.Jord.Parser
( digits
, double
, integer
, natural
, number
) where
import Control.Applicative ((<|>))
import Data.Char (isDigit)
import Text.ParserCombinators.ReadP (Rea... |
abc1d1d3852eefb6c4f0694cea4cf90d272cc3f3064d2d3b95ebe5c12f3f588a | dparis/gen-phzr | crop.cljs | (ns phzr.component.crop
(:require [phzr.impl.utils.core :refer [clj->phaser phaser->clj]]
[phzr.impl.extend :as ex]
[cljsjs.phaser]))
(defn ->Crop
"The Crop component provides the ability to crop a texture based Game Object to a defined rectangle,
which can be updated in real-time."
([... | null | https://raw.githubusercontent.com/dparis/gen-phzr/e4c7b272e225ac343718dc15fc84f5f0dce68023/out/component/crop.cljs | clojure | (ns phzr.component.crop
(:require [phzr.impl.utils.core :refer [clj->phaser phaser->clj]]
[phzr.impl.extend :as ex]
[cljsjs.phaser]))
(defn ->Crop
"The Crop component provides the ability to crop a texture based Game Object to a defined rectangle,
which can be updated in real-time."
([... | |
0c3e3e13f26c4f8fbbe24507b5498bdb1cb9ffde057af4956f7c7c749a331202 | Metaxal/MrEd-Designer | widget.rkt | #lang racket
(require "../../mred-plugin.rkt"
"../../default-values.rkt"
"../project/preview.rkt" ; needed for plugin% class... ; ???? WARNING: make-plugin??
"../frame/preview.rkt"
racket/gui/base)
(make-plugin
[type 'dialog]
[tooltip "Dialog"]
[button-group "Containers"]
... | null | https://raw.githubusercontent.com/Metaxal/MrEd-Designer/220833b738a1d46fbe309ea124ef61b825e42e68/mred-designer/widgets/dialog/widget.rkt | racket | needed for plugin% class... ; ???? WARNING: make-plugin??
dialogs are modal, so use a frame for a preview
for code generation. By default the same as widget-class
can only instantiate under a frame% or under nothing
necessary properties
widget properties
[parent #f] ; NO! do NOT use the parent property!
optiona... | #lang racket
(require "../../mred-plugin.rkt"
"../../default-values.rkt"
"../frame/preview.rkt"
racket/gui/base)
(make-plugin
[type 'dialog]
[tooltip "Dialog"]
[button-group "Containers"]
[options '(id)]
[no-code '(show-at-init)]
[post-code (λ (mid) (if (send mid get-property-va... |
deecec5c678a44817eda70b44afb8760df39feafcf8bf8fc5ab66aeca8878d33 | austral/austral | AcmFile.ml |
Part of the Austral project , under the Apache License v2.0 with LLVM Exceptions .
See LICENSE file for details .
SPDX - License - Identifier : Apache-2.0 WITH LLVM - exception
Part of the Austral project, under the Apache License v2.0 with LLVM Exceptions.
See LICENSE file for details.
SPDX... | null | https://raw.githubusercontent.com/austral/austral/69b6f7de36cc9576483acd1ac4a31bf52074dbd1/lib/AcmFile.ml | ocaml | * Types in ACM files are always either public or opaque.
* The serialized form of a statement.
* A reference to an instance.
* A reference to an instance method.
* A reference to a named declaration.
* The serialized form of an expression.
* Constants in ACM files are always public.
* If this function is foreign... |
Part of the Austral project , under the Apache License v2.0 with LLVM Exceptions .
See LICENSE file for details .
SPDX - License - Identifier : Apache-2.0 WITH LLVM - exception
Part of the Austral project, under the Apache License v2.0 with LLVM Exceptions.
See LICENSE file for details.
SPDX... |
aa573b4cb120a006db7b0c9579e9836ff78ae6a8faec48c2e0d4eb71714cb63e | baskeboler/cljs-karaoke-client | events.cljs | (ns cljs-karaoke.events
(:require [re-frame.core :as rf :include-macros true]
[day8.re-frame.tracing :refer-macros [fn-traced]]
[ajax.core :as ajax]
[cljs.core.async :as async :refer [go go-loop <! >! chan]]
[day8.re-frame.async-flow-fx]
[cljs.reader :as rea... | null | https://raw.githubusercontent.com/baskeboler/cljs-karaoke-client/bb6512435eaa436d35034886be99213625847ee0/src/main/cljs_karaoke/events.cljs | clojure | [::set-pageloader-active? false]
[::views-events/set-current-view :playback]
::http-relay-events/init-http-relay-listener
[::set-pageloader-active? false]
(rf/dispatch)
::init-fetches
:audio nil
:player-status nil
:highlight-status nil
:playlist (pl/build-playlist)
:dispatch-n [[::fetch-custom-delays]
[::fe... | (ns cljs-karaoke.events
(:require [re-frame.core :as rf :include-macros true]
[day8.re-frame.tracing :refer-macros [fn-traced]]
[ajax.core :as ajax]
[cljs.core.async :as async :refer [go go-loop <! >! chan]]
[day8.re-frame.async-flow-fx]
[cljs.reader :as rea... |
f2838179d1ea6fe9e7a272d553d5e974daa75f0e5eb5d648a74a39922ba6bf7a | amutake/actario | actor_modutil.mli | (************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
v * INRIA , CNRS and contributors - Copyright 1999 - 2018
(* <O___,, * (see CREDITS file for the list of authors) *)
\VV/ * * * *... | null | https://raw.githubusercontent.com/amutake/actario/35c1d5499149e12842dec6d230d5fad00f18ac6d/plugin/actor_modutil.mli | ocaml | **********************************************************************
* The Coq Proof Assistant / The Coq Development Team
<O___,, * (see CREDITS file for the list of authors)
// * This file is distributed under the terms of the
* (see LICENSE file for... | v * INRIA , CNRS and contributors - Copyright 1999 - 2018
\VV/ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* GNU Lesser General Public License Version 2.1
open Names
open Globnames
open Minim... |
282211e614681cc83690fb094d36027ddd75adabad06f395b892cb826378d29c | ollef/sixty | Inlining.hs | # LANGUAGE DuplicateRecordFields #
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RankNTypes #-}
module Inlining where
import Core.Binding (Binding)
import Core.Bindings (Bindings)
import qualified Core.Syntax as Syntax
import Data.OrderedHashMap (OrderedHashMap)
import qualified Data.OrderedHashMap as OrderedHashMa... | null | https://raw.githubusercontent.com/ollef/sixty/2582551f3c12f84489afb961b800f0d7cfa74844/src/Inlining.hs | haskell | # LANGUAGE OverloadedStrings #
# LANGUAGE RankNTypes #
-----------------------------------------------------------------------------
----------------------------------------------------------------------------- | # LANGUAGE DuplicateRecordFields #
module Inlining where
import Core.Binding (Binding)
import Core.Bindings (Bindings)
import qualified Core.Syntax as Syntax
import Data.OrderedHashMap (OrderedHashMap)
import qualified Data.OrderedHashMap as OrderedHashMap
import qualified Environment
import qualified Index
import Li... |
34e63d81004e29a1dc81d574c7295b450a37fb412b593641d5f18337d23cb0ae | SquidDev/urn | nodes.lisp | (import urn/resolve/builtins (builtin) :export)
(import urn/resolve/scope scope)
(import lua/basic (type#))
(defun builtin? (node name)
"Determine whether NODE is builtin NAME."
(and (symbol? node) (= (.> node :var) (builtin name))))
(defun side-effect? (node)
"Checks if NODE has a side effect"
(with (tag (t... | null | https://raw.githubusercontent.com/SquidDev/urn/6e6717cf1376b0950e569e3771cb7e287aed291d/urn/analysis/nodes.lisp | lisp | Constant terms are obviously side effect free
If we're calling a non-builtin symbol, then assume it has a side effect.
struct-literal has no side effect if empty.
Otherwise, assume it'll do something
Non-builtin functions will "always" return multiple values.
Various literals will just return a single value
Othe... | (import urn/resolve/builtins (builtin) :export)
(import urn/resolve/scope scope)
(import lua/basic (type#))
(defun builtin? (node name)
"Determine whether NODE is builtin NAME."
(and (symbol? node) (= (.> node :var) (builtin name))))
(defun side-effect? (node)
"Checks if NODE has a side effect"
(with (tag (t... |
5436564210d001bb6b2c0e42f6055f6d5738913ff3977b20d5c99f7cd1f13ced | ciste/ciste | middleware.clj | (ns ciste.middleware
(:use [ciste.config :only [config]])
(:require [clojure.pprint :as p]
[taoensso.timbre :as timbre]))
(defn wrap-http-serialization
[handler]
(fn [request]
(->> request
(merge {:serialization :http, :format :html})
handler)))
(defn with-request-logging
"... | null | https://raw.githubusercontent.com/ciste/ciste/fac15456f9f00867c0073b7e55e5e8b5cd4a902d/src/ciste/middleware.clj | clojure | (ns ciste.middleware
(:use [ciste.config :only [config]])
(:require [clojure.pprint :as p]
[taoensso.timbre :as timbre]))
(defn wrap-http-serialization
[handler]
(fn [request]
(->> request
(merge {:serialization :http, :format :html})
handler)))
(defn with-request-logging
"... | |
c5e322950291c7a714082cc8f13a294f2ea1b31f1b03e11554766c73ba69977c | potatosalad/erlang-jose | jose_jwe_alg_pbes2_props.erl | -*- mode : erlang ; tab - width : 4 ; indent - tabs - mode : 1 ; st - rulers : [ 70 ] -*-
%% vim: ts=4 sw=4 ft=erlang noet
-module(jose_jwe_alg_pbes2_props).
-include_lib("proper/include/proper.hrl").
% -compile(export_all).
base64url_binary() ->
?LET(Binary,
binary(),
jose_jwa_base64url:encode(Binary)).
bin... | null | https://raw.githubusercontent.com/potatosalad/erlang-jose/43d3db467f909bbc932bd663ddcb1af93180dfd3/test/property_test/jose_jwe_alg_pbes2_props.erl | erlang | vim: ts=4 sw=4 ft=erlang noet
-compile(export_all). | -*- mode : erlang ; tab - width : 4 ; indent - tabs - mode : 1 ; st - rulers : [ 70 ] -*-
-module(jose_jwe_alg_pbes2_props).
-include_lib("proper/include/proper.hrl").
base64url_binary() ->
?LET(Binary,
binary(),
jose_jwa_base64url:encode(Binary)).
binary_map() ->
?LET(List,
list({base64url_binary(), base... |
d373c0f1a3cacb6542429bea51e504db878265bfd671523926cf9da235874fc9 | coccinelle/herodotos | defects.ml | open Helper
exception Unsupported of string
let build_message verbose fn info an =
(* (filename, info, author) = verbose *)
let msg = match verbose with
( true, true, true) -> [fn;info;an]
| ( true, true, false) -> [fn;info ]
| ( true, false, true) -> [fn ;an]
| ( true, false, false) -... | null | https://raw.githubusercontent.com/coccinelle/herodotos/5da230a18962ca445ed2368bc21abe0a8402e00f/herodotos/graph/defects.ml | ocaml | (filename, info, author) = verbose
This should not happen! | open Helper
exception Unsupported of string
let build_message verbose fn info an =
let msg = match verbose with
( true, true, true) -> [fn;info;an]
| ( true, true, false) -> [fn;info ]
| ( true, false, true) -> [fn ;an]
| ( true, false, false) -> [fn ]
| (false, true, true) ... |
34b4bc3079360b905f05cb590ff9dff79f6eac90b28f17b46db4207e7a2392d5 | vbrankov/hdf5-ocaml | discover.ml | module C = Configurator.V1
let hdf5_default =
let libs =
let libs = ["-lhdf5"; "-lhdf5_hl"] in
let s = "/usr/lib/x86_64-linux-gnu/hdf5/serial" in
if Sys.file_exists s then libs @ [Printf.sprintf "-L%s" s] else libs
in
let cflags =
let s = "/usr/include/hdf5/serial" in
if Sys.file_exists s the... | null | https://raw.githubusercontent.com/vbrankov/hdf5-ocaml/7abc763189767cd6c92620f29ce98f6ee23ba88f/src/raw/config/discover.ml | ocaml | module C = Configurator.V1
let hdf5_default =
let libs =
let libs = ["-lhdf5"; "-lhdf5_hl"] in
let s = "/usr/lib/x86_64-linux-gnu/hdf5/serial" in
if Sys.file_exists s then libs @ [Printf.sprintf "-L%s" s] else libs
in
let cflags =
let s = "/usr/include/hdf5/serial" in
if Sys.file_exists s the... | |
b993e232dc5b30a62167e9b4ee1e18afd2140d5bf8e39d78b60b21f3aaa0dd71 | richcarl/file_monitor | file_monitor_tests.erl | Licensed under the Apache License , Version 2.0 ( the " License " ) ; you may
%% not use this file except in compliance with the License. You may obtain
%% a copy of the License at <-2.0>
%%
%% Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an " A... | null | https://raw.githubusercontent.com/richcarl/file_monitor/05bc1cd249025c756de77d54bfa6decc78c6cdd3/test/file_monitor_tests.erl | erlang | not use this file except in compliance with the License. You may obtain
a copy of the License at <-2.0>
Unless required by applicable law or agreed to in writing, software
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
... | Licensed under the Apache License , Version 2.0 ( the " License " ) ; you may
distributed under the License is distributed on an " AS IS " BASIS ,
General Public License ( the " LGPL " ) as published by the Free Software
Foundation ; either version 2.1 , or ( at your option ) any later version .
either the Ap... |
20887956b53716b25f7f5922bcc670e70ebf48c226afbc5f8d0331719ddda1e9 | iostreamer-X/FuncShell | TableParser.hs | module TableParser where
import Transform
import Text.ParserCombinators.ReadP
import Language.Haskell.Interpreter as I
import Data.List
--- PARSING
isChar = (>' ')
charParser :: ReadP String
charParser = many1 (satisfy isChar)
-- This parses characters till a space is encountered
getParsed :: ReadS String
getParse... | null | https://raw.githubusercontent.com/iostreamer-X/FuncShell/b6fa9fbc329c929e949287f57207c32cf92adf35/src/TableParser.hs | haskell | - PARSING
This parses characters till a space is encountered
Leading space needs to be removed or else our parser will output []
Only the last element is of interest, rest are incomplete
- END PARSING
- TRANSFORMING
- END TRANSFORMING
- EXECUTING
Adds padding to each string from the list such that length of each s... | module TableParser where
import Transform
import Text.ParserCombinators.ReadP
import Language.Haskell.Interpreter as I
import Data.List
isChar = (>' ')
charParser :: ReadP String
charParser = many1 (satisfy isChar)
getParsed :: ReadS String
getParsed = readP_to_S charParser
removeLeadingSpace (' ':xs) = removeLea... |
e8aec80d296ee629f16b7da931ccaff561413d90760b4a9221677acf782a53ec | AccelerateHS/accelerate-examples | Issue185.hs | {-# LANGUAGE ConstraintKinds #-}
{-# LANGUAGE FlexibleContexts #-}
# LANGUAGE OverloadedLists #
# LANGUAGE ScopedTypeVariables #
{-# LANGUAGE TypeOperators #-}
module Test.Issues.Issue185 (test_issue185)
where
import Config
import Test.Framework
import Test.Framework.Providers.HUnit
import Prelud... | null | https://raw.githubusercontent.com/AccelerateHS/accelerate-examples/a973ee423b5eadda6ef2e2504d2383f625e49821/examples/icebox/nofib/Test/Issues/Issue185.hs | haskell | # LANGUAGE ConstraintKinds #
# LANGUAGE FlexibleContexts #
# LANGUAGE TypeOperators #
^ source indices to gather from
^ mask vector
^ predicate function
^ default values
^ source values
^ destination indices to scatter into
^ mask vector
^ predicate function
^ default values
^ source values | # LANGUAGE OverloadedLists #
# LANGUAGE ScopedTypeVariables #
module Test.Issues.Issue185 (test_issue185)
where
import Config
import Test.Framework
import Test.Framework.Providers.HUnit
import Prelude as P
import Data.Array.Accelerate as A
im... |
7f0359f7aa6843c7a35ba6870b4bd5935ad14ff236e6598b1098689ba2a93b9f | ocaml-sf/learn-ocaml-corpus | int32_lsd.ml | let pigeonhole_sort (bound : int) (kvs : (int * 'v) list) : 'v list =
(* Create an array of buckets, each of which is initially empty. *)
assert (0 <= bound);
let bucket : 'v list array = Array.make bound [] in
(* Place every value into an appropriate bucket, according to its key. *)
List.iter (fun (k, v) ->
... | null | https://raw.githubusercontent.com/ocaml-sf/learn-ocaml-corpus/7dcf4d72b49863a3e37e41b3c3097aa4c6101a69/exercises/fpottier/generic_sorting/wrong/int32_lsd.ml | ocaml | Create an array of buckets, each of which is initially empty.
Place every value into an appropriate bucket, according to its key.
Reverse the list stored in every bucket, so as to have a stable sort.
Concatenate all buckets.
The input list is empty. Return an empty output list.
The input list is a singleton.... | let pigeonhole_sort (bound : int) (kvs : (int * 'v) list) : 'v list =
assert (0 <= bound);
let bucket : 'v list array = Array.make bound [] in
List.iter (fun (k, v) ->
assert (0 <= k && k < bound);
bucket.(k) <- v :: bucket.(k)
) kvs;
for k = 0 to bound - 1 do
bucket.(k) <- List.rev bucket.(k)
d... |
cb49138613cd8bdb5fc06536cce265546b84efc9e795a0e73fb1847c21876d9c | lichtblau/CommonQt | t3.lisp | ;;; -*- show-trailing-whitespace: t; indent-tabs-mode: nil -*-
;;; -t3.html
(defpackage :qt-tutorial-3
(:use :cl :qt)
(:export #:main))
(in-package :qt-tutorial-3)
(named-readtables:in-readtable :qt)
(defvar *qapp*)
(defun main ()
(setf *qapp* (make-qapplication))
(let ((window (#_new QWidget)))
(#_re... | null | https://raw.githubusercontent.com/lichtblau/CommonQt/fa14472594b2b2b34695ec3fff6f858a03ec5813/tutorial/old/t3.lisp | lisp | -*- show-trailing-whitespace: t; indent-tabs-mode: nil -*-
-t3.html |
(defpackage :qt-tutorial-3
(:use :cl :qt)
(:export #:main))
(in-package :qt-tutorial-3)
(named-readtables:in-readtable :qt)
(defvar *qapp*)
(defun main ()
(setf *qapp* (make-qapplication))
(let ((window (#_new QWidget)))
(#_resize window 200 120)
(let ((quit (#_new QPushButton "Quit" window)))
... |
fd9e3572ab9ae2e97a40968ed338266803206954a49c28f95b05edf940b1bf28 | seckcoder/iu_c311 | bin_search.rkt | (define (bin-search vec v cmp)
(letrec ((bin-search1 (lambda (i j)
(cond ((and (= i j)
(eq? (cmp (vector-ref vec i) v)
'=))
i)
((>= i j)
... | null | https://raw.githubusercontent.com/seckcoder/iu_c311/a1215983b6ab08df32058ef1e089cb294419e567/racket/bin_search.rkt | racket | (define (bin-search vec v cmp)
(letrec ((bin-search1 (lambda (i j)
(cond ((and (= i j)
(eq? (cmp (vector-ref vec i) v)
'=))
i)
((>= i j)
... | |
54363b0e8ed5ab09f3a60439b85021dd30897e98ffae591f54ba6ec1a85e53ec | exoscale/clojure-kubernetes-client | v1_service_list.clj | (ns clojure-kubernetes-client.specs.v1-service-list
(:require [clojure.spec.alpha :as s]
[spec-tools.data-spec :as ds]
[clojure-kubernetes-client.specs.v1-service :refer :all]
[clojure-kubernetes-client.specs.v1-list-meta :refer :all]
)
(:import (java.io File)))
(de... | null | https://raw.githubusercontent.com/exoscale/clojure-kubernetes-client/79d84417f28d048c5ac015c17e3926c73e6ac668/src/clojure_kubernetes_client/specs/v1_service_list.clj | clojure | (ns clojure-kubernetes-client.specs.v1-service-list
(:require [clojure.spec.alpha :as s]
[spec-tools.data-spec :as ds]
[clojure-kubernetes-client.specs.v1-service :refer :all]
[clojure-kubernetes-client.specs.v1-list-meta :refer :all]
)
(:import (java.io File)))
(de... | |
9adb263894a145608eface8b68dde927ac43783bbd5d3f69b9035f8237b5a0d4 | camlspotter/ocamloscope.2 | sig.ml | open Spotlib.Spot
open Typerep_lib.Std
type k = KModule | KModtype | KType | KTypext | KValue | KClass | KClasstype | KConstructor | KField | KMethod
[@@deriving conv{ocaml_of}, typerep]
let string_of_k = function
| KModule -> "module"
| KModtype -> "module type"
| KType -> "type"
| KTypext ... | null | https://raw.githubusercontent.com/camlspotter/ocamloscope.2/49b5977a283cdd373021d41cb3620222351a2efe/sig.ml | ocaml | TODO variance
if gadt
constructor type
return type if gadt
-> return_type
return_type if it is a gadt
This must be converted to FVariantConstructor in Globalized
return type if gadt
new type
class path?
* type_expr option (* cty_new
new type
class path? | open Spotlib.Spot
open Typerep_lib.Std
type k = KModule | KModtype | KType | KTypext | KValue | KClass | KClasstype | KConstructor | KField | KMethod
[@@deriving conv{ocaml_of}, typerep]
let string_of_k = function
| KModule -> "module"
| KModtype -> "module type"
| KType -> "type"
| KTypext ... |
2c50a1c58bd20fc71eedf4dc77a2bf40f14304b1be184c3e11cf8a79281348ec | karen/haskell-book | Either.hs | import Test.QuickCheck
import Test.QuickCheck.Checkers
import Test.QuickCheck.Classes
data Sum' a b =
First a
| Second b
deriving (Eq, Show)
data Validation e a =
Error' e
| Success' a
deriving (Eq, Show)
instance Functor (Sum' a) where
fmap _ (First x) = First x
fmap f (Second a) = Second $ ... | null | https://raw.githubusercontent.com/karen/haskell-book/90bb80ec3203fde68fc7fda1662d9fc8b509d179/src/ch17/Either.hs | haskell | import Test.QuickCheck
import Test.QuickCheck.Checkers
import Test.QuickCheck.Classes
data Sum' a b =
First a
| Second b
deriving (Eq, Show)
data Validation e a =
Error' e
| Success' a
deriving (Eq, Show)
instance Functor (Sum' a) where
fmap _ (First x) = First x
fmap f (Second a) = Second $ ... | |
4238c29f33eaabd0be5b8a2b02eacb32ee646792627a2ad68a57149fce904a58 | cxphoe/SICP-solutions | 1.40.rkt | (load "fixed_point.rkt")
(define dx 0.00001)
(define (deriv f)
(lambda (x)
(/ (- (f (+ x dx)) (f x))
dx)))
(define (newton-transform g)
(lambda (x)
(- x (/ (g x) ((deriv g) x)))))
(define (newtons-method g guess)
(fixed-point (newton-transform g) guess))
(define (cubic a b c)
(lambda (x)
... | null | https://raw.githubusercontent.com/cxphoe/SICP-solutions/d35bb688db0320f6efb3b3bde1a14ce21da319bd/Chapter%201-Building%20Abstractions%20with%20Procedures/1.40.rkt | racket | (load "fixed_point.rkt")
(define dx 0.00001)
(define (deriv f)
(lambda (x)
(/ (- (f (+ x dx)) (f x))
dx)))
(define (newton-transform g)
(lambda (x)
(- x (/ (g x) ((deriv g) x)))))
(define (newtons-method g guess)
(fixed-point (newton-transform g) guess))
(define (cubic a b c)
(lambda (x)
... | |
d29aff4de42575e1945c97c844f8316a337fe687b44fd382ca11be455075dc18 | jonase/eastwood | move.clj | Copyright ( c ) , 2012 . All rights reserved . The use and
distribution terms for this software are covered by the Eclipse
;; Public License 1.0 (-1.0.php)
;; which can be found in the file epl-v10.html at the root of this
;; distribution. By using this software in any fashion, you are
;; agreeing to be bound by ... | null | https://raw.githubusercontent.com/jonase/eastwood/c5b7d9f8ad8f8b38dc7138d853cc65f6987d6058/copied-deps/eastwood/copieddeps/dep9/clojure/tools/namespace/move.clj | clojure | Public License 1.0 (-1.0.php)
which can be found in the file epl-v10.html at the root of this
distribution. By using this software in any fashion, you are
agreeing to be bound by the terms of this license. You must not
remove this notice, or any other, from this software.
that's too broad; we don't want a whole n... | Copyright ( c ) , 2012 . All rights reserved . The use and
distribution terms for this software are covered by the Eclipse
(ns ^{:author "Stuart Sierra"
:doc "Refactoring tool to move a Clojure namespace from one name/file to
another, and update all references to that namespace in your other
Clojure so... |
6e1a5a18fd4a6cdc31cfc6e45ca1195533aefbd8d56dccab40f202f357401e98 | hbr/albatross | repl.mli | open Fmlib
module Make (Io: Io.SIG):
sig
val run_cli: _ -> unit Io.t
val run_eval: _ -> unit Io.t
end
| null | https://raw.githubusercontent.com/hbr/albatross/8f28ef97951f92f30dc69cf94c0bbe20d64fba21/ocaml/albalib/repl.mli | ocaml | open Fmlib
module Make (Io: Io.SIG):
sig
val run_cli: _ -> unit Io.t
val run_eval: _ -> unit Io.t
end
| |
c69d3c2e622cfd2a957b97b91095425a38768624d8cb9ee3621a25904cb42686 | webyrd/n-grams-for-synthesis | interp-simplified-dynamic.scm | (load "prelude.scm")
;; ngrams-statistics structure:
;;
;; (((context form) . count) ...)
(define ngrams-statistics (read-data-from-file "tmp/statistics.scm"))
(define unique
(lambda (l)
(if (null? l)
'()
(cons (car l) (remove (car l) (unique (cdr l)))))))
(define all-contexts (unique (map caar ngr... | null | https://raw.githubusercontent.com/webyrd/n-grams-for-synthesis/b53b071e53445337d3fe20db0249363aeb9f3e51/interp-simplified-dynamic.scm | scheme | ngrams-statistics structure:
(((context form) . count) ...)
orderings-alist structure:
((context . (eval-relation ...)) ...)
ctx-stats has the structure:
((form . count) ...)
For example,
context -> list of eval-relations
(error 'eval-expo (string-append "bad context " (symbol->string context)))
symbol? d... | (load "prelude.scm")
(define ngrams-statistics (read-data-from-file "tmp/statistics.scm"))
(define unique
(lambda (l)
(if (null? l)
'()
(cons (car l) (remove (car l) (unique (cdr l)))))))
(define all-contexts (unique (map caar ngrams-statistics)))
(define orderings-alist
(let ((ordering-for-cont... |
bb2edf098ca201aa443c9e93319a5ea781dcd83715429bd6a47e014e05f864d7 | noinia/hgeometry | Types.hs | module Algorithms.Geometry.ConvexHull.Types where
import Control.Lens (Lens', _1, _2)
import Control.Monad.State.Strict (StateT)
import Data.Ext
import Geometry.Point
import Geometry.Triangle
import Data.IndexedDoublyLinkedList
import Data.List.NonEmpty (NonEmpty)
import Data.Util
------------------------------------... | null | https://raw.githubusercontent.com/noinia/hgeometry/89cd3d3109ec68f877bf8e34dc34b6df337a4ec1/hgeometry-devel/src/Algorithms/Geometry/ConvexHull/Types.hs | haskell | ------------------------------------------------------------------------------
------------------------------------------------------------------------------
------------------------------------------------------------------------------
------------------------------------------------------------------------------
| T... | module Algorithms.Geometry.ConvexHull.Types where
import Control.Lens (Lens', _1, _2)
import Control.Monad.State.Strict (StateT)
import Data.Ext
import Geometry.Point
import Geometry.Triangle
import Data.IndexedDoublyLinkedList
import Data.List.NonEmpty (NonEmpty)
import Data.Util
type ConvexHull d p r = [ Three I... |
693cc51d8fe42d3853538ca1c97feb0889a52b1a28d09a251aa695b718304771 | mkremins/starfreighter | pprint.cljs | Copyright ( c ) . All rights reserved .
; The use and distribution terms for this software are covered by the
; Eclipse Public License 1.0 (-1.0.php)
; which can be found in the file epl-v10.html at the root of this distribution.
; By using this software in any fashion, you are agreeing to be bound by
; ... | null | https://raw.githubusercontent.com/mkremins/starfreighter/2be40b4aa5f288bb9829a2e1362a7bfc1e7f12dc/docs/js/app/cljs/pprint.cljs | clojure | The use and distribution terms for this software are covered by the
Eclipse Public License 1.0 (-1.0.php)
which can be found in the file epl-v10.html at the root of this distribution.
By using this software in any fashion, you are agreeing to be bound by
the terms of this license.
You must not remove ... | Copyright ( c ) . All rights reserved .
(ns cljs.pprint
(:refer-clojure :exclude [deftype print println pr prn])
(:require-macros
[cljs.pprint :as m :refer [with-pretty-writer getf setf deftype
pprint-logical-block print-length-loop
defdirecti... |
acc0b7d0ad0bde8762bd8f824ef75a5ffda3fb5cb1832ef38981edb446c28a75 | lueck/standoff-tools | Splitting.hs | module StandOff.Splitting
( splitExternal
, merge
, splitOverlapping
)
where
import StandOff.TextRange
import StandOff.MarkupTree
-- | Make a list of non-overlapping ranges from a list of
-- (potentially) overlapping ranges by splitting overlapping
-- ranges. So the result is something, that could be represe... | null | https://raw.githubusercontent.com/lueck/standoff-tools/40305de78294a8e88579e50347a8a0b3d032b438/src/StandOff/Splitting.hs | haskell | | Make a list of non-overlapping ranges from a list of
(potentially) overlapping ranges by splitting overlapping
ranges. So the result is something, that could be represented as a
tree. We can look at it as if (quasi) it was a tree.
| Not really merge, but SPLIT an annotation depending on the
'Tree'. This functio... | module StandOff.Splitting
( splitExternal
, merge
, splitOverlapping
)
where
import StandOff.TextRange
import StandOff.MarkupTree
splitExternal :: (TextRange a) => [a] -> [a]
splitExternal = sortTextRanges . spltExtRec . sortTextRanges
spltExtRec :: (TextRange a) => [a] -> [a]
spltExtRec [] = []
spltExtRec ... |
ae6c5ad178774013ce21cc7d3a4f094399dcfdfc3c388f2dbe8006207957b54c | blindglobe/common-lisp-stat | stackloss.lisp |
From LispStat 1 : need to document source appropriately .
(in-package :lisp-stat-data-examples)
FIXME : Shutup compiler warnings , need to clean up and
;;; appropriately initialize.
(DEF LOSS (QUOTE (42 37 37 28 18 18 19 20 15 14 14 13 11 12 8 7 8 8 9 15 15)))
(DEF AIR (QUOTE (80 80 75 62 62 62 62 62 58 58 58 ... | null | https://raw.githubusercontent.com/blindglobe/common-lisp-stat/0c657e10a4ee7e8d4ef3737f8c2d4e62abace2d8/Data/stackloss.lisp | lisp | appropriately initialize. |
From LispStat 1 : need to document source appropriately .
(in-package :lisp-stat-data-examples)
FIXME : Shutup compiler warnings , need to clean up and
(DEF LOSS (QUOTE (42 37 37 28 18 18 19 20 15 14 14 13 11 12 8 7 8 8 9 15 15)))
(DEF AIR (QUOTE (80 80 75 62 62 62 62 62 58 58 58 58 58 58 50 50 50 50 50 56 70)... |
4035f60d59ed8620566195cb78c0a24a4eb6efee1b7ac765d43a55978f6a354f | postgres-haskell/postgres-wire | Encoders.hs | module Database.PostgreSQL.Protocol.Codecs.Encoders
( bool
, bytea
, char
, date
, float4
, float8
, int2
, int4
, int8
, interval
, bsJsonText
, bsJsonBytes
, numeric
, bsText
, time
, timetz
, timestamp
, timestamptz
, uuid
) where
impo... | null | https://raw.githubusercontent.com/postgres-haskell/postgres-wire/fda5e3b70c3cc0bab8365b4b872991d50da0348c/src/Database/PostgreSQL/Protocol/Codecs/Encoders.hs | haskell |
Primitives
# INLINE bsJsonBytes #
| Encodes text. | module Database.PostgreSQL.Protocol.Codecs.Encoders
( bool
, bytea
, char
, date
, float4
, float8
, int2
, int4
, int8
, interval
, bsJsonText
, bsJsonBytes
, numeric
, bsText
, time
, timetz
, timestamp
, timestamptz
, uuid
) where
impo... |
bda0a6fa0776180c41046e6afc41cc4ffe67b257afda61b1762df2d2c478f6cb | vodori/missing | paths.clj | (ns missing.paths
(:import (java.util Set Map List)))
(defprotocol PathSeq
(path-seq* [form path] "Helper for path-seq"))
(extend-protocol PathSeq
List
(path-seq*
[form path]
(->> form
(map-indexed
(fn [idx item]
(path-seq* item ((fnil conj []) path idx))))
(m... | null | https://raw.githubusercontent.com/vodori/missing/aec1678a1fecf781f11174a4fbad0315ce37f981/src/missing/paths.clj | clojure | (ns missing.paths
(:import (java.util Set Map List)))
(defprotocol PathSeq
(path-seq* [form path] "Helper for path-seq"))
(extend-protocol PathSeq
List
(path-seq*
[form path]
(->> form
(map-indexed
(fn [idx item]
(path-seq* item ((fnil conj []) path idx))))
(m... | |
2ee95476a32782a24b7c2023e57939944ed3b3f228243ed28f9c2cfedda25be0 | benrady/specific | matchers.clj | (ns specific.matchers
(:require [clojure.spec.alpha :as spec]
[clojure.test :as ctest]))
(defn- conform-or-explain [spc act]
(if (spec/valid? spc act)
(spec/conform spc act)
(spec/explain-str spc act)))
(defn- find-spec [exp]
(if (spec/spec? exp)
exp
(spec/get-spec exp)))
(defn matc... | null | https://raw.githubusercontent.com/benrady/specific/e1b790f2be2d577e49817472177bcc0136a2545a/src/specific/matchers.clj | clojure | (ns specific.matchers
(:require [clojure.spec.alpha :as spec]
[clojure.test :as ctest]))
(defn- conform-or-explain [spc act]
(if (spec/valid? spc act)
(spec/conform spc act)
(spec/explain-str spc act)))
(defn- find-spec [exp]
(if (spec/spec? exp)
exp
(spec/get-spec exp)))
(defn matc... | |
1750d9b7aed4f0d04b48a74fdd04bde641351ebef6d56e993a328a59d138c749 | MyDataFlow/ttalk-server | http_stream_body.erl | %% Feel free to use, reuse and abuse the code in this file.
-module(http_stream_body).
-behaviour(cowboy_http_handler).
-export([init/3, handle/2, terminate/3]).
-record(state, {headers, body, reply}).
init({_Transport, http}, Req, Opts) ->
Headers = proplists:get_value(headers, Opts, []),
Body = proplists:get_val... | null | https://raw.githubusercontent.com/MyDataFlow/ttalk-server/07a60d5d74cd86aedd1f19c922d9d3abf2ebf28d/deps/cowboy/test/http_SUITE_data/http_stream_body.erl | erlang | Feel free to use, reuse and abuse the code in this file.
Here Body should be a list of chunks, not a binary. |
-module(http_stream_body).
-behaviour(cowboy_http_handler).
-export([init/3, handle/2, terminate/3]).
-record(state, {headers, body, reply}).
init({_Transport, http}, Req, Opts) ->
Headers = proplists:get_value(headers, Opts, []),
Body = proplists:get_value(body, Opts, "http_handler_stream_body"),
Reply = proplis... |
e4ac7e4b68280c3c4ef75249f9bbf2a8f265ff05b469dcebcece8cdfa51bb4ff | piranha/showkr | figwheel.cljs | (ns showkr.figwheel
(:require [figwheel.client :as fw :include-macros true]
[showkr.data :as data]
[showkr :refer [render]]))
(fw/watch-and-reload :jsload-callback
(fn [] (swap! data/opts update :dev-reload not)))
| null | https://raw.githubusercontent.com/piranha/showkr/f40786ca145390c103e452cdef0ee57e2de95b79/src-dev/showkr/figwheel.cljs | clojure | (ns showkr.figwheel
(:require [figwheel.client :as fw :include-macros true]
[showkr.data :as data]
[showkr :refer [render]]))
(fw/watch-and-reload :jsload-callback
(fn [] (swap! data/opts update :dev-reload not)))
| |
8e23461b889416ed60502062caab6be8f3051965b72839f41eab0c991e99c53c | jumarko/clojure-experiments | classloading.clj | (ns clojure-experiments.java.classloading)
;;; Classpath is a lie: -08-25-classpath-is-a-lie
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(defn classloader-chain [cl]
(take-while some? (iterate #(.getParent %) cl)))
Note : There is actually one more ClassLoader , the BootL... | null | https://raw.githubusercontent.com/jumarko/clojure-experiments/6088595d4a51c18ca58d0391f91d780b9bd6e1d1/src/clojure_experiments/java/classloading.clj | clojure | Classpath is a lie: -08-25-classpath-is-a-lie
but it’s built-in to the virtual machine, you don’t get to see it. It’s represented by nil.
... MANY MORE ...
#object[clojure.lang.DynamicClassLoader 0x2823bbe4 "clojure.lang.DynamicClassLoader@2823bbe4"]
; = >
Once upon a class: -05-12T13_24.html
=> (#obje... | (ns clojure-experiments.java.classloading)
(defn classloader-chain [cl]
(take-while some? (iterate #(.getParent %) cl)))
Note : There is actually one more ClassLoader , the BootLoader ,
(classloader-chain (clojure.lang.RT/baseLoader))
= > ( # object[clojure.lang . DynamicClassLoader 0x78e5472a " clojure.lang . ... |
4c5490ea57249dd1987247147c02de96e0d0f08695d07886c5c3a52a5bf0d2b2 | jumarko/clojure-experiments | pascal_triangle.clj | (ns four-clojure.pascal-triangle)
;;;
Write a function which returns the nth row of 's Triangle
(defn pascal-triangle [row-num]
(if (= 1 row-num)
[1]
(let [previous-row (pascal-triangle (dec row-num))
current-row (repeat row-num 1)]
(map-indexed
(fn [index element]
(if (<... | null | https://raw.githubusercontent.com/jumarko/clojure-experiments/f0f9c091959e7f54c3fb13d0585a793ebb09e4f9/src/clojure_experiments/four_clojure/pascal_triangle.clj | clojure | (ns four-clojure.pascal-triangle)
Write a function which returns the nth row of 's Triangle
(defn pascal-triangle [row-num]
(if (= 1 row-num)
[1]
(let [previous-row (pascal-triangle (dec row-num))
current-row (repeat row-num 1)]
(map-indexed
(fn [index element]
(if (< 0 in... | |
ad47da98a72f53a59c04500a46293286d8395195bbec6e7cdcda96fc3db4f29b | thorinii/hsraytrace | Ray.hs | {-# LANGUAGE BangPatterns #-}
module Ray (
Ray(Ray),
ray_pointAtTime,
makeRay
) where
import Prelude as P
import Vector as V
data Ray = Ray { ray_base :: !Vec3
, ray_direction :: !Vec3 }
deriving (Show)
ray_pointAtTime :: Ray -> Float -> Vec3
ray_pointAtTime (Ray base dir) time = base `V.add`... | null | https://raw.githubusercontent.com/thorinii/hsraytrace/2d606aef4ba3be404a3a3a16753099fb7c6603e8/src/Ray.hs | haskell | # LANGUAGE BangPatterns # | module Ray (
Ray(Ray),
ray_pointAtTime,
makeRay
) where
import Prelude as P
import Vector as V
data Ray = Ray { ray_base :: !Vec3
, ray_direction :: !Vec3 }
deriving (Show)
ray_pointAtTime :: Ray -> Float -> Vec3
ray_pointAtTime (Ray base dir) time = base `V.add` (dir `scalarmult` time)
mak... |
dd550aebcbb6c1a4a51d1dbbca09fc0f61e431b8b0ffd9cb778fa02d75d77566 | heyoka/faxe | c_python3.erl | Date : 10.11.22 - 14:11
Ⓒ 2022 heyoka
%%%
%%% @doc
version 2 of faxe 's python interface , has a more streamlined data interface
%%% supporting complete data-point and data-batch python representations
in python data items are still dicts
-module(c_python3).
-author("Alexander Minichmair").
-include("faxe.hrl... | null | https://raw.githubusercontent.com/heyoka/faxe/301bbd2195b176e30e00d287c948448f336577e7/apps/faxe/src/components/c_python3.erl | erlang |
@doc
supporting complete data-point and data-batch python representations
API
API
python method calls
@doc get the options to recognize in dfs for the python node (from the callback class)
create an instance of the callback class
lager:notice("send batch json to python with size: ~p", [length(Points)]),
pyt... | Date : 10.11.22 - 14:11
Ⓒ 2022 heyoka
version 2 of faxe 's python interface , has a more streamlined data interface
in python data items are still dicts
-module(c_python3).
-author("Alexander Minichmair").
-include("faxe.hrl").
-behavior(df_component).
-export([
init/3, process/3,
handle_info/2, options... |
b247807ca4190da61f8a1108eaba6db5059ad3d9552c65ed82007a60b836e9f5 | ngless-toolkit/ngless | Utils.hs | # LANGUAGE FlexibleContexts , ScopedTypeVariables #
module Data.FastQ.Utils
( concatenateFQs
, interleaveFQs
) where
import qualified Data.Conduit as C
import qualified Data.Conduit.Binary as CB
import qualified Data.ByteString.Char8 as B8
import qualified Data.ByteString as B
import Data.Condui... | null | https://raw.githubusercontent.com/ngless-toolkit/ngless/b024c6e62af8e88fa617100f19a9b965cde2e1c5/NGLess/Data/FastQ/Utils.hs | haskell | # LANGUAGE FlexibleContexts , ScopedTypeVariables #
module Data.FastQ.Utils
( concatenateFQs
, interleaveFQs
) where
import qualified Data.Conduit as C
import qualified Data.Conduit.Binary as CB
import qualified Data.ByteString.Char8 as B8
import qualified Data.ByteString as B
import Data.Condui... | |
73e3da2ab5a16c75a8ef08c0b15d8e1169347a03e2c81c1ab3fbe142878b76f7 | IGJoshua/glfw-clj | core.clj | (ns glfw-clj.core
"Wrappers for GLFW functions.
Any function that does not explicitly say it can be called from any thread
should be called only from the main thread.
GLFW enums are represented with keywords in this namespace sans the `GLFW_`
prefix, and are in lower kebab case. `GLFW_TRUE` and `GLFW_FALSE`... | null | https://raw.githubusercontent.com/IGJoshua/glfw-clj/291dc405f6118130fd7c1abd5de5f3929e1c76cc/src/glfw_clj/core.clj | clojure | because anything that gets thrown past a callback
FIXME(Joshua): If this is used for a callback that
returns a non-void type, this will still crash.
Initialization and Error Handling
Window Management
Context Creation
Monitors
Input | (ns glfw-clj.core
"Wrappers for GLFW functions.
Any function that does not explicitly say it can be called from any thread
should be called only from the main thread.
GLFW enums are represented with keywords in this namespace sans the `GLFW_`
prefix, and are in lower kebab case. `GLFW_TRUE` and `GLFW_FALSE`... |
689fee1044858858170f5deb4c0bc2f0f76ecda49849756130df8d02434487c0 | amnh/poy5 | pdfdoc.ml | (* \chaptertitle{PdfDoc}{Document-level functions} *)
open Utility
open Pdf
(* \section{Types} *)
\intf The type of the four rotations of pages . This defines how a viewing
application ( e.g Acrobat ) displays the page .
application (e.g Acrobat) displays the page. *)
type rotation =
Rotate0 | Rotate90... | null | https://raw.githubusercontent.com/amnh/poy5/da563a2339d3fa9c0110ae86cc35fad576f728ab/src/camlpdf-0.3/pdfdoc.ml | ocaml | \chaptertitle{PdfDoc}{Document-level functions}
\section{Types}
\intf A type representing a page. [content] is the list of objects
containing the graphical content stream (see the [Pdfpages] module), [mediabox]
the page size, [resources] the page's resource dictionary, [rotate] its rotation
and [rest] any other... | open Utility
open Pdf
\intf The type of the four rotations of pages . This defines how a viewing
application ( e.g Acrobat ) displays the page .
application (e.g Acrobat) displays the page. *)
type rotation =
Rotate0 | Rotate90 | Rotate180 | Rotate270
type page =
{content : pdfobject list;
medi... |
5340a538d928c036f194b7e89d2d9000ebd28c57eb9259c4d92e22e1e965a483 | thelema/ocaml-community | jg_multibox.mli | (*************************************************************************)
(* *)
(* OCaml LablTk library *)
(* *)
,... | null | https://raw.githubusercontent.com/thelema/ocaml-community/ed0a2424bbf13d1b33292725e089f0d7ba94b540/otherlibs/labltk/browser/jg_multibox.mli | ocaml | ***********************************************************************
OCaml LablTk library
... | , Kyoto University RIMS
Copyright 1999 Institut National de Recherche en Informatique et
en Automatique and Kyoto University . All rights reserved .
This file is distributed under the terms of the GNU Library
$ Id$
class c :
cols:int -> texts... |
e32868a38a948e044d99cecaa9421d8b23ce0e617033b0ffdef13b80546f48ca | clash-lang/clash-compiler | T2154.hs | module T2154 where
import Clash.Explicit.Prelude
topEntity (clk :: Clock System) rst =
let r = unpack (pack ( errorX "T2154" :: (Index 10)
, 3 :: Index 10
)) :: Vec 2 (Index 10)
s = register clk rst enableGen (seq r r) s
in s
| null | https://raw.githubusercontent.com/clash-lang/clash-compiler/e502f16e44b57a23b2f5c945a7b295168be9a684/tests/shouldwork/Issues/T2154.hs | haskell | module T2154 where
import Clash.Explicit.Prelude
topEntity (clk :: Clock System) rst =
let r = unpack (pack ( errorX "T2154" :: (Index 10)
, 3 :: Index 10
)) :: Vec 2 (Index 10)
s = register clk rst enableGen (seq r r) s
in s
| |
ccf054156a03ab5cab5457c108e633b08645a90a93ac493cdd0796194d530046 | travitch/persistent-vector | Persistent.hs | # LANGUAGE MagicHash #
# LANGUAGE UnboxedTuples #
{-# LANGUAGE BangPatterns #-}
{- OPTIONS_GHC -Wall #-}
| This is a port of the persistent vector from clojure to Haskell .
-- It is spine-strict and lazy in the elements.
--
-- The implementation is based on array mapped tries. The complexity
-- bounds given are mos... | null | https://raw.githubusercontent.com/travitch/persistent-vector/db2a8dcb531eac504fe1e193be998a7b95e187db/src/Data/Vector/Persistent.hs | haskell | # LANGUAGE BangPatterns #
OPTIONS_GHC -Wall #
It is spine-strict and lazy in the elements.
The implementation is based on array mapped tries. The complexity
bounds given are mostly O(1), but only if you are willing to accept
* Construction
* Queries
* Indexing
** Slicing Storage Management
* Modification
* ... | # LANGUAGE MagicHash #
# LANGUAGE UnboxedTuples #
| This is a port of the persistent vector from clojure to Haskell .
that the tree can not have height greater than 7 on 32 bit systems
and maybe 8 on 64 bit systems .
# LANGUAGE CPP #
# LANGUAGE ScopedTypeVariables #
options_ghc -ddump - simpl #
module Data.Ve... |
5a73c9bea18795d60ea1cb8eaaea6b8800ce124fd321fb6cb7200b9e90c8541e | jstolarek/dep-typed-wbl-heaps-hs | RankProof.hs | -----------------------------------------------------------------------
Copyright : 2014 , , Politechnika Łódzka --
-- --
-- License: See LICENSE file in root of the repo --
Repo address : -typed-wbl-heaps-hs --
... | null | https://raw.githubusercontent.com/jstolarek/dep-typed-wbl-heaps-hs/0d6e354cbb71056a3eb9df9ebdc788182e137d1d/src/SinglePassMerge/RankProof.hs | haskell | ---------------------------------------------------------------------
--
License: See LICENSE file in root of the repo --
--
Weight biased leftist heap that prove... |
# LANGUAGE GADTs #
# LANGUAGE NoImplicitPrelude #
# LANGUAGE ScopedTypeVariables #
module SinglePassMerge.RankProof where
import Basics
import TwoPassMerge.RankProof ( makeTlemma )
import qualified TwoPassMerge.RankProof as RP ( proof1, proof2 )
data Heap :: Nat -> * where
Empty :: Heap Zero
No... |
1ed3c3a00f67194654cd5951b745ba26b66587aaea6148af8d7764fdf20ca57e | OpenC2-org/ocas | act_deny.erl | @author
( C ) 2017 , sFractal Consulting LLC
-module(act_deny).
%%%-------------------------------------------------------------------
%%%
%%% All rights reserved.
Licensed under the Apache License , Version 2.0 ( the " License " ) ;
%%%
%%% Redistribution and use in source and binary forms, with or without
%%... | null | https://raw.githubusercontent.com/OpenC2-org/ocas/c15132d9f37b1e0e29884456a520557c25b22f38/apps/ocas/src/action_servers/act_deny.erl | erlang | -------------------------------------------------------------------
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... | @author
( C ) 2017 , sFractal Consulting LLC
-module(act_deny).
Licensed under the Apache License , Version 2.0 ( the " License " ) ;
" AS IS " AND ANY EXPRESS OR IMPLIED WARRANTIES , INCLUDING , BUT NOT
OWNER OR ANY DIRECT , INDIRECT , INCIDENTAL ,
SPECIAL , EXEMPLARY , OR CONSEQUENTIAL DAMAGES ( IN... |
e0959fb517e677fd2f35e1e1cf060b5a94d95969bf9083f69420a9cf8896caa4 | ocaml-sf/learn-ocaml-corpus | consume_does_not_consume.ml | (* The data values carried by the leaves of a tree. *)
let rec elements t xs =
match t with
| Leaf x ->
x :: xs
| Fork (t, u) ->
elements t (elements u xs)
let elements (t : 'a tree) : 'a list =
elements t []
(* The depths of the leaves of a tree. *)
let rec depths d t ds =
match t with
| Le... | null | https://raw.githubusercontent.com/ocaml-sf/learn-ocaml-corpus/7dcf4d72b49863a3e37e41b3c3097aa4c6101a69/exercises/fpottier/spectre/wrong/consume_does_not_consume.ml | ocaml | The data values carried by the leaves of a tree.
The depths of the leaves of a tree.
The elements and depths, combined.
A direct definition can also be given.
A facility for reading and consuming the elements of a list.
wrong |
let rec elements t xs =
match t with
| Leaf x ->
x :: xs
| Fork (t, u) ->
elements t (elements u xs)
let elements (t : 'a tree) : 'a list =
elements t []
let rec depths d t ds =
match t with
| Leaf _ ->
d :: ds
| Fork (t, u) ->
depths (d + 1) t (depths (d + 1) u ds)
let depths... |
3afa0f34093bc80e1327362f71a4fbc99bfaa7274f98820f92378c25934d3e62 | plande/grand-scheme | define-keywords.scm | (define-module (grand define-keywords)
#:use-module (ice-9 match)
#:replace ((lambda/kw . lambda*)
(define/kw . define*)))
(define (keyword-arg? x)
(and (keyword? x)
(not (eq? x #:=))))
(define (remove-attributes attributes #;from attribute-list)
(match attribute-list
(((? keyword? key) valu... | null | https://raw.githubusercontent.com/plande/grand-scheme/72726e90e176a0f9b8eabd0e58ff73e2c9cd1c2e/grand/define-keywords.scm | scheme | from attribute-list)
from rest))))
opt ( ) # ; kw ( )
destruct () body)) | (define-module (grand define-keywords)
#:use-module (ice-9 match)
#:replace ((lambda/kw . lambda*)
(define/kw . define*)))
(define (keyword-arg? x)
(and (keyword? x)
(not (eq? x #:=))))
(match attribute-list
(((? keyword? key) value . rest)
(if (member key attributes)
(remove-attribut... |
080c58f3ff5ccb87844ab03f388fd743c86eaeae711e88acdb9f0dd23baf4a7f | adamConnerSax/Frames-map-reduce | AddRowsByLabel.hs | # LANGUAGE DataKinds #
# LANGUAGE FlexibleInstances #
# LANGUAGE FlexibleContexts #
# LANGUAGE InstanceSigs #
{-# LANGUAGE OverloadedStrings #-}
# LANGUAGE PolyKinds #
{-# LANGUAGE RankNTypes #-}
# LANGUAGE TypeApplications #
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE TypeOperators ... | null | https://raw.githubusercontent.com/adamConnerSax/Frames-map-reduce/4e762c9ff87d1e064912847c3591f75d0126a323/examples/AddRowsByLabel.hs | haskell | # LANGUAGE OverloadedStrings #
# LANGUAGE RankNTypes #
# LANGUAGE TypeFamilies #
# LANGUAGE TypeOperators #
Create types for the cols
filter, leaving only rows with labels 'A', 'B' or 'C'
group the rest of the cols by Label
sum the data columns and then re-at... | # LANGUAGE DataKinds #
# LANGUAGE FlexibleInstances #
# LANGUAGE FlexibleContexts #
# LANGUAGE InstanceSigs #
# LANGUAGE PolyKinds #
# LANGUAGE TypeApplications #
module Main where
import qualified Control.Foldl as FL
import qualified Data.List as L
impor... |
f2a2c7de3070f41436fe4ea5789d5116d5869bd902bcb74230c1ce4ff14ba5cd | clojure-interop/aws-api | AWSResourceGroupsTaggingAPI.clj | (ns com.amazonaws.services.resourcegroupstaggingapi.AWSResourceGroupsTaggingAPI
"Interface for accessing AWS Resource Groups Tagging API.
Note: Do not directly implement this interface, new methods are added to it regularly. Extend from
AbstractAWSResourceGroupsTaggingAPI instead.
Resource Groups Tagging API... | null | https://raw.githubusercontent.com/clojure-interop/aws-api/59249b43d3bfaff0a79f5f4f8b7bc22518a3bf14/com.amazonaws.services.resourcegroupstaggingapi/src/com/amazonaws/services/resourcegroupstaggingapi/AWSResourceGroupsTaggingAPI.clj | clojure | (ns com.amazonaws.services.resourcegroupstaggingapi.AWSResourceGroupsTaggingAPI
"Interface for accessing AWS Resource Groups Tagging API.
Note: Do not directly implement this interface, new methods are added to it regularly. Extend from
AbstractAWSResourceGroupsTaggingAPI instead.
Resource Groups Tagging API... | |
cb37874208e44acbc520150a13116793400162014848852eb296dc1504710ba5 | arclanguage/Clamp | package.lisp | ;;;; This is the package declaration for clamp.
(defpackage :clamp
(:nicknames :clamp)
(:use :common-lisp :iterate)
(:shadow :do :map :if :case := :ccase :ecase :typecase :rem :let
:find :count :sort :++ :read :read-line :get :set
:last :summing :with :repeat :while :until :in :string)
(:... | null | https://raw.githubusercontent.com/arclanguage/Clamp/9f165b057a109564cd0e836cf611d1e81e43cb12/src/package.lisp | lisp | This is the package declaration for clamp.
From defalias.
From aliases
From base.
From binding.
From print.
From time.
From hof.
From conditionals.
From list.
From macros.
From iter.
From misc.
From fnops.
From sort.
From memoize.
From tables.
From io.
From strings.
From read.
From disk.
From code... |
(defpackage :clamp
(:nicknames :clamp)
(:use :common-lisp :iterate)
(:shadow :do :map :if :case := :ccase :ecase :typecase :rem :let
:find :count :sort :++ :read :read-line :get :set
:last :summing :with :repeat :while :until :in :string)
(:import-from :syntax :define-package-syntax :use-... |
c931e79b34c43055d939f8c870633160794887d060bb1c4b0dccfc961659aadb | deobald/sicp-clojure | core.clj | (comment
Sample clojure source file
)
(ns sicp
(:gen-class))
(defn -main
([greetee]
(println (str "Hello " greetee "!")))
([] (-main "world")))
| null | https://raw.githubusercontent.com/deobald/sicp-clojure/fc24e5114604e7a0510dab779bbff962aac7ee7e/build/classes/default/core.clj | clojure | (comment
Sample clojure source file
)
(ns sicp
(:gen-class))
(defn -main
([greetee]
(println (str "Hello " greetee "!")))
([] (-main "world")))
| |
166d3076a0a8ae1d7ee79d1c4011f4947058b8a4caabd863a491f7a161d29c3f | jez/calz | ArgParser.hs | # LANGUAGE FlexibleContexts #
{-# LANGUAGE LambdaCase #-}
{-# LANGUAGE QuasiQuotes #-}
module Calz.ArgParser (parseArgv, patterns, ArgvParseError(..)) where
import Control.Monad (when)
import Control.Monad.Except
import qualified Data.Text as T
import Data.... | null | https://raw.githubusercontent.com/jez/calz/dbaf27ec38df7bcdc8356ac400782226ffc61b0d/src/Calz/ArgParser.hs | haskell | # LANGUAGE LambdaCase #
# LANGUAGE QuasiQuotes #
layout=<layout> Can be 'grid' or 'flow' [default: flow]
columns=<n> If layout is 'grid': how many columns to use
no-color Disable all color
help Show this help message
version Show version information
helpers
exit immediate... | # LANGUAGE FlexibleContexts #
module Calz.ArgParser (parseArgv, patterns, ArgvParseError(..)) where
import Control.Monad (when)
import Control.Monad.Except
import qualified Data.Text as T
import Data.Time
import System.Console.Docopt
import Calz.D... |
e7775c93514187823e3fae0b82807acf518e13746ed5552b079b1ce248364afc | igorhvr/bedlam | custom-io.scm | (define-java-classes
<sisc.io.custom.scheme-reader>
<sisc.io.custom.scheme-writer>
<sisc.io.custom.scheme-input-stream>
<sisc.io.custom.scheme-output-stream>
<sisc.io.custom.custom-binary-input-port>
<sisc.io.custom.custom-character-input-port>
<sisc.io.custom.custom-binary-output-port>
<sisc.io.custom.... | null | https://raw.githubusercontent.com/igorhvr/bedlam/b62e0d047105bb0473bdb47c58b23f6ca0f79a4e/sisc/sisc-1.16.6/full-src/sisc/src/sisc/modules/io/custom-io.scm | scheme |
License Version 1.1 (the "License"); you may not use this file
except in compliance with the License. You may obtain a copy of
IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
implied. See the License for the specific language governing
rights and limitations under the License.
Contributor(s):... | (define-java-classes
<sisc.io.custom.scheme-reader>
<sisc.io.custom.scheme-writer>
<sisc.io.custom.scheme-input-stream>
<sisc.io.custom.scheme-output-stream>
<sisc.io.custom.custom-binary-input-port>
<sisc.io.custom.custom-character-input-port>
<sisc.io.custom.custom-binary-output-port>
<sisc.io.custom.... |
59b5301369dcb636908e8a18f99240056cc73e4c0fac4958bd121cc79da1fad4 | palletops/log-config | project.clj | (defproject com.palletops/log-config "0.1.5-SNAPSHOT"
:description "Log appenders and middleware for timbre"
:url "-config"
:license {:name "Eclipse Public License"
:url "-v10.html"}
:dependencies [[org.clojure/clojure "1.5.1"
:scope "provided"]
[org.clojure/tools.... | null | https://raw.githubusercontent.com/palletops/log-config/ff924ac9ea900999324ce44645b2969781cf4b12/project.clj | clojure | (defproject com.palletops/log-config "0.1.5-SNAPSHOT"
:description "Log appenders and middleware for timbre"
:url "-config"
:license {:name "Eclipse Public License"
:url "-v10.html"}
:dependencies [[org.clojure/clojure "1.5.1"
:scope "provided"]
[org.clojure/tools.... | |
3698c1803b6af4a81d78c9848f007301c7db3e84ad03df2e30b5770d9eb589a5 | kit-ty-kate/visitors | Visitors.mli | (* This file intentionally empty. *)
| null | https://raw.githubusercontent.com/kit-ty-kate/visitors/fc53cc486178781e0b1e581eced98e07facb7d29/src/Visitors.mli | ocaml | This file intentionally empty. | |
ae877d36e724caa133dc6933fb69036ef3b2073ff01854ec787634962938f319 | pangloss/pattern | substitute.clj | (ns pattern.substitute
"This namespace implements a data-driven substitution system. It's flexible
but much slower than the one defined in the [[pattern.r3.rewrite]] namespace that fully
precompiles the substitution."
(:require [pattern.match.core :refer [var-name matcher-type-for-dispatch pattern-names *disabl... | null | https://raw.githubusercontent.com/pangloss/pattern/6d615c519663797920fa8019e5a4dbe614a87fbe/src/pattern/substitute.clj | clojure | My pattern substitution combinator | (ns pattern.substitute
"This namespace implements a data-driven substitution system. It's flexible
but much slower than the one defined in the [[pattern.r3.rewrite]] namespace that fully
precompiles the substitution."
(:require [pattern.match.core :refer [var-name matcher-type-for-dispatch pattern-names *disabl... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.