_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 |
|---|---|---|---|---|---|---|---|---|
4185cc3f4a88683c0b54a4bf2c482bbfb7cf4b7e56d2ca2a3684b6e9002d5c69 | lambdamikel/DLMAPS | roles.lisp | ;;; -*- Mode: LISP; Syntax: Common-Lisp; Package: PROVER -*-
(in-package :PROVER)
;;;
;;;
;;;
(defmethod get-all-roles ((tbox tbox))
(let ((roles nil))
(maphash #'(lambda (name role)
(declare (ignorable name))
(push role roles))
(slot-value (concept-store tbox) 'r... | null | https://raw.githubusercontent.com/lambdamikel/DLMAPS/7f8dbb9432069d41e6a7d9c13dc5b25602ad35dc/src/prover/roles.lisp | lisp | -*- Mode: LISP; Syntax: Common-Lisp; Package: PROVER -*-
|
(in-package :PROVER)
(defmethod get-all-roles ((tbox tbox))
(let ((roles nil))
(maphash #'(lambda (name role)
(declare (ignorable name))
(push role roles))
(slot-value (concept-store tbox) 'roles))
(remove-duplicates (sort roles #'< :key #'id))))
(defmethod g... |
0b69e0ebd14e6d6443951b1a6252d13ef311cb7965fc429ee80659a5bf14bdf6 | onyx-platform/onyx | replica.clj | (ns onyx.log.replica)
(def base-replica
{:peers []
:orphaned-peers {}
:groups []
:groups-index {}
:groups-reverse-index {}
:peer-sites {}
:prepared {}
:accepted {}
:aborted #{}
:left #{}
:pairs {}
:jobs []
:task-schedulers {}
:tasks {}
:allocations {}
:task-saturation {}... | null | https://raw.githubusercontent.com/onyx-platform/onyx/74f9ae58cdbcfcb1163464595f1e6ae6444c9782/src/onyx/log/replica.clj | clojure | (ns onyx.log.replica)
(def base-replica
{:peers []
:orphaned-peers {}
:groups []
:groups-index {}
:groups-reverse-index {}
:peer-sites {}
:prepared {}
:accepted {}
:aborted #{}
:left #{}
:pairs {}
:jobs []
:task-schedulers {}
:tasks {}
:allocations {}
:task-saturation {}... | |
00614015071c3e5bef6957b02d5622c20161bc33c5320ff5ed6f89e057f7ca3e | jwiegley/notes | Hylo.hs | # LANGUAGE DeriveFunctor #
module Hylo where
data Identity a = Identity { runIdentity :: a } deriving Functor
newtype Compose f g a = Compose { getCompose :: f (g a) }
newtype Fix f = Fix { unFix :: f (Fix f) }
newtype Free f a = Free { runFree :: Fix (Compose (Either a) f)}
instance Functor f => Functor (Free f)... | null | https://raw.githubusercontent.com/jwiegley/notes/24574b02bfd869845faa1521854f90e4e8bf5e9a/haskell/Hylo.hs | haskell | | Anamorphism or generic function unfold. | # LANGUAGE DeriveFunctor #
module Hylo where
data Identity a = Identity { runIdentity :: a } deriving Functor
newtype Compose f g a = Compose { getCompose :: f (g a) }
newtype Fix f = Fix { unFix :: f (Fix f) }
newtype Free f a = Free { runFree :: Fix (Compose (Either a) f)}
instance Functor f => Functor (Free f)... |
e7409b4792955016d9c6cbd5c17c7eaa4ad2728ce5f3eca7716d753e4743d9b1 | ocaml-multicore/tezos | test_consensus_filter.ml | (*****************************************************************************)
(* *)
(* Open Source License *)
Copyright ( c ) 2021 Nomadic Labs , < >
(* ... | null | https://raw.githubusercontent.com/ocaml-multicore/tezos/e4fd21a1cb02d194b3162ab42d512b7c985ee8a9/src/proto_alpha/lib_plugin/test/test_consensus_filter.ml | ocaml | ***************************************************************************
Open Source License
Permission is h... | Copyright ( c ) 2021 Nomadic Labs , < >
to deal in the Software without restriction , including without limitation
and/or sell copies of the Software , and to permit persons to whom the
THE SOFTWARE IS PROVIDED " AS IS " , WITHOUT WARRANTY OF ANY KIND , EXPRESS OR
LIABILITY , WHETHER IN A... |
1c23e3baf60908fb169d581367b4f658b375cbb131160a1747e526fd3f7f5e9e | exoscale/clojure-kubernetes-client | v1alpha1_volume_error.clj | (ns clojure-kubernetes-client.specs.v1alpha1-volume-error
(:require [clojure.spec.alpha :as s]
[spec-tools.data-spec :as ds]
)
(:import (java.io File)))
(declare v1alpha1-volume-error-data v1alpha1-volume-error)
(def v1alpha1-volume-error-data
{
(ds/opt :message) string?
(ds/opt :t... | null | https://raw.githubusercontent.com/exoscale/clojure-kubernetes-client/79d84417f28d048c5ac015c17e3926c73e6ac668/src/clojure_kubernetes_client/specs/v1alpha1_volume_error.clj | clojure | (ns clojure-kubernetes-client.specs.v1alpha1-volume-error
(:require [clojure.spec.alpha :as s]
[spec-tools.data-spec :as ds]
)
(:import (java.io File)))
(declare v1alpha1-volume-error-data v1alpha1-volume-error)
(def v1alpha1-volume-error-data
{
(ds/opt :message) string?
(ds/opt :t... | |
4d4b63596526e5a007495473f843f5a70f4e21fb0a249b4a717486e00a88034f | emc2/clash-riscv | Opcode32.hs | Copyright ( c ) 2017 . All rights reserved .
--
-- Redistribution and use in source and binary forms, with or without
-- modification, are permitted provided that the following conditions
-- are met:
1 . Redistributions of source code must retain the above copyright
-- notice, this list of conditions and the... | null | https://raw.githubusercontent.com/emc2/clash-riscv/e7404e5f9ff6b1eb22274bf7daa34bbd2768f2a3/src/RISCV/ISA/Opcodes/Opcode32.hs | haskell |
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
notice, this list of conditions and the following disclaimer.
notice, this list of conditions and the following disclaimer in the
documentation and/or other mate... | Copyright ( c ) 2017 . All rights reserved .
1 . Redistributions of source code must retain the above copyright
2 . Redistributions in binary form must reproduce the above copyright
3 . Neither the name of the author nor the names of any contributors
THIS SOFTWARE IS PROVIDED BY THE AUTHORS AND CONTRIBUTO... |
28acfbc5ef4a29786216a7548ce012b1b8aaf89e8ca7202c2fe8c8a6a377ad0d | VisionsGlobalEmpowerment/webchange | icon_trophy.cljs | (ns webchange.ui-framework.components.icon.icon-trophy)
(def data
[:svg {:width "24" :height "24" :viewBox "0 0 24 24" :fill "none" :xmlns ""
:class-name "stroke-colored" :stroke "#DCE3F5" :stroke-width "2" :stroke-linecap "round" :stroke-linejoin "round"}
[:path {:d "M5.25 5.25V10.4153C5.25 14.1372 8.22... | null | https://raw.githubusercontent.com/VisionsGlobalEmpowerment/webchange/1f9d093d328248629001ee6ace0464058312a6ea/src/cljs/webchange/ui_framework/components/icon/icon_trophy.cljs | clojure | (ns webchange.ui-framework.components.icon.icon-trophy)
(def data
[:svg {:width "24" :height "24" :viewBox "0 0 24 24" :fill "none" :xmlns ""
:class-name "stroke-colored" :stroke "#DCE3F5" :stroke-width "2" :stroke-linecap "round" :stroke-linejoin "round"}
[:path {:d "M5.25 5.25V10.4153C5.25 14.1372 8.22... | |
c0529ad88d02c3986a257931b734123126555515a3c374352e00c384e32acd43 | haskell-servant/servant-quickcheck | ErrorTypes.hs | # LANGUAGE CPP #
module Servant.QuickCheck.Internal.ErrorTypes where
import Control.Exception (Exception (..))
import qualified Data.ByteString.Lazy as LBS
import Data.String.Conversions (cs)
import qualified Data.Text as T
import Data.Typeable (Typeable)
... | null | https://raw.githubusercontent.com/haskell-servant/servant-quickcheck/0535413b1a1e3f3e3f4dfdc3199761774513cce6/src/Servant/QuickCheck/Internal/ErrorTypes.hs | haskell | * Pretty printing | # LANGUAGE CPP #
module Servant.QuickCheck.Internal.ErrorTypes where
import Control.Exception (Exception (..))
import qualified Data.ByteString.Lazy as LBS
import Data.String.Conversions (cs)
import qualified Data.Text as T
import Data.Typeable (Typeable)
... |
cba86c3520a634f2e6921acc7551b468f659e90f2a069a7b304af54b6799234b | bmeurer/ocaml-experimental | tprintf.ml | open Testing;;
open Printf;;
(* Padding floating point numbers.
Testing * width specifications. *)
let test0 () =
sprintf "%.0f" 1.0 = "1" &&
sprintf "%.0f." 1.7 = "2." &&
sprintf "%.1f." 1.0 = "1.0." &&
sprintf "%0.1f." 12.0 = "12.0." &&
sprintf "%3.1f." 12.0 = "12.0." &&
sprintf "%5.1f." 12.0 = " 12.... | null | https://raw.githubusercontent.com/bmeurer/ocaml-experimental/fe5c10cdb0499e43af4b08f35a3248e5c1a8b541/testsuite/tests/basic-more/tprintf.ml | ocaml | Padding floating point numbers.
Testing * width specifications.
FIXME: when positional specification will be OK.
Testing meta format string printing.
Testing meta format string arguments. | open Testing;;
open Printf;;
let test0 () =
sprintf "%.0f" 1.0 = "1" &&
sprintf "%.0f." 1.7 = "2." &&
sprintf "%.1f." 1.0 = "1.0." &&
sprintf "%0.1f." 12.0 = "12.0." &&
sprintf "%3.1f." 12.0 = "12.0." &&
sprintf "%5.1f." 12.0 = " 12.0." &&
sprintf "%10.1f." 12.0 = " 12.0." &&
sprintf "%010.1f." 1... |
81f6a18296fae8e1d2ceca80121444131608f0283342045a6f92b872b2359ba7 | mirage/ocaml-evtchn | eventchn.ml |
* Copyright ( C ) 2006 - 2014 Citrix Inc.
* Copyright ( c ) 2010 < >
*
* Permission to use , copy , modify , and distribute this software for any
* purpose with or without fee is hereby granted , provided that the above
* copyright notice and this permission notice appear in all copies .
*
* ... | null | https://raw.githubusercontent.com/mirage/ocaml-evtchn/d5b8aa44587b4e3281ff26284a200ba4a960eb8c/lib/eventchn.ml | ocaml | We'd rather leak connections than suffer use-after-free |
* Copyright ( C ) 2006 - 2014 Citrix Inc.
* Copyright ( c ) 2010 < >
*
* Permission to use , copy , modify , and distribute this software for any
* purpose with or without fee is hereby granted , provided that the above
* copyright notice and this permission notice appear in all copies .
*
* ... |
9de0053b59da5b7c3f29ea7f7d81b9b6dac61aef9fca4db99f2f037b71a24b77 | Zetawar/zetawar | datascript.cljs | (ns zetawar.system.datascript
(:require
[datascript.core :as d]
[integrant.core :as ig]))
(defmethod ig/init-key :zetawar.system/datascript [_ opts]
(let [{:keys [schema]} opts]
{:schema schema
:conn (d/create-conn schema)}))
(defmethod ig/resume-key :zetawar.system/datascript [_ opts old-opts old-... | null | https://raw.githubusercontent.com/Zetawar/zetawar/dc1ee8d27afcac1cd98904859289012c2806e58c/src/cljs/zetawar/system/datascript.cljs | clojure | (ns zetawar.system.datascript
(:require
[datascript.core :as d]
[integrant.core :as ig]))
(defmethod ig/init-key :zetawar.system/datascript [_ opts]
(let [{:keys [schema]} opts]
{:schema schema
:conn (d/create-conn schema)}))
(defmethod ig/resume-key :zetawar.system/datascript [_ opts old-opts old-... | |
b9b4b0e959bbcead9de9ee9f31b33d5d3a9adad9a00611175045097bc289d8c3 | Mishio595/disml | channel_id.ml | open Core
include Channel_id_t
exception Invalid_message
exception No_message_found
let send_message ?embed ?content ?file ?(tts=false) ch =
let embed = match embed with
| Some e -> Embed.to_yojson e
| None -> `Null in
let content = match content with
| Some c -> `String c
| None -... | null | https://raw.githubusercontent.com/Mishio595/disml/cbb1e47a6d358eace03790c07a1b85641f4ca366/lib/models/id/channel_id.ml | ocaml | open Core
include Channel_id_t
exception Invalid_message
exception No_message_found
let send_message ?embed ?content ?file ?(tts=false) ch =
let embed = match embed with
| Some e -> Embed.to_yojson e
| None -> `Null in
let content = match content with
| Some c -> `String c
| None -... | |
c277be65e10b3bbfcef8c35f2ed455710a317b90b341b1009a955040a6f65dd0 | bobzhang/fan | dump_ast.ml |
let input_file = Sys.argv.[1]
(* let _ = begin *)
Pparse .
(* end *)
| null | https://raw.githubusercontent.com/bobzhang/fan/7ed527d96c5a006da43d3813f32ad8a5baa31b7f/src/tools/dump_ast.ml | ocaml | let _ = begin
end |
let input_file = Sys.argv.[1]
Pparse .
|
d8ff6cbff175705f0d1fe524ee11b0b657e093c9a6518d829b92fd4df2c73d27 | rtrusso/scp | set1.scm | (define foo 3)
(set! foo 5)
(display foo)
(newline)
(define x
(let ((foo 3))
(lambda ()
(set! foo (+ foo 1))
(display foo)
(newline))))
(x)
(x)
| null | https://raw.githubusercontent.com/rtrusso/scp/2051e76df14bd36aef81aba519ffafa62b260f5c/src/tests/set1.scm | scheme | (define foo 3)
(set! foo 5)
(display foo)
(newline)
(define x
(let ((foo 3))
(lambda ()
(set! foo (+ foo 1))
(display foo)
(newline))))
(x)
(x)
| |
e34656514b91070a9b63023801918a1296c89728afd4d1b3bbf7802dd3310582 | mbj/stratosphere | FilterProperty.hs | module Stratosphere.WAFv2.LoggingConfiguration.FilterProperty (
module Exports, FilterProperty(..), mkFilterProperty
) where
import qualified Data.Aeson as JSON
import qualified Stratosphere.Prelude as Prelude
import Stratosphere.Property
import {-# SOURCE #-} Stratosphere.WAFv2.LoggingConfiguration.Conditi... | null | https://raw.githubusercontent.com/mbj/stratosphere/c70f301715425247efcda29af4f3fcf7ec04aa2f/services/wafv2/gen/Stratosphere/WAFv2/LoggingConfiguration/FilterProperty.hs | haskell | # SOURCE # | module Stratosphere.WAFv2.LoggingConfiguration.FilterProperty (
module Exports, FilterProperty(..), mkFilterProperty
) where
import qualified Data.Aeson as JSON
import qualified Stratosphere.Prelude as Prelude
import Stratosphere.Property
import Stratosphere.ResourceProperties
import Stratosphere.Value
data... |
bff1b7ae57159df2c70ab8fd30f5545930fc0b6f8dfb28d404f7c5acd77a71f1 | mbutterick/beautiful-racket | expr.rkt | #lang br
(require "line.rkt")
(provide b-expr b-sum b-product b-neg b-expt b-def b-func)
(define (b-expr expr)
(if (integer? expr) (inexact->exact expr) expr))
(define-macro-cases b-sum
[(_ VAL) #'VAL]
[(_ LEFT "+" RIGHT) #'(+ LEFT RIGHT)]
[(_ LEFT "-" RIGHT) #'(- LEFT RIGHT)])
(define-macro-cases b-product
... | null | https://raw.githubusercontent.com/mbutterick/beautiful-racket/f0e2cb5b325733b3f9cbd554cc7d2bb236af9ee9/beautiful-racket-demo/basic-demo-3/expr.rkt | racket | #lang br
(require "line.rkt")
(provide b-expr b-sum b-product b-neg b-expt b-def b-func)
(define (b-expr expr)
(if (integer? expr) (inexact->exact expr) expr))
(define-macro-cases b-sum
[(_ VAL) #'VAL]
[(_ LEFT "+" RIGHT) #'(+ LEFT RIGHT)]
[(_ LEFT "-" RIGHT) #'(- LEFT RIGHT)])
(define-macro-cases b-product
... | |
d511a43902a562772a48528a417ad0d75bcbcac55e57d3d2b95c49351e6405fe | Hexlet/multicode | lang.clj | (ns multicode.lang)
(defmulti transform-method-name (fn [lang _] lang))
(defmethod transform-method-name :default [_ method-name] method-name)
(defmulti generate-unary (fn [lang _] lang))
(defmethod generate-unary :default [_ expr] (format "!%s" expr))
(defmulti get-terminator identity)
(defmethod get-terminator :de... | null | https://raw.githubusercontent.com/Hexlet/multicode/251307a30ea565d2aaf323267b7c6de8d0902cdd/src/multicode/lang.clj | clojure | (ns multicode.lang)
(defmulti transform-method-name (fn [lang _] lang))
(defmethod transform-method-name :default [_ method-name] method-name)
(defmulti generate-unary (fn [lang _] lang))
(defmethod generate-unary :default [_ expr] (format "!%s" expr))
(defmulti get-terminator identity)
(defmethod get-terminator :de... | |
9c489e1662ff5797209c7513e6f7947cec23149a724bece49a699074b9b66f98 | vyorkin/tiger | rb_tree.ml | open Base
Lets review Red - Black trees from the book
type color =
| Red
| Black
type 'a tree =
| Leaf (* considered Black *)
| Node of color * ('a tree) * 'a * ('a tree)
(* Invariants:
1) No red node has a red child
2) Every path from the root to an empty node
contains the same number of bl... | null | https://raw.githubusercontent.com/vyorkin/tiger/54dd179c1cd291df42f7894abce3ee9064e18def/chapter1/rb_tree.ml | ocaml | considered Black
Invariants:
1) No red node has a red child
2) Every path from the root to an empty node
contains the same number of black nodes
| open Base
Lets review Red - Black trees from the book
type color =
| Red
| Black
type 'a tree =
| Node of color * ('a tree) * 'a * ('a tree)
let balance = function
| (Black, Node (Red, Node (Red, a, x, b), y, c), z, d)
| (Black, Node (Red, a, x, Node (Red, b, y, c)), z, d)
| (Black, a, x, Node (Red... |
06e587925e296a158e15d733d286f6563d370e04e1941fdfae838b2622570598 | onedata/op-worker | file_listing.erl | %%%-------------------------------------------------------------------
@author
( C ) 2022 ACK CYFRONET AGH
This software is released under the MIT license
cited in ' LICENSE.txt ' .
%%% @end
%%%-------------------------------------------------------------------
%%% @doc
%%% This module is responsible for pro... | null | https://raw.githubusercontent.com/onedata/op-worker/843e4f19d4217dadf63aad0f9eb0030802e3840c/src/modules/fslogic/file_tree/file_listing.erl | erlang | -------------------------------------------------------------------
@end
-------------------------------------------------------------------
@doc
This module is responsible for providing a higher level API for listing files. It translates
listing parameters used commonly in op-worker (options()) to datastore links... | @author
( C ) 2022 ACK CYFRONET AGH
This software is released under the MIT license
cited in ' LICENSE.txt ' .
Therefore it operates on two types of tokens used for continuous listing of directory content :
* datastore_list_token - token used internally by datastore , has limited TTL . After its expi... |
287f70000f551845d70e7357fb7b54e5012f5b1aaf6e5b1940c4d874fefe86bd | charlieg/Sparser | make2.lisp | ;;; -*- Mode:LISP; Syntax:Common-Lisp; Package:SPARSER -*-
copyright ( c ) 1992 - 2005 -- all rights reserved
extensions ( c ) 2007 - 2010 BBNT Solutions LLC . All Rights Reserved
$ Id:$
;;;
;;; File: "make"
;;; Module: "objects;model:individuals:"
version : 1.4 July 2009
;; initiated 7/16/92 ... | null | https://raw.githubusercontent.com/charlieg/Sparser/b9bb7d01d2e40f783f3214fc104062db3d15e608/Sparser/code/s/objects/model/individuals/make2.lisp | lisp | -*- Mode:LISP; Syntax:Common-Lisp; Package:SPARSER -*-
File: "make"
Module: "objects;model:individuals:"
initiated 7/16/92 v2.3
in argument pattern.
of revising the indexing and having composite categories etc.
provide concrete values for words given schematically in their categories
... | copyright ( c ) 1992 - 2005 -- all rights reserved
extensions ( c ) 2007 - 2010 BBNT Solutions LLC . All Rights Reserved
$ Id:$
version : 1.4 July 2009
0.1 ( 11/23 ) Tweeked an internal call w / in Define - individual to fit lower change
0.2 ( 5/15/93 ) Added Throw - away individuals as an interim... |
b180cc3a813a49dfaab814e46d9270ff720f6278580f7602571120510cc26e54 | smallmelon/sdzmmo | test_client2.erl | %%%---------------------------------------------
%%% @Module : test_client
@Author : xyao
%%% @Email :
@Created : 2010.05.11
%%% @Description: 客户端
%%%---------------------------------------------
-module(test_client2).
-export([start/0, login/1]).
start() ->
case gen_tcp:connect("localhost",... | null | https://raw.githubusercontent.com/smallmelon/sdzmmo/254ff430481de474527c0e96202c63fb0d2c29d2/src/test/script/test_client2.erl | erlang | ---------------------------------------------
@Module : test_client
@Email :
@Description: 客户端
---------------------------------------------
登陆
L = byte_size( <<1:16,10000:16,99:32,1274722973:32,6:16,"997f64",32:16,"5a6462292fd5a2e04950e12edbb5dcf8">>),
玩家列表
加载场景
人攻击怪
场景
复活
读取字符串
| @Author : xyao
@Created : 2010.05.11
-module(test_client2).
-export([start/0, login/1]).
start() ->
case gen_tcp:connect("localhost", 6666, [binary, {packet, 0}]) of
{ok, Socket1} ->
gen_tcp:send(Socket1, <<"<policy-file-request/>\0">>),
rec(Socket1),
g... |
529bda21feaf83bd8ccd48258b78b345a94260439ab9d19bb73436973c173f8c | leopiney/tensor-safe | TensorSafe.hs | # LANGUAGE DataKinds #
# LANGUAGE ScopedTypeVariables #
| This module declares what is visible to use TensorSafe as an API .
module TensorSafe
( JavaScript (..),
Python (..),
generate,
generateFile,
INetwork,
MkINetwork,
mkINetwork,
toCNetwork,
)
where
import TensorSafe.Compile.Expr
... | null | https://raw.githubusercontent.com/leopiney/tensor-safe/cdf611dbbe68f6f6cb0b44fe31d86b28a547a3f2/src/TensorSafe.hs | haskell | # LANGUAGE DataKinds #
# LANGUAGE ScopedTypeVariables #
| This module declares what is visible to use TensorSafe as an API .
module TensorSafe
( JavaScript (..),
Python (..),
generate,
generateFile,
INetwork,
MkINetwork,
mkINetwork,
toCNetwork,
)
where
import TensorSafe.Compile.Expr
... | |
f6ff3d3282576b68d83ea867d08ff995cd4af995f9560a408534b45999c00ad3 | jumarko/clojure-experiments | reload_vars.clj | (ns clojure-experiments.reload-vars
"Experiments with vars and reloadability.
Motivated by Clojurians slack discussion: ")
;;;
: @jumar when you are making like a data literal or something and you put a function name in it and the data structure is evaluated ( and since it 's a data structure it evaluates to... | null | https://raw.githubusercontent.com/jumarko/clojure-experiments/1dc2c4f426a236938269e8a460ed5af08a337760/src/clojure_experiments/reload_vars.clj | clojure |
* So now you have a data structure with a function object in it.
* If you now go and change the function and re-evaluate it, a brand new function object is created and put into the var.
* The data structure isn't updated because it doesn't know about the var, it just has a function object that points... | (ns clojure-experiments.reload-vars
"Experiments with vars and reloadability.
Motivated by Clojurians slack discussion: ")
: @jumar when you are making like a data literal or something and you put a function name in it and the data structure is evaluated ( and since it 's a data structure it evaluates to itse... |
49d2db5a7fdbd94ec133fb0a01625732d84573344eb4a8a55661de919e8c9217 | ocaml-multicore/tezos | layer1.ml | (*****************************************************************************)
(* *)
(* Open Source License *)
Copyright ( c ) 2021 Nomadic Labs , < >
(* ... | null | https://raw.githubusercontent.com/ocaml-multicore/tezos/e4fd21a1cb02d194b3162ab42d512b7c985ee8a9/src/proto_alpha/bin_sc_rollup_node/layer1.ml | ocaml | ***************************************************************************
Open Source License
Permission is h... | Copyright ( c ) 2021 Nomadic Labs , < >
to deal in the Software without restriction , including without limitation
and/or sell copies of the Software , and to permit persons to whom the
THE SOFTWARE IS PROVIDED " AS IS " , WITHOUT WARRANTY OF ANY KIND , EXPRESS OR
LIABILITY , WHETHER IN A... |
f16f66a09c44bcd119fff1d2b5b44306b6dbba3a2c7bfb0cc3eb2677fc80139e | arttuka/reagent-material-ui | type_specimen_sharp.cljs | (ns reagent-mui.icons.type-specimen-sharp
"Imports @mui/icons-material/TypeSpecimenSharp as a Reagent component."
(:require-macros [reagent-mui.util :refer [create-svg-icon e]])
(:require [react :as react]
["@mui/material/SvgIcon" :as SvgIcon]
[reagent-mui.util]))
(def type-specimen-sharp... | null | https://raw.githubusercontent.com/arttuka/reagent-material-ui/14103a696c41c0eb67fc07fc67cd8799efd88cb9/src/icons/reagent_mui/icons/type_specimen_sharp.cljs | clojure | (ns reagent-mui.icons.type-specimen-sharp
"Imports @mui/icons-material/TypeSpecimenSharp as a Reagent component."
(:require-macros [reagent-mui.util :refer [create-svg-icon e]])
(:require [react :as react]
["@mui/material/SvgIcon" :as SvgIcon]
[reagent-mui.util]))
(def type-specimen-sharp... | |
4ee4cc14feb9d55f6631bb71cc9b5fdca5e5988688c7c1bfc395c863ef71a4ae | mojombo/rebar | funs.erl | -module(funs).
-export([listen/0, add/2, cat/2, fac/1]).
listen() ->
rebar:start().
add(A, B) ->
A + B.
cat(A, B) ->
A ++ B.
fac(N) ->
fac(1, N).
fac(Memo, 0) ->
Memo;
fac(Memo, N) ->
fac(Memo * N, N - 1). | null | https://raw.githubusercontent.com/mojombo/rebar/fb7f7c85e14fa8e40904c3eb9566ac278a42d2e8/funs.erl | erlang | -module(funs).
-export([listen/0, add/2, cat/2, fac/1]).
listen() ->
rebar:start().
add(A, B) ->
A + B.
cat(A, B) ->
A ++ B.
fac(N) ->
fac(1, N).
fac(Memo, 0) ->
Memo;
fac(Memo, N) ->
fac(Memo * N, N - 1). | |
054eb7ff9a994794dfeb3b35853ef62a437678601c06a220471a17a4b7133a1c | Dasudian/DSDIN | dsdso_ast.erl | -module(dsdso_ast).
-export([int/2,
line/1,
pp/1,
symbol/2,
symbol_name/1
]).
symbol(Line, Chars) -> {symbol, Line, Chars}.
int(Line, Int) -> {'Int', Line, Int}.
line({symbol, Line, _}) -> Line.
symbol_name({symbol, _, Name}) -> Name.
pp(Ast) ->
%% TODO: Actually do ... | null | https://raw.githubusercontent.com/Dasudian/DSDIN/b27a437d8deecae68613604fffcbb9804a6f1729/apps/dsdsophia/src/dsdso_ast.erl | erlang | TODO: Actually do *Pretty* printing. | -module(dsdso_ast).
-export([int/2,
line/1,
pp/1,
symbol/2,
symbol_name/1
]).
symbol(Line, Chars) -> {symbol, Line, Chars}.
int(Line, Int) -> {'Int', Line, Int}.
line({symbol, Line, _}) -> Line.
symbol_name({symbol, _, Name}) -> Name.
pp(Ast) ->
io:format("~p~n", [As... |
86d43597f2c5a35031e117756bf8398927df2444d0918d238adc48946c59b073 | liqd/aula | RenderHtml.hs | # LANGUAGE BangPatterns #
# LANGUAGE FlexibleInstances #
# LANGUAGE OverloadedStrings #
{-# LANGUAGE RankNTypes #-}
{-# LANGUAGE ScopedTypeVariables #-}
# OPTIONS_GHC -Werror -Wall #
-- | Read all $AULA_SAMPLES/*.hs in the hope that they contain values of any of the types listed in
-... | null | https://raw.githubusercontent.com/liqd/aula/f96dbf85cd80d0b445e7d198c9b2866bed9c4e3d/exec/RenderHtml.hs | haskell | # LANGUAGE RankNTypes #
# LANGUAGE ScopedTypeVariables #
| Read all $AULA_SAMPLES/*.hs in the hope that they contain values of any of the types listed in
pagesView and pagesForm. If disappointed, crashes. If successful, parse the value, render it to
Html, and write it to a file with the same name. If... | # LANGUAGE BangPatterns #
# LANGUAGE FlexibleInstances #
# LANGUAGE OverloadedStrings #
# OPTIONS_GHC -Werror -Wall #
This all happens in a little hspec test suite so we can use sensei for looping over the
In order to generate the source code , go to " Frontend . Testing " and read the ' Ren... |
a69d78c203cf36edf0aed0cff3aebeceab0ecb7eaeec7aefea2f549e45b1877c | pascal-knodel/haskell-craft | Power.hs | -- Power function. Primitive Recursion.
module Power where
import Test.QuickCheck
power :: Integer -> Integer -> Integer
power basis exponent
| exponent < 0 = error "Power.hs: Negative exponent."
| otherwise = power' basis exponent
where
power' :: Integer -> Integer -> Integer
power' _ 0 = 1
... | null | https://raw.githubusercontent.com/pascal-knodel/haskell-craft/c03d6eb857abd8b4785b6de075b094ec3653c968/Examples/%C2%B7%C2%A0Recursion/%C2%B7%20Primitive%20Recursion/Calculations/Power.hs | haskell | Power function. Primitive Recursion.
There would be an attempt to match this in every recursion step .
Under what condition(s) could this mathching be an advantage?
Under what condition(s) could this matching be a disadvantage?
(Keywords: recursion pattern, parallelism, complex data structures ...)
GHCi> quickChe... | module Power where
import Test.QuickCheck
power :: Integer -> Integer -> Integer
power basis exponent
| exponent < 0 = error "Power.hs: Negative exponent."
| otherwise = power' basis exponent
where
power' :: Integer -> Integer -> Integer
power' _ 0 = 1
power' basis exponent
| even expone... |
d409b78f85be3752ef5d880fefee82b86da9ae08df9c0f1ac50811bdf38463ce | BranchTaken/Hemlock | test_rev_split.ml | open! Basis.Rudiments
open! Basis
open Stream
let test () =
let rec test_rev_split_up_to i l n =
match i <= l, l <= n with
| _, false -> ()
| false, _ -> test_rev_split_up_to 0L (succ l) n
| true, true -> begin
let t = init (0L =:< l) ~f:(fun i -> i) in
let t0, t1 = rev_split i t in
... | null | https://raw.githubusercontent.com/BranchTaken/Hemlock/f3604ceda4f75cf18b6ee2b1c2f3c5759ad495a5/bootstrap/test/basis/stream/test_rev_split.ml | ocaml | open! Basis.Rudiments
open! Basis
open Stream
let test () =
let rec test_rev_split_up_to i l n =
match i <= l, l <= n with
| _, false -> ()
| false, _ -> test_rev_split_up_to 0L (succ l) n
| true, true -> begin
let t = init (0L =:< l) ~f:(fun i -> i) in
let t0, t1 = rev_split i t in
... | |
1e5a1b668821da7d4727d5b6dcc51c6af5e465c3565e5f765f36d5c3b8a4f939 | gip/fetchIO | MsgIO.hs | module MsgIO where
import Types
import Data.List as L
import Data.Text (Text,strip,splitOn)
import Data.Text.Encoding
import Data.Aeson
import Data.Maybe
import Data.String.Conversions
import qualified Data.HashMap.Strict as HM
import Data.Text.Encoding
import qualified Data.ByteString as B
import qualified Data.Byt... | null | https://raw.githubusercontent.com/gip/fetchIO/25f9e6ad9ef84de525f7a70cf24d10b431f93044/MsgIO.hs | haskell | Input Message
A single URL (legacy)
Multiple URLs
Headers
Routing key
The full input message
Output Message
Config
| module MsgIO where
import Types
import Data.List as L
import Data.Text (Text,strip,splitOn)
import Data.Text.Encoding
import Data.Aeson
import Data.Maybe
import Data.String.Conversions
import qualified Data.HashMap.Strict as HM
import Data.Text.Encoding
import qualified Data.ByteString as B
import qualified Data.Byt... |
2a211e1dd3e4fefb3fc209367abe2914af86cf74c895c69939b7948caf196c15 | qfpl/leaderboard | Lens.hs | module Leaderboard.Lens where
import Control.Lens (prism, Prism')
import Database.Beam (Auto (Auto))
_Auto
:: Prism' (Auto a) a
_Auto =
prism
(Auto . Just)
(\a@(Auto ma) -> maybe (Left a) Right ma)
| null | https://raw.githubusercontent.com/qfpl/leaderboard/2ada34ec31b197e44a9d17153b9397cdc3c83038/src/Leaderboard/Lens.hs | haskell | module Leaderboard.Lens where
import Control.Lens (prism, Prism')
import Database.Beam (Auto (Auto))
_Auto
:: Prism' (Auto a) a
_Auto =
prism
(Auto . Just)
(\a@(Auto ma) -> maybe (Left a) Right ma)
| |
197a69a28c5cf8a8112da5dbf67b8a9302ce2a0533e8210bb22d49c1bd686952 | mfikes/fifth-postulate | ns421.cljs | (ns fifth-postulate.ns421)
(defn solve-for01 [xs v]
(for [ndx0 (range 0 (- (count xs) 3))
ndx1 (range (inc ndx0) (- (count xs) 2))
ndx2 (range (inc ndx1) (- (count xs) 1))
ndx3 (range (inc ndx2) (count xs))
:when (= v (+ (xs ndx0) (xs ndx1) (xs ndx2) (xs ndx3)))]
(list (x... | null | https://raw.githubusercontent.com/mfikes/fifth-postulate/22cfd5f8c2b4a2dead1c15a96295bfeb4dba235e/src/fifth_postulate/ns421.cljs | clojure | (ns fifth-postulate.ns421)
(defn solve-for01 [xs v]
(for [ndx0 (range 0 (- (count xs) 3))
ndx1 (range (inc ndx0) (- (count xs) 2))
ndx2 (range (inc ndx1) (- (count xs) 1))
ndx3 (range (inc ndx2) (count xs))
:when (= v (+ (xs ndx0) (xs ndx1) (xs ndx2) (xs ndx3)))]
(list (x... | |
4179cfb6182bc481eb4f9f83f71ff1e6aee891ff358a9ecfa71859d99cee6800 | patricoferris/ocaml-variorum | variorum.real.ml | module T = Variorum_c.C.Type
module F = Variorum_c.C.Functions
let supported = true
let with_error = function
| 0 -> Ok ()
| n -> Error (`Msg (F.get_variorum_error_message n))
let with_error_value v = function
| 0 -> Ok v
| n -> Error (`Msg (F.get_variorum_error_message n))
let cap_each_core_frequency_limit... | null | https://raw.githubusercontent.com/patricoferris/ocaml-variorum/9128770e9df08ca7a90f317acc08b9cd49da6766/src/lib/variorum.real.ml | ocaml | Calculation based on: -get-node-power-json-example.c#L47 | module T = Variorum_c.C.Type
module F = Variorum_c.C.Functions
let supported = true
let with_error = function
| 0 -> Ok ()
| n -> Error (`Msg (F.get_variorum_error_message n))
let with_error_value v = function
| 0 -> Ok v
| n -> Error (`Msg (F.get_variorum_error_message n))
let cap_each_core_frequency_limit... |
8609205842b849ed09bf8e1cb1833752ecf66a082404a6242223508a03670282 | ghuysmans/api-cohttp-lwt | index.ml | let modules : (module Api.Client.C) list = [
(module Dec);
(module Ojt);
(module Pdy);
(module Ppc);
(module Pyc);
]
| null | https://raw.githubusercontent.com/ghuysmans/api-cohttp-lwt/4edfcb4d24deeeaca5786cb0e440fe295ef05b6f/demo/conv/index/index.ml | ocaml | let modules : (module Api.Client.C) list = [
(module Dec);
(module Ojt);
(module Pdy);
(module Ppc);
(module Pyc);
]
| |
af6cabf6dc3af941d3ec72e57b5c69078bf9550dd06b7ee11df63d13afafa842 | haskell-mafia/mismi | Amazonka.hs | # LANGUAGE NoImplicitPrelude #
{-# LANGUAGE OverloadedStrings #-}
module Mismi.DynamoDB.Amazonka (
module AWS
) where
import Network.AWS.DynamoDB as AWS
| null | https://raw.githubusercontent.com/haskell-mafia/mismi/f6df07a52c6c8b1cf195b58d20ef109e390be014/mismi-dynamodb/src/Mismi/DynamoDB/Amazonka.hs | haskell | # LANGUAGE OverloadedStrings # | # LANGUAGE NoImplicitPrelude #
module Mismi.DynamoDB.Amazonka (
module AWS
) where
import Network.AWS.DynamoDB as AWS
|
3592163ce01e88781a3cf4fd3ef2d136c88a638bbd7a1c1581a5a76db393df2f | splittist/docxplora | workbook-writer.lisp | workbook-writer.lisp
(in-package #:sml)
(defclass workbook-writer ()
((%document
:accessor workbook-writer-document)
(%sst
:accessor workbook-writer-sst)
(%sheets
:initform nil
:accessor workbook-writer-sheets)
(%dynamic-array-formulas
:initform nil
:accessor workbo... | null | https://raw.githubusercontent.com/splittist/docxplora/f641a3434332fe0ba2247c4bc4b70d9bb959f07a/sml/workbook-writer.lisp | lisp | Writing cells
| workbook-writer.lisp
(in-package #:sml)
(defclass workbook-writer ()
((%document
:accessor workbook-writer-document)
(%sst
:accessor workbook-writer-sst)
(%sheets
:initform nil
:accessor workbook-writer-sheets)
(%dynamic-array-formulas
:initform nil
:accessor workbo... |
6f82a08ece989165204640778582d00dc6ae216b45cf80db70946d085a843ef3 | jrm-code-project/LISP-Machine | k-defs.lisp | -*- Mode : LISP ; Package : SIM ; ; : CL -*-
(defconst %%k-min-args (byte 8 0))
(defconst %%k-max-args (byte 8 8))
(defconst %%k-rest-p (byte 1 16.))
| null | https://raw.githubusercontent.com/jrm-code-project/LISP-Machine/0a448d27f40761fafabe5775ffc550637be537b2/lambda/pace/k/k-defs.lisp | lisp | Package : SIM ; ; : CL -*- |
(defconst %%k-min-args (byte 8 0))
(defconst %%k-max-args (byte 8 8))
(defconst %%k-rest-p (byte 1 16.))
|
bf5709130402ac7336c18bf21fd2dda8bc877ea9550ec4340b74e26b1f1fbbad | larandaA/hgraphs | Dfs.hs | module Data.Graph.Abstract.Algorithm.Dfs
( preorder, preorderFrom
, postorder, postorderFrom
, dff
, acyclic, topsort
, components, connected
, bicolour, bipartite
) where
import Control.Monad
import Data.Graph.Abstract (Graph)
import Data.Graph.Abstract.Accessor
import qualifie... | null | https://raw.githubusercontent.com/larandaA/hgraphs/322b5cdfafbae851b4251c907e2c81b82cf02d4a/src/Data/Graph/Abstract/Algorithm/Dfs.hs | haskell | # INLINE postorderF # | module Data.Graph.Abstract.Algorithm.Dfs
( preorder, preorderFrom
, postorder, postorderFrom
, dff
, acyclic, topsort
, components, connected
, bicolour, bipartite
) where
import Control.Monad
import Data.Graph.Abstract (Graph)
import Data.Graph.Abstract.Accessor
import qualifie... |
3615ec3f5200681531985bd31efad9cf9d9e7b4bd62bed05ef3ac4a0d39b8bed | keigoi/ocaml-mpst-light | example.ml |
module StaticExample = struct
open Mpst_static
let g =
* resolve @@
* choice_at a ( to_b )
* ( a , ( a -- > b ) left @@ ( a -- > c ) msg finish )
* ( a , ( a -- > b ) right @@ ( a -- > c ) msg finish )
* resolve @@
* choice_at a (to_b left_or_right)
* (a, (a --... | null | https://raw.githubusercontent.com/keigoi/ocaml-mpst-light/099658369798b9588cb744ee0b95d09ff6e50d9f/examples/static/example.ml | ocaml |
module StaticExample = struct
open Mpst_static
let g =
* resolve @@
* choice_at a ( to_b )
* ( a , ( a -- > b ) left @@ ( a -- > c ) msg finish )
* ( a , ( a -- > b ) right @@ ( a -- > c ) msg finish )
* resolve @@
* choice_at a (to_b left_or_right)
* (a, (a --... | |
5d677f32e4e09f7b86a887097c06a2d12b035051d7dffecaf28f087e7ed879b0 | Liqwid-Labs/liqwid-libs | Export.hs | module ScriptExport.Export (
exportMain,
) where
import Data.Text (intercalate, unpack)
import ScriptExport.API (runServer)
import ScriptExport.File (runFile)
import ScriptExport.Options (
Options (FileOption, ListBuilders, ServerOption, StdoutOption),
parseOptions,
)
import ScriptExport.Stdout (runStdout)
impo... | null | https://raw.githubusercontent.com/Liqwid-Labs/liqwid-libs/ea3553eeeb8493f7430204ca730f468827bd464c/liqwid-script-export/src/ScriptExport/Export.hs | haskell | module ScriptExport.Export (
exportMain,
) where
import Data.Text (intercalate, unpack)
import ScriptExport.API (runServer)
import ScriptExport.File (runFile)
import ScriptExport.Options (
Options (FileOption, ListBuilders, ServerOption, StdoutOption),
parseOptions,
)
import ScriptExport.Stdout (runStdout)
impo... | |
24d93182306ebe3c8e3b45cfd9d5cee2556695825b23bbe947b6ad3a9d06105b | ekmett/structures | hunit.hs | module Main
( main -- :: IO ()
) where
main :: IO ()
main = return ()
| null | https://raw.githubusercontent.com/ekmett/structures/196fd37418e10ce44613aba8368a7e3fe75d3732/tests/hunit.hs | haskell | :: IO () | module Main
) where
main :: IO ()
main = return ()
|
0ab7f37e26db753d23838a61262522d9892b0d2f154b23f45400cc0b1e56b53e | uwplse/Cassius | actions.rkt | #lang racket
(require "common.rkt" "selectors.rkt" "tree.rkt" "dom.rkt")
(provide interpret-action synthesize-code synthesize-handler)
(define (interpret-action-core target-expr act tree)
(match-define (list target)
(for/list ([elt (in-tree tree)] #:when (selector-matches? target-expr elt)) elt))
(define type... | null | https://raw.githubusercontent.com/uwplse/Cassius/edcb8302c43b7b149280504c00672d8133219b44/src/old/actions.rkt | racket | #lang racket
(require "common.rkt" "selectors.rkt" "tree.rkt" "dom.rkt")
(provide interpret-action synthesize-code synthesize-handler)
(define (interpret-action-core target-expr act tree)
(match-define (list target)
(for/list ([elt (in-tree tree)] #:when (selector-matches? target-expr elt)) elt))
(define type... | |
94bcef61289e44c5ee792845ee2f08d0b41184c74d55baf749d15119fc0d723e | Bodigrim/arithmoi | RiemannTests.hs | -- |
Module : Math . . Zeta . RiemannTests
Copyright : ( c ) 2016
Licence : MIT
Maintainer : < >
--
Tests for Math . . Zeta .
--
# OPTIONS_GHC -fno - warn - type - defaults #
module Math.NumberTheory.Zeta.RiemannTests
( testSuite
) where
import Data.ExactPi (appro... | null | https://raw.githubusercontent.com/Bodigrim/arithmoi/979f3a8f02de17ea7e52392320d3e81f16bb6d32/test-suite/Math/NumberTheory/Zeta/RiemannTests.hs | haskell | |
and z2 be an approximation of the same value with precision eps2.
Then (independently of the true value of z)
abs (z1 - z2) < eps1 + eps2. | Module : Math . . Zeta . RiemannTests
Copyright : ( c ) 2016
Licence : MIT
Maintainer : < >
Tests for Math . . Zeta .
# OPTIONS_GHC -fno - warn - type - defaults #
module Math.NumberTheory.Zeta.RiemannTests
( testSuite
) where
import Data.ExactPi (approximateValue... |
825d8fa7f65028ffccb6ae62f20597a71affa8522decc8c2e86b599ea2ea02e7 | kudu-dynamics/blaze | GenericConv.hs | # LANGUAGE TypeOperators #
# LANGUAGE MultiParamTypeClasses #
# LANGUAGE FlexibleContexts , FlexibleInstances #
--- taken from -standard-haskell-generics-libraries-for-typed-type-isomorphisms
module Blaze.Util.GenericConv
( GConv
, gconv
) where
import Prelude
import GHC.Generics
gconv
:: (Generic a, Generi... | null | https://raw.githubusercontent.com/kudu-dynamics/blaze/a385bb3b37a0a0e061217ebdd70dd0eecbb20332/src/Blaze/Util/GenericConv.hs | haskell | - taken from -standard-haskell-generics-libraries-for-typed-type-isomorphisms
skip irrelevant parts: datatype name, constructor name, selector
copy values | # LANGUAGE TypeOperators #
# LANGUAGE MultiParamTypeClasses #
# LANGUAGE FlexibleContexts , FlexibleInstances #
module Blaze.Util.GenericConv
( GConv
, gconv
) where
import Prelude
import GHC.Generics
gconv
:: (Generic a, Generic b, GConv (Rep a) (Rep b))
=> a -> b
gconv = to . cv . from
class GConv a b ... |
3a60b5ac7fdad4125b8dbeb6ca10b52b3a4ca6d18ef0cd74551e1e62f94c25d3 | inhabitedtype/ocaml-aws | createCustomAvailabilityZone.mli | open Types
type input = CreateCustomAvailabilityZoneMessage.t
type output = CreateCustomAvailabilityZoneResult.t
type error = Errors_internal.t
include
Aws.Call with type input := input and type output := output and type error := error
| null | https://raw.githubusercontent.com/inhabitedtype/ocaml-aws/b6d5554c5d201202b5de8d0b0253871f7b66dab6/libraries/rds/lib/createCustomAvailabilityZone.mli | ocaml | open Types
type input = CreateCustomAvailabilityZoneMessage.t
type output = CreateCustomAvailabilityZoneResult.t
type error = Errors_internal.t
include
Aws.Call with type input := input and type output := output and type error := error
| |
7dc9bca2b0f180822cc3b4a85ebbb9e5b65c04fdd1a4612ce0b82d0d71557e88 | colefichter/lox | env_dict.erl | -module(env_dict).
-behaviour(gen_server).
%% API
-export([start/0, get/2, put/3, all/1]).
%% gen_server callbacks
-export([init/1, handle_call/3, handle_cast/2, handle_info/2, terminate/2, code_change/3]).
%% API functions
returns { ok , Pid }
get(ServerPid, Key) -> gen_server:call(ServerPid, {get... | null | https://raw.githubusercontent.com/colefichter/lox/6a71e5a40d0f2007841bb05242035fd532310809/src/env_dict.erl | erlang | API
gen_server callbacks
API functions
gen_server callbacks
| -module(env_dict).
-behaviour(gen_server).
-export([start/0, get/2, put/3, all/1]).
-export([init/1, handle_call/3, handle_cast/2, handle_info/2, terminate/2, code_change/3]).
returns { ok , Pid }
get(ServerPid, Key) -> gen_server:call(ServerPid, {get, Key}).
put(ServerPid, Key, Value) -> gen_serve... |
38d70558978aecdc1a6d26695633a904f4b59da1f972113f4fd4338bf02b625e | tochicool/bitcoin-dca | Client.hs | # LANGUAGE DataKinds #
# LANGUAGE NamedFieldPuns #
# LANGUAGE TypeOperators #
module BitcoinDCA.Explorer.Esplora.API.Client where
import BitcoinDCA.Explorer.Esplora.API.Types
import Data.Data (Proxy (Proxy))
import Network.HTTP.Client.TLS (newTlsManagerWith, tlsManagerSettings)
import Servant.API (Capture, Get, JSON,... | null | https://raw.githubusercontent.com/tochicool/bitcoin-dca/642016f54595194127fcbd24ff11e0d7b358b011/src/BitcoinDCA/Explorer/Esplora/API/Client.hs | haskell | # LANGUAGE DataKinds #
# LANGUAGE NamedFieldPuns #
# LANGUAGE TypeOperators #
module BitcoinDCA.Explorer.Esplora.API.Client where
import BitcoinDCA.Explorer.Esplora.API.Types
import Data.Data (Proxy (Proxy))
import Network.HTTP.Client.TLS (newTlsManagerWith, tlsManagerSettings)
import Servant.API (Capture, Get, JSON,... | |
52cc1cb99950a9d884f915d04baeb12b9e7b68512be4b0286a61d783d13a4d97 | coq/coq | patternops.ml | (************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
v * Copyright INRIA , CNRS and contributors
< O _ _ _ , , * ( see version control and CREDITS file for authors & dates )
\VV/ * * *... | null | https://raw.githubusercontent.com/coq/coq/25cc482e8fbc803186b4a830785f5bae668e33cf/pretyping/patternops.ml | ocaml | **********************************************************************
* The Coq Proof Assistant / The Coq Development Team
// * This file is distributed under the terms of the
* (see LICENSE file for the text of the license)
************************************... | v * Copyright INRIA , CNRS and contributors
< O _ _ _ , , * ( see version control and CREDITS file for authors & dates )
\VV/ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* GNU Lesser Gener... |
6cb36fa3d5cc18d6bccbcec4653dd589a81b9a05e7fdd9bae922359f6c89b728 | philnguyen/soft-contract | prims-04.rkt | #lang typed/racket/base
(provide prims-04@)
(require typed/racket/unit
"../runtime/signatures.rkt"
"../execution/signatures.rkt"
"../signatures.rkt"
"signatures.rkt"
"prims-04-01.rkt"
"prims-04-02.rkt"
"prims-04-03.rkt"
"prims-04-04.rkt"
... | null | https://raw.githubusercontent.com/philnguyen/soft-contract/5e07dc2d622ee80b961f4e8aebd04ce950720239/soft-contract/primitives/prims-04.rkt | racket | #lang typed/racket/base
(provide prims-04@)
(require typed/racket/unit
"../runtime/signatures.rkt"
"../execution/signatures.rkt"
"../signatures.rkt"
"signatures.rkt"
"prims-04-01.rkt"
"prims-04-02.rkt"
"prims-04-03.rkt"
"prims-04-04.rkt"
... | |
661b0e337c4821583397abdc329e52b7a2373d66e0b5f35ad9027f5544947b71 | andys8/network-manager-tui | Lib.hs | # LANGUAGE NamedFieldPuns #
module Lib
( Connection(..)
, toggleConnection
, listConnections
)
where
import System.Process
import Data.List.Split
import Data.List
import Data.Ord
data Connection = Connection { _uuid :: String, _cType :: String, _name:: String, _timesta... | null | https://raw.githubusercontent.com/andys8/network-manager-tui/f3832d55abfaa297ea2a70e2670d2207c8d39e95/src/Lib.hs | haskell | # LANGUAGE NamedFieldPuns #
module Lib
( Connection(..)
, toggleConnection
, listConnections
)
where
import System.Process
import Data.List.Split
import Data.List
import Data.Ord
data Connection = Connection { _uuid :: String, _cType :: String, _name:: String, _timesta... | |
0905a04fcb43aff6d90f3432de388611d541086b75feb837b7831157da6a1f98 | g000001/Starlisp-simulator | definitions.lisp | -*- Mode : LISP ; Syntax : COMMON - LISP ; Package : ( * SIM - I COMMON - LISP - GLOBAL ) ; Base : 10 ; Muser : yes -*-
(in-package :*sim-i)
;;;> *+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+
;;;>
;;;> The Thinking Machines *Lisp Simulator is in the public domain.
;;;> ... | null | https://raw.githubusercontent.com/g000001/Starlisp-simulator/12a6513d316a27fc130b83dcb023578312a79788/definitions.lisp | lisp | Syntax : COMMON - LISP ; Package : ( * SIM - I COMMON - LISP - GLOBAL ) ; Base : 10 ; Muser : yes -*-
> *+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+
>
> The Thinking Machines *Lisp Simulator is in the public domain.
> You are free to do whatever you like with it, includin... |
(in-package :*sim-i)
All the internal variables and data the * LISP Simulator uses are defined herein .
(defvar *all-def-vp-sets* nil
"A list of all the currently existing VP SETS created
by DEF-VP-SET. This is internal to *Lisp.
"
)
(defvar *all-dynamic-vp-sets* nil
"A list of all the curre... |
74453b51d0f1f7e712cbf66e7008997be2ea7e4d78c2d014beec2c23f9a067e6 | owickstrom/pandoc-emphasize-code | Pretty.hs | # LANGUAGE CPP #
{-# LANGUAGE OverloadedStrings #-}
module Text.Pandoc.Filter.EmphasizeCode.Pretty where
#if MIN_VERSION_base(4,8,0)
import Data.Semigroup ((<>))
#else
import Control.Applicative
import Data.Monoid
#endif
import Data.Fold... | null | https://raw.githubusercontent.com/owickstrom/pandoc-emphasize-code/8f2de8fd78206eb6583bb5a6beca492f250cc25e/src/Text/Pandoc/Filter/EmphasizeCode/Pretty.hs | haskell | # LANGUAGE OverloadedStrings # | # LANGUAGE CPP #
module Text.Pandoc.Filter.EmphasizeCode.Pretty where
#if MIN_VERSION_base(4,8,0)
import Data.Semigroup ((<>))
#else
import Control.Applicative
import Data.Monoid
#endif
import Data.Foldable (t... |
07b45847b1e459dd59ca4fff0fa7c64501228076be51909b7520dedcd095eda3 | pa-ba/compdata | Unification.hs | {-# LANGUAGE FlexibleContexts #-}
# LANGUAGE MultiParamTypeClasses #
-------------------------------------------------------------------------------
-- |
-- Module : Data.Comp.Unification
Copyright : ( c ) 2010 - 2011
-- License : BSD3
Maintainer : < >
-- Stability : experimental
... | null | https://raw.githubusercontent.com/pa-ba/compdata/5783d0e11129097e045cabba61643114b154e3f2/src/Data/Comp/Unification.hs | haskell | # LANGUAGE FlexibleContexts #
-----------------------------------------------------------------------------
|
Module : Data.Comp.Unification
License : BSD3
Stability : experimental
This module implements a simple unification algorithm using compositional
data types.
--------------------------... | # LANGUAGE MultiParamTypeClasses #
Copyright : ( c ) 2010 - 2011
Maintainer : < >
Portability : non - portable ( GHC Extensions )
module Data.Comp.Unification where
import Data.Comp.Decompose
import Data.Comp.Term
import Data.Comp.Variables
import Control.Monad.Except
import Control.Monad.State... |
2eaad1c05c89378fe64c26af701a26d3e1d369408ca5353e83da6852281307a5 | paroda/trade | indicator.clj | (ns bindi.indicator
(:require [taoensso.timbre :as log]))
(defn- avg [xs]
(if (seq xs)
(/ (apply + xs) (count xs))))
(defn- smooth-avg
([a v] (smooth-avg a v 14))
([a v n]
(if (number? a)
;; post n values, do smooth average
(/ (+ (* (dec n) a) v) n)
;; prior to initial n values
(let... | null | https://raw.githubusercontent.com/paroda/trade/c7d717ce04f506c821fedb2fd09c8c877ee5176a/src/bindi/indicator.clj | clojure | post n values, do smooth average
prior to initial n values
not n values yet
got initial n values, do simple average
post n values, do smooth average
prior to initial n values
not n values yet
got initial n values, do simple average
make a combined evaluator for specified indicators
indicator data is returned ... | (ns bindi.indicator
(:require [taoensso.timbre :as log]))
(defn- avg [xs]
(if (seq xs)
(/ (apply + xs) (count xs))))
(defn- smooth-avg
([a v] (smooth-avg a v 14))
([a v n]
(if (number? a)
(/ (+ (* (dec n) a) v) n)
(let [a (conj a v)]
(if (< (count a) n)
a
(avg a))))))... |
da618e5e1583a4c7e5f1777b4cf6dde4a0a3d850bb693c0e21fb213ab3084635 | geneweb/geneweb | imageDisplay.ml | $ I d : image.ml , v 5.8 2009 - 03 - 11 09:22:39 ddr Exp $
Copyright ( c ) 1998 - 2007 INRIA
open Config
let print_placeholder_gendered_portrait conf p size =
let open Gwdb in
let image, alt =
match get_sex p with
| Male -> ("male.png", "M")
| Female -> ("female.png", "F")
| Neuter -> ("sexunk... | null | https://raw.githubusercontent.com/geneweb/geneweb/747f43da396a706bd1da60d34c04493a190edf0f/lib/imageDisplay.ml | ocaml | **************************************************************************
**************************************************************************
**************************************************************************
**************************************************************************
***********... | $ I d : image.ml , v 5.8 2009 - 03 - 11 09:22:39 ddr Exp $
Copyright ( c ) 1998 - 2007 INRIA
open Config
let print_placeholder_gendered_portrait conf p size =
let open Gwdb in
let image, alt =
match get_sex p with
| Male -> ("male.png", "M")
| Female -> ("female.png", "F")
| Neuter -> ("sexunk... |
c9a8c25dac4785cfedb714ea0ea9028d5262faa5e6c08a26f7e634c1b74511b0 | tov/dssl2 | if1.rkt | #lang dssl2
if True:
assert(True)
else:
assert(False)
| null | https://raw.githubusercontent.com/tov/dssl2/105d18069465781bd9b87466f8336d5ce9e9a0f3/test/dssl2/if1.rkt | racket | #lang dssl2
if True:
assert(True)
else:
assert(False)
| |
3ace1023a0cfb755658b60bbfa65f38b10c2c1cc3a3ea825816f902580eddfe1 | FranklinChen/hugs98-plus-Sep2006 | Utils.hs | -----------------------------------------------------------------------------
-- |
-- Module : Test.QuickCheck.Utils
Copyright : ( c ) 2001
-- License : BSD-style (see the file libraries/base/LICENSE)
--
-- Maintainer :
-- Stability : experimental
-- Portability : portable
--
These are som... | null | https://raw.githubusercontent.com/FranklinChen/hugs98-plus-Sep2006/54ab69bd6313adbbed1d790b46aca2a0305ea67e/packages/QuickCheck/Test/QuickCheck/Utils.hs | haskell | ---------------------------------------------------------------------------
|
Module : Test.QuickCheck.Utils
License : BSD-style (see the file libraries/base/LICENSE)
Maintainer :
Stability : experimental
Portability : portable
----------------------------------------------------------------... | Copyright : ( c ) 2001
These are some general purpose utilities for use with QuickCheck .
module Test.QuickCheck.Utils
( isAssociativeBy
, isAssociative
, isCommutableBy
, isCommutable
, isTotalOrder
) where
import Prelude
import Test.QuickCheck
isAssociativeBy :: (Show a,Testable prop)
=>... |
7552ff3cdff50886314de243a10d382ca175e117e9060f8a694935c8e56cbcc2 | infi-nl/alibi | db_tools.clj | (ns alibi.datasource.sqlite.db-tools
(:require
[alibi.db-tools :as db-tools]
[alibi.domain.project :as project]
[alibi.domain.task :as task]
[alibi.domain.entry :as entry]
[alibi.domain.user :as user-repo]
[alibi.infra.date-time
:refer [->local-time ->local-date today]]
[clojure.java.... | null | https://raw.githubusercontent.com/infi-nl/alibi/00e97340ebff483f0ecbb3eef929a4052adbc78b/test/alibi/datasource/sqlite/db_tools.clj | clojure | (ns alibi.datasource.sqlite.db-tools
(:require
[alibi.db-tools :as db-tools]
[alibi.domain.project :as project]
[alibi.domain.task :as task]
[alibi.domain.entry :as entry]
[alibi.domain.user :as user-repo]
[alibi.infra.date-time
:refer [->local-time ->local-date today]]
[clojure.java.... | |
6e08d5e83b844f0269621cadf56920f6494474e0d4deaa1c1823670f863328b4 | HealthSamurai/unit-map | misc_test.clj | (ns unit-map.systems.date-time.misc-test
(:require [unit-map.systems.date-time.misc :as sut]
[unit-map.core :as umap]
[clojure.test :as t]))
(def treg_ (umap/new-registry))
(umap/reg-useq! treg_ :unit :sec, :useq #unit-map/useq[0 1 .. 59] :next-unit :min)
(umap/reg-useq! treg_ :unit :min, ... | null | https://raw.githubusercontent.com/HealthSamurai/unit-map/eb90c2c427c2fb0f48cb54e58d1565f3255ec16d/test/unit_map/systems/date_time/misc_test.clj | clojure | (ns unit-map.systems.date-time.misc-test
(:require [unit-map.systems.date-time.misc :as sut]
[unit-map.core :as umap]
[clojure.test :as t]))
(def treg_ (umap/new-registry))
(umap/reg-useq! treg_ :unit :sec, :useq #unit-map/useq[0 1 .. 59] :next-unit :min)
(umap/reg-useq! treg_ :unit :min, ... | |
b7ddee6b82d955c13bb9df2b2e05bfc76f382107ae5dec9260899c7058b4f26c | footprintanalytics/footprint-web | describe_database_test.clj | (ns metabase.driver.sql-jdbc.sync.describe-database-test
(:require [clojure.java.jdbc :as jdbc]
[clojure.test :refer :all]
[metabase.driver :as driver]
[metabase.driver.sql-jdbc.connection :as sql-jdbc.conn]
[metabase.driver.sql-jdbc.sync.describe-database :as sql-jdbc.... | null | https://raw.githubusercontent.com/footprintanalytics/footprint-web/d3090d943dd9fcea493c236f79e7ef8a36ae17fc/test/metabase/driver/sql_jdbc/sync/describe_database_test.clj | clojure | We have to mock this to make it work with all DBs
swap out `jdbc/result-set-seq` which is what ultimately gets called on result sets with a function that will
instead of databases; by doing this we can keep the connection open and check whether resultsets are still
open before they would normally get closed
We hav... | (ns metabase.driver.sql-jdbc.sync.describe-database-test
(:require [clojure.java.jdbc :as jdbc]
[clojure.test :refer :all]
[metabase.driver :as driver]
[metabase.driver.sql-jdbc.connection :as sql-jdbc.conn]
[metabase.driver.sql-jdbc.sync.describe-database :as sql-jdbc.... |
041e83f91fd4572890b1568177e1bde143bbc146f4a6ab5b0c97a488f64bb51d | YoshikuniJujo/markdown2svg | SVG.hs | module SVG (
textToSVG
) where
import Control.Applicative
import Data.Maybe
import Data.Char
import System.FilePath
import Text.XML.YJSVG hiding (Image)
import qualified Text.XML.YJSVG as SVG
import Text.Markdown.Pap
import SepWords
import Image
type FontsS = (String, String, String)
type Fonts = (Font, Font, Font)... | null | https://raw.githubusercontent.com/YoshikuniJujo/markdown2svg/a4a53d2f669c124684e8beee5c1c271d9699f952/src/SVG.hs | haskell | headerFont, normalFont, codeFont :: Font
headerFont = Font "Kochi Gothic" Normal
normalFont = "Kochi Gothic"
Nothing | module SVG (
textToSVG
) where
import Control.Applicative
import Data.Maybe
import Data.Char
import System.FilePath
import Text.XML.YJSVG hiding (Image)
import qualified Text.XML.YJSVG as SVG
import Text.Markdown.Pap
import SepWords
import Image
type FontsS = (String, String, String)
type Fonts = (Font, Font, Font)... |
69194ef88dce80d7d2afc10ac41fa98fda3e0942c562398e4607ac4670a9700e | lem-project/lem | json-mode.lisp | (defpackage :lem-json-mode
(:use :cl :lem :lem.language-mode :lem.language-mode-tools)
(:export :*json-mode-hook*
:json-mode))
(in-package :lem-json-mode)
(defvar *js-floating-point-literals* "\\b([+-]?[1-9]\\d*(.\\d)?([Ee][+-]?\\d+)?)\\b")
(defvar *js-integer-literals* "\\b([1-9]\\d*|0+|0[bB][01]+|0[oO... | null | https://raw.githubusercontent.com/lem-project/lem/40c46d4fa12e1581e921b3d3e6caf8df451b8853/modes/json-mode/json-mode.lisp | lisp | (defpackage :lem-json-mode
(:use :cl :lem :lem.language-mode :lem.language-mode-tools)
(:export :*json-mode-hook*
:json-mode))
(in-package :lem-json-mode)
(defvar *js-floating-point-literals* "\\b([+-]?[1-9]\\d*(.\\d)?([Ee][+-]?\\d+)?)\\b")
(defvar *js-integer-literals* "\\b([1-9]\\d*|0+|0[bB][01]+|0[oO... | |
df2f63778d4bb0da2275fc004bb64ac969a1a7d5fcd194ecf30abd59643c695b | stuart-robinson/clojure-serverless-demo | lambda_test.clj | (ns clojure-serverless-demo.aws.lambda-test
(:require [clojure-serverless-demo.aws.lambda :as sut]
[clojure.test :refer :all]))
(deftest api-gateway-request->ring-request-test
(let [api-gateway-request
{:path "/ping"
:queryStringParameters nil
:pathParameters {:proxy "ping"}
... | null | https://raw.githubusercontent.com/stuart-robinson/clojure-serverless-demo/d8d046bd79ccfe3dcea8823e8eddc3cb78a9f732/test/clj/clojure_serverless_demo/aws/lambda_test.clj | clojure | (ns clojure-serverless-demo.aws.lambda-test
(:require [clojure-serverless-demo.aws.lambda :as sut]
[clojure.test :refer :all]))
(deftest api-gateway-request->ring-request-test
(let [api-gateway-request
{:path "/ping"
:queryStringParameters nil
:pathParameters {:proxy "ping"}
... | |
393ce55d05b46917faa5510689f26a85f4ec74446688665a872159e1e488bc49 | sph-mn/sph-lib | atom.scm | (define-test-module (test module sph web atom)
(import
(sph web atom))
(define-test (atom-feed)
(atom-feed "test-id" "test-title"
1234567890 #:authors
(list (atom-author "me") (atom-author "second me")) #:contributors
(list (atom-contributor "me-me") (atom-contributor "second me-me")) #:c... | null | https://raw.githubusercontent.com/sph-mn/sph-lib/c7daf74f42d6bd1304f49c2fef89dcd6dd94fdc9/modules/test/module/sph/web/atom.scm | scheme | (define-test-module (test module sph web atom)
(import
(sph web atom))
(define-test (atom-feed)
(atom-feed "test-id" "test-title"
1234567890 #:authors
(list (atom-author "me") (atom-author "second me")) #:contributors
(list (atom-contributor "me-me") (atom-contributor "second me-me")) #:c... | |
94784dd6c58337578d471d03dccccc4919cc0ff20342e52f38c968b65c8681ed | district0x/cljs-web3 | db.cljs | (ns cljs-web3.async.db
(:require
[cljs-web3.db :as web3-db]
[cljs-web3.utils :as u]))
(def put-string! (u/create-async-fn web3-db/put-string!))
(def get-string (u/create-async-fn web3-db/put-string!))
(def put-hex! (u/create-async-fn web3-db/put-string!))
(def get-hex (u/create-async-fn web3-db/put-string!)) | null | https://raw.githubusercontent.com/district0x/cljs-web3/14ba12e37dd944c90f4741d92c8c94394b9a3dba/src/cljs_web3/async/db.cljs | clojure | (ns cljs-web3.async.db
(:require
[cljs-web3.db :as web3-db]
[cljs-web3.utils :as u]))
(def put-string! (u/create-async-fn web3-db/put-string!))
(def get-string (u/create-async-fn web3-db/put-string!))
(def put-hex! (u/create-async-fn web3-db/put-string!))
(def get-hex (u/create-async-fn web3-db/put-string!)) | |
b064ac8c278819d7dfc32bc486510d3621a115ba9b3caad8538eee219b5e0e1f | clj-holmes/clj-holmes | parser.clj | (ns clj-holmes.logic.parser
(:require [clj-holmes.logic.namespace :as logic.namespace]))
(defn ^:private add-parent-node-meta [parent child]
(if (meta child)
(vary-meta child assoc :parent parent)
child))
(defn ^:private build-form-tree [ns-name form]
(let [qualified-parent-name (logic.namespace/extract... | null | https://raw.githubusercontent.com/clj-holmes/clj-holmes/d394e0d22da9112cf39a2960376251997cae57ae/src/clj_holmes/logic/parser.clj | clojure | (ns clj-holmes.logic.parser
(:require [clj-holmes.logic.namespace :as logic.namespace]))
(defn ^:private add-parent-node-meta [parent child]
(if (meta child)
(vary-meta child assoc :parent parent)
child))
(defn ^:private build-form-tree [ns-name form]
(let [qualified-parent-name (logic.namespace/extract... | |
d8c79c827f2dedf8104fe1cfe19597ef89313d5302ce84b2f7c1227cb3f597e2 | namin/inc | tests-6.5-req.scm | (add-tests-with-string-output-noboot "test self"
[(let ()
(load "self.scm")
(load "reader.scm")
(load "compiler.scm")
(string-append "hello" ", " "there"))
=> "\"hello, there\"\n"]
[(let ()
(load "self.scm")
(load "reader.scm")
(load "compiler.scm")
(member 'x '(w x y z)))... | null | https://raw.githubusercontent.com/namin/inc/3f683935e290848485f8d4d165a4f727f6658d1d/src/tests-6.5-req.scm | scheme | (add-tests-with-string-output-noboot "test self"
[(let ()
(load "self.scm")
(load "reader.scm")
(load "compiler.scm")
(string-append "hello" ", " "there"))
=> "\"hello, there\"\n"]
[(let ()
(load "self.scm")
(load "reader.scm")
(load "compiler.scm")
(member 'x '(w x y z)))... | |
2e587e4d2abb605f04448cd6581e664d6284b45612e0fc4da5ced9741083fded | schibsted/spid-tech-docs | api_client.clj | (ns spid-docs.api-client
"Functions for working with the SPiD API. The SPiD API is used by the
documentation to get sample responses etc."
(:require [spid-client-clojure.core :as sdk]
[spid-docs.config :refer [get-config]]))
(def get-client (memoize #(let [conf (get-config)]
... | null | https://raw.githubusercontent.com/schibsted/spid-tech-docs/ee6a4394e9732572e97fc3a55506b2d6b9a9fe2b/src/spid_docs/api_client.clj | clojure | (ns spid-docs.api-client
"Functions for working with the SPiD API. The SPiD API is used by the
documentation to get sample responses etc."
(:require [spid-client-clojure.core :as sdk]
[spid-docs.config :refer [get-config]]))
(def get-client (memoize #(let [conf (get-config)]
... | |
175af356c5f17dee808c13a4d2e1e4767bf0dbbfc7a485f63dd5336597e8613a | ndmitchell/cmdargs | Util.hs | # LANGUAGE PatternGuards #
module System.Console.CmdArgs.Test.Implicit.Util(
module System.Console.CmdArgs.Test.Implicit.Util,
Complete(..)
) where
import System.Console.CmdArgs.Implicit
import System.Console.CmdArgs.Explicit
import System.Console.CmdArgs.Test.Util
import Control.Exception
import Data.Cha... | null | https://raw.githubusercontent.com/ndmitchell/cmdargs/7c206f464fa666b2654ae9da59cdff44e310de66/System/Console/CmdArgs/Test/Implicit/Util.hs | haskell | # LANGUAGE PatternGuards #
module System.Console.CmdArgs.Test.Implicit.Util(
module System.Console.CmdArgs.Test.Implicit.Util,
Complete(..)
) where
import System.Console.CmdArgs.Implicit
import System.Console.CmdArgs.Explicit
import System.Console.CmdArgs.Test.Util
import Control.Exception
import Data.Cha... | |
8e53d31d5f8ba5653d2d43f18a589dd1c6804b6bac844e1ec00bdab5e98f032c | erlang/otp | diameter_dpr_SUITE.erl | %%
%% %CopyrightBegin%
%%
Copyright Ericsson AB 2012 - 2022 . 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 applicab... | null | https://raw.githubusercontent.com/erlang/otp/66dd3c397b5dd68cb087a1a830f25c62c5d1d2ad/lib/diameter/test/diameter_dpr_SUITE.erl | erlang |
%CopyrightBegin%
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
-2.0
Unless required by applicable law or agreed to in writing, software
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific lan... | Copyright Ericsson AB 2012 - 2022 . 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(diameter_dpr_SUITE).
-export([run/0,
run/1]).
-export([suite/0,
all/0,
client/... |
2e6c166dbe8fd8c2ad862fe64627579a729e6d99af7443b205502ef32d5933b2 | vsedach/vas-string-metrics | package.lisp | (cl:defpackage #:vas-string-metrics
(:use #:cl)
(:export #:jaro-distance
#:jaro-winkler-distance
#:levenshtein-distance
#:normalized-levenshtein-distance
#:soerensen-dice-coefficient))
| null | https://raw.githubusercontent.com/vsedach/vas-string-metrics/f2e4500b180316123fbd549bd51c751ee2d6ba0f/package.lisp | lisp | (cl:defpackage #:vas-string-metrics
(:use #:cl)
(:export #:jaro-distance
#:jaro-winkler-distance
#:levenshtein-distance
#:normalized-levenshtein-distance
#:soerensen-dice-coefficient))
| |
44ed6ab7d7a4e3444bee1f99f191e033c4d872072a72c2b5e51c795447884b95 | tolysz/ghcjs-stack | BuildPaths.hs | -----------------------------------------------------------------------------
-- |
-- Module : Distribution.Simple.BuildPaths
Copyright : 2003 - 2004 ,
2008
-- License : BSD3
--
-- Maintainer :
-- Portability : portable
--
A bunch of dirs , paths and file names used for inte... | null | https://raw.githubusercontent.com/tolysz/ghcjs-stack/83d5be83e87286d984e89635d5926702c55b9f29/special/cabal/Cabal/Distribution/Simple/BuildPaths.hs | haskell | ---------------------------------------------------------------------------
|
Module : Distribution.Simple.BuildPaths
License : BSD3
Maintainer :
Portability : portable
---------------------------------------------------------------------------
Build directories and files
|The directory in whi... | Copyright : 2003 - 2004 ,
2008
A bunch of dirs , paths and file names used for intermediate build steps .
module Distribution.Simple.BuildPaths (
defaultDistPref, srcPref,
hscolourPref, haddockPref,
autogenModulesDir,
autogenModuleName,
cppHeaderName,
haddockName,... |
a5decc4f9931bd4457317a7306ecc7d12ce45bb5ae0e0b9701dbdd57d1ceaade | NetComposer/nksip | outbound_test_ua2.erl | %% -------------------------------------------------------------------
%%
%% outbound_test: Path (RFC5626) Tests
%%
Copyright ( c ) 2013 . All Rights Reserved .
%%
This file is provided to you under the Apache License ,
%% Version 2.0 (the "License"); you may not use this file
except in compliance with the L... | null | https://raw.githubusercontent.com/NetComposer/nksip/7fbcc66806635dc8ecc5d11c30322e4d1df36f0a/test/callbacks/outbound_test_ua2.erl | erlang | -------------------------------------------------------------------
outbound_test: Path (RFC5626) Tests
Version 2.0 (the "License"); you may not use this file
a copy of the License at
-2.0
Unless required by applicable law or agreed to in writing,
KIND, either express or implied. See the License for the
... | Copyright ( c ) 2013 . All Rights Reserved .
This file is provided to you under the Apache License ,
except in compliance with the License . You may obtain
software distributed under the License is distributed on an
" AS IS " BASIS , WITHOUT WARRANTIES OR CONDITIONS OF ANY
-module(outbound_test_ua2).
... |
b8e25ac6c59776c971e75bf7b633538e57a6163c4278278bb702b1513edf8dfb | janestreet/merlin-jst | missed_shadowing.ml | module W = struct end
module M (W : sig end) : sig end = struct
include W
end
module type X = sig end
module N (X : X) : sig end = struct
include X
end
| null | https://raw.githubusercontent.com/janestreet/merlin-jst/0152b4e8ef1b7cd0ddee2873aa1860a971585391/tests/test-dirs/locate/functors/f-missed_shadowing.t/missed_shadowing.ml | ocaml | module W = struct end
module M (W : sig end) : sig end = struct
include W
end
module type X = sig end
module N (X : X) : sig end = struct
include X
end
| |
0bcf0028c850d5e6462045576eebeaef71fa7ccdc5986489d4b5e3d3679aad61 | threatgrid/ctia | sightings_incidents_test.clj | (ns ctia.http.routes.observable.sightings-incidents-test
(:require [clj-momo.test-helpers.core :as mht]
[clojure.test :refer [deftest is join-fixtures testing use-fixtures]]
[ctia.test-helpers.auth :refer [all-capabilities]]
[ctia.test-helpers.core :as helpers :refer [GET make-id P... | null | https://raw.githubusercontent.com/threatgrid/ctia/ae7d940e323a99dde747e37e2be2898d7705dcaa/test/ctia/http/routes/observable/sightings_incidents_test.clj | clojure | This sighting should be matched
This sighting should not be matched (no incident relationship)
This sighting should not be matched (different observable)
This judgement should not be matched (it isn't an incident)
This incident should be found based on the observable/relationship
This incident should not be found... | (ns ctia.http.routes.observable.sightings-incidents-test
(:require [clj-momo.test-helpers.core :as mht]
[clojure.test :refer [deftest is join-fixtures testing use-fixtures]]
[ctia.test-helpers.auth :refer [all-capabilities]]
[ctia.test-helpers.core :as helpers :refer [GET make-id P... |
ba0cd8e24dbb80561ca6662da278e6b480201ebaa0dcd10babefd41d31023622 | ghc/nofib | Main.hs | This is a modification of the calendar program described in section 4.5
of Bird and Wadler 's ` ` Introduction to functional programming '' , with
two ways of printing the calendar ... as in B+W , or like UNIX ` cal ' :
import System.IO
import Data.List
import Data.Char
import System.Environment
import Control.... | null | https://raw.githubusercontent.com/ghc/nofib/f34b90b5a6ce46284693119a06d1133908b11856/spectral/calendar/Main.hs | haskell | To keep it backward compatible with pre-Haskell 98 compilers..
Picture handling:
For a standalone calendar program:
stdout file is too huge.
offset yr by the input parameter, so that this isn't
End of calendar program
tacked on by partain
end of tack | This is a modification of the calendar program described in section 4.5
of Bird and Wadler 's ` ` Introduction to functional programming '' , with
two ways of printing the calendar ... as in B+W , or like UNIX ` cal ' :
import System.IO
import Data.List
import Data.Char
import System.Environment
import Control.... |
9158db9b53e2830286f7f748165f4b0970441e1a04b584adf842111d7cf2fa9b | Z572/guile-wlroots | output.scm | (define-module (wlroots types output)
#:use-module ((system foreign) #:prefix ffi:)
#:use-module (wlroots render allocator)
#:use-module (wlroots render renderer)
#:use-module (wlroots backend)
#:use-module (wlroots util addon)
#:use-module (wlroots types)
#:use-module (wlroots types compositor)
#:use-m... | null | https://raw.githubusercontent.com/Z572/guile-wlroots/dc6cd05d5c46f811d75cbc30d1464820b19b1de8/wlroots/types/output.scm | scheme | (define-module (wlroots types output)
#:use-module ((system foreign) #:prefix ffi:)
#:use-module (wlroots render allocator)
#:use-module (wlroots render renderer)
#:use-module (wlroots backend)
#:use-module (wlroots util addon)
#:use-module (wlroots types)
#:use-module (wlroots types compositor)
#:use-m... | |
8e2842d7415e99593a6a3df73f3032ade344bab9c2533680866327e5c360f3e0 | dvanhorn/oaam | generators.rkt | #lang racket
(provide aval^ widen)
(require "ast.rkt" "data.rkt"
"progs.rkt"
racket/generator
(for-syntax syntax/parse)
racket/stxparam)
0CFA in the AAM style on some hairy Church numeral churning
;; + compilation phase
;; + lazy non-determinism
;; + specialized step & iterator
... | null | https://raw.githubusercontent.com/dvanhorn/oaam/79bc68ecb79fef45474a948deec1de90d255f307/code/iswim/generators.rkt | racket | + compilation phase
+ lazy non-determinism
+ specialized step & iterator
State^ = (cons (Set Conf) Store)
We use generators that produce many steps as
"Compiled" Machine
Compile away interpretive overhead of "ev" states
Expr -> Comp
XXX: not robust to returning #f
State -> State^
Anything else is stuck
An... | #lang racket
(provide aval^ widen)
(require "ast.rkt" "data.rkt"
"progs.rkt"
racket/generator
(for-syntax syntax/parse)
racket/stxparam)
0CFA in the AAM style on some hairy Church numeral churning
State = ( cons Conf Store )
Comp = Store Env Cont - > ( values State StoreΔ... |
91bc720edb91c880796127f7c8ac51dd236c3ac5f2998933380db2e10bee1f52 | fccm/glMLite | lesson6.ml |
This code was created by 99
If you 've found this code useful , please let me know .
The full tutorial associated with this file is available here :
( OCaml version by )
This code was created by Jeff Molofee '99
If you've found this code useful, please let me know.
The full tutorial associa... | null | https://raw.githubusercontent.com/fccm/glMLite/c52cd806909581e49d9b660195576c8a932f6d33/nehe-examples/lesson6.ml | ocaml | Module For The OpenGL Library
Module For The GLu Library
Module For The GLUT Library
floats for x rotation, y rotation, z rotation
Load Bitmaps And Convert To Textures
Load Texture
Create Texture
2d texture (x and y size)
scale linearly when image bigger than texture
scale linearly when image smalle... |
This code was created by 99
If you 've found this code useful , please let me know .
The full tutorial associated with this file is available here :
( OCaml version by )
This code was created by Jeff Molofee '99
If you've found this code useful, please let me know.
The full tutorial associa... |
67d7a130c7ee6f3921f8b6a07c1de4bf45395b1c482f52031f076d56babe7469 | Piervit/gufo | gufoModMap.ml |
This file is part of .
is free software : you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation , either version 3 of the License , or
( at your option ) any later version .
is distributed in the hop... | null | https://raw.githubusercontent.com/Piervit/gufo/cb9b4f88d6e887ccfe50ea3bc7214486f2df3078/src/gufoModMap.ml | ocaml | the system module for List. |
This file is part of .
is free software : you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation , either version 3 of the License , or
( at your option ) any later version .
is distributed in the hop... |
12258fa4e4c9cb40aa7ec6467ecd2f9d026918b0c6d171b7c58cc35bed3fb94b | johnlawrenceaspden/hobby-code | rdf.clj | (use 'plaza.rdf.core)
(use 'plaza.rdf.predicates)
(reset-model)
(def rdfa (document-to-model
"/"
:html))
(print (with-out-str (model-to-format rdfa :n1)))
(print (with-out-str (model-to-format rdfa :n2)))
(print (with-out-str (model-to-format rdfa :n3)))
(print (with-out-str (model-... | null | https://raw.githubusercontent.com/johnlawrenceaspden/hobby-code/48e2a89d28557994c72299962cd8e3ace6a75b2d/rdf.clj | clojure | subject
predicate
object | (use 'plaza.rdf.core)
(use 'plaza.rdf.predicates)
(reset-model)
(def rdfa (document-to-model
"/"
:html))
(print (with-out-str (model-to-format rdfa :n1)))
(print (with-out-str (model-to-format rdfa :n2)))
(print (with-out-str (model-to-format rdfa :n3)))
(print (with-out-str (model-... |
1e668106749043ec047a94bf0b998e4a911e66b07e69bc0badae831bf214d59a | SimulaVR/godot-haskell | GrooveJoint2D.hs | # LANGUAGE DerivingStrategies , GeneralizedNewtypeDeriving ,
TypeFamilies , TypeOperators , FlexibleContexts , DataKinds ,
MultiParamTypeClasses #
TypeFamilies, TypeOperators, FlexibleContexts, DataKinds,
MultiParamTypeClasses #-}
module Godot.Core.GrooveJoint2D
(Godot.Core.GrooveJoint2D.get_initial_... | null | https://raw.githubusercontent.com/SimulaVR/godot-haskell/e8f2c45f1b9cc2f0586ebdc9ec6002c8c2d384ae/src/Godot/Core/GrooveJoint2D.hs | haskell | | The body B's initial anchor position defined by the joint's origin and a local offset @initial_offset@ along the joint's Y axis (along the groove).
| The body B's initial anchor position defined by the joint's origin and a local offset @initial_offset@ along the joint's Y axis (along the groove).
| The groove's le... | # LANGUAGE DerivingStrategies , GeneralizedNewtypeDeriving ,
TypeFamilies , TypeOperators , FlexibleContexts , DataKinds ,
MultiParamTypeClasses #
TypeFamilies, TypeOperators, FlexibleContexts, DataKinds,
MultiParamTypeClasses #-}
module Godot.Core.GrooveJoint2D
(Godot.Core.GrooveJoint2D.get_initial_... |
0c1cf669191790e7e728dceb59446ac72dd5c966fe9f4c303a2e34b1e70f4337 | hanshuebner/vlm | support-sysdcl.lisp | -*- Mode : LISP ; Syntax : Common - Lisp ; Package : SCT ; Base : 10 ; Lowercase : Yes -*-
(defsystem alpha-axp-translator-support
(:pretty-name "Alpha AXP Translator Support"
:default-pathname "VLM:EMULATOR;"
:journal-directory "VLM:TRANSLATOR;PATCH;"
:maintain-journals t
:patchable t)
(:m... | null | https://raw.githubusercontent.com/hanshuebner/vlm/20510ddc98b52252a406012a50a4d3bbd1b75dd0/translator/support-sysdcl.lisp | lisp | Syntax : Common - Lisp ; Package : SCT ; Base : 10 ; Lowercase : Yes -*- |
(defsystem alpha-axp-translator-support
(:pretty-name "Alpha AXP Translator Support"
:default-pathname "VLM:EMULATOR;"
:journal-directory "VLM:TRANSLATOR;PATCH;"
:maintain-journals t
:patchable t)
(:module definitions ("vlm:alpha-emulator;aistat" "aihead" "traps") (:type :lisp-read-only))
(... |
331956768b826f5c21b3d2217c56508df5bb4468d814eeae7667de23203d3266 | tqtezos/minter-sdk | Contracts.hs | | Lorentz swap contracts .
module Lorentz.Contracts.Swaps.Contracts where
import Lorentz
import Lorentz.Test.Import (embedContractM)
import Lorentz.Contracts.MinterSdk
import Lorentz.Contracts.Swaps.Allowlisted
import Lorentz.Contracts.Swaps.Basic
import Lorentz.Contracts.Swaps.SwapPermit
import qualified Lorentz... | null | https://raw.githubusercontent.com/tqtezos/minter-sdk/6239f6ee8435977085c00c194224d4223386841a/packages/minter-contracts/src-hs/Lorentz/Contracts/Swaps/Contracts.hs | haskell | | Lorentz swap contracts .
module Lorentz.Contracts.Swaps.Contracts where
import Lorentz
import Lorentz.Test.Import (embedContractM)
import Lorentz.Contracts.MinterSdk
import Lorentz.Contracts.Swaps.Allowlisted
import Lorentz.Contracts.Swaps.Basic
import Lorentz.Contracts.Swaps.SwapPermit
import qualified Lorentz... | |
fd9975826928bd0891a3f2dda2adf09140f3465c4b6d8a8b4fa0106db5012f29 | bia-technologies/statsbit | transaction_sample_data.clj | Copyright 2020 BIA - Technologies Limited Liability Company
;;
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 t... | null | https://raw.githubusercontent.com/bia-technologies/statsbit/4102ca5e5d39b1c06541b49615c6de83e7f4ef36/backend/src/ru/bia_tech/statsbit/commands/transaction_sample_data.clj | clojure |
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 governi... | Copyright 2020 BIA - Technologies Limited Liability Company
distributed under the License is distributed on an " AS IS " BASIS ,
(ns ru.bia-tech.statsbit.commands.transaction-sample-data
(:require
[ru.bia-tech.statsbit.utils.agent-id :as u.agent-id]
[ru.bia-tech.statsbit.context :as ctx]
[ru.bia-tech.... |
b8461b8a91a18268b569167db0646d5940def2d23197258e605a98320e4da041 | clj-kondo/clj-kondo | format_test.clj | (ns clj-kondo.format-test
(:require
[clj-kondo.test-utils :refer
[lint! assert-submaps]]
[clojure.test :as t :refer [deftest is testing]]))
(deftest format-test
(assert-submaps
'({:file "<stdin>", :row 1, :col 9, :level :error, :message "Format string expects 2 arguments instead of 1."})
(lint! "(f... | null | https://raw.githubusercontent.com/clj-kondo/clj-kondo/626978461cbf113c376634cdf034d7262deb429f/test/clj_kondo/format_test.clj | clojure | (ns clj-kondo.format-test
(:require
[clj-kondo.test-utils :refer
[lint! assert-submaps]]
[clojure.test :as t :refer [deftest is testing]]))
(deftest format-test
(assert-submaps
'({:file "<stdin>", :row 1, :col 9, :level :error, :message "Format string expects 2 arguments instead of 1."})
(lint! "(f... | |
bc9b93e05ebd678640a80464a2601da4425bdf92bd5b52b9edb7da4205fea9c6 | qkrgud55/ocamlmulti | unixLabels.mli | (***********************************************************************)
(* *)
(* OCaml *)
(* *)
, projet ... | null | https://raw.githubusercontent.com/qkrgud55/ocamlmulti/74fe84df0ce7be5ee03fb4ac0520fb3e9f4b6d1f/otherlibs/unix/unixLabels.mli | ocaml | *********************************************************************
OCaml
... | , projet Cristal , INRIA Rocquencourt
Copyright 1996 Institut National de Recherche en Informatique et
en Automatique . All rights reserved . This file is distributed
under the terms of the GNU Library General Public License , with
$ I d : unixLabels.mli 11307 2011 - 1... |
ef7e0a36ea424d86bd0dd1257edb76ae2566b233b152b0bec00d0bedd4e12654 | typedclojure/typedclojure | base_env_helper_cljs.clj | Copyright ( c ) , contributors .
;; 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/typedclojure/typedclojure/4fb7224598729e823e8b59e1c05115c4fe7ebca4/typed/cljs.checker/src/clojure/core/typed/base_env_helper_cljs.clj | 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 ) , contributors .
(ns clojure.core.typed.base-env-helper-cljs
(:refer-clojure :exclude [type])
(:require [typed.cljc.checker.type-rep :as r]
[typed.clj.checker.parse-unparse :as prs]
[typed.cljc.checker.free-ops :as free-ops]
[typed.cljc.checker.type-ct... |
4787c355e4f7029bf75f9cd7af58f7119a6df1b31d3c3202f8c5ace172e695aa | gedge-platform/gedge-platform | cuttlefish_rebar_plugin.erl | %% -------------------------------------------------------------------
%%
%% cuttlefish_rebar_plugin: generates an application's default .conf
%% as part of the build
%%
Copyright ( c ) 2013 Basho Technologies , Inc.
%%
This file is provided to you under the Apache License ,
%% Version 2.0 (the "License"); you may ... | null | https://raw.githubusercontent.com/gedge-platform/gedge-platform/97c1e87faf28ba2942a77196b6be0a952bff1c3e/gs-broker/broker-server/deps/cuttlefish/src/cuttlefish_rebar_plugin.erl | erlang | -------------------------------------------------------------------
cuttlefish_rebar_plugin: generates an application's default .conf
as part of the build
Version 2.0 (the "License"); you may not use this file
a copy of the License at
-2.0
Unless required by applicable law or agreed to in writing,
KIND, ... | Copyright ( c ) 2013 Basho Technologies , Inc.
This file is provided to you under the Apache License ,
except in compliance with the License . You may obtain
software distributed under the License is distributed on an
" AS IS " BASIS , WITHOUT WARRANTIES OR CONDITIONS OF ANY
-module(cuttlefish_rebar_plugin... |
941a298a5a49382c27bdbd1ef2f03f31d11d9169bab8cc97e06f1184ee9861f8 | emqx/emqx | emqx_secret.erl | %%--------------------------------------------------------------------
Copyright ( c ) 2022 - 2023 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 o... | null | https://raw.githubusercontent.com/emqx/emqx/dbc10c2eed3df314586c7b9ac6292083204f1f68/apps/emqx/src/emqx_secret.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 ... | Copyright ( c ) 2022 - 2023 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_secret).
-export([wrap/1, unwrap/1]).
wrap(Term) ->
fun() ->
Term
... |
4bb9ae8e15710d72667bd60a1703f349be8e4f7e1a93169c2f6fd29f019e42e7 | blindglobe/clocc | adjoin-dirs.lisp | ;;; ADJOIN-DIRECTORIES
(defpackage "CL.EXT.FILESYSTEM" (:use "COMMON-LISP")
(:nicknames "cl.ext.filesystem")
(:export #:adjoin-directories))
(in-package "CL.EXT.FILESYSTEM")
;;; Debugging aids.
(defparameter *debug-adjoin-directories* nil)
(defun debug-message (format-control &rest format-args)
(when *debug-... | null | https://raw.githubusercontent.com/blindglobe/clocc/a50bb75edb01039b282cf320e4505122a59c59a7/src/defsystem-4/src/adjoin-dirs.lisp | lisp | ADJOIN-DIRECTORIES
Debugging aids.
Case 1.
dp1 and p2 are strings.
First PARSE-NAMESTRING them.
well. This is fun. MERGE-PATHNAMES returns a LOGICAL-PATHNAME
which must be correctly translated.
We need to translate the LOGICAL-PATHNAME before MERGEing the result.
would required a change in the (string string)... |
(defpackage "CL.EXT.FILESYSTEM" (:use "COMMON-LISP")
(:nicknames "cl.ext.filesystem")
(:export #:adjoin-directories))
(in-package "CL.EXT.FILESYSTEM")
(defparameter *debug-adjoin-directories* nil)
(defun debug-message (format-control &rest format-args)
(when *debug-adjoin-directories*
(apply #'format *tr... |
a7132552c3da89c46aaa7e75f0dc32a6325d97d57cf9589bcc18b1a9800996cc | Zensight/header-utils | parser.clj | (ns header-utils.parser
"Parsing utilities for header-utils. Probably only useful in extending the library."
(:require [instaparse.core :as insta]))
(def ^:private parser (insta/parser (clojure.java.io/resource "grammar.txt") :input-format :abnf))
;;utilities for xforming the parsing results
(defn tagged
"Retu... | null | https://raw.githubusercontent.com/Zensight/header-utils/380c9079a624aa20c8e83a4a1dd8fd5bcd8d9001/src/header_utils/parser.clj | clojure | utilities for xforming the parsing results | (ns header-utils.parser
"Parsing utilities for header-utils. Probably only useful in extending the library."
(:require [instaparse.core :as insta]))
(def ^:private parser (insta/parser (clojure.java.io/resource "grammar.txt") :input-format :abnf))
(defn tagged
"Returns a function that takes an instaparse node ... |
633ba56d42f74f1aa05093389d3f317b29c6ef11c67b033eda57660c3a3cbfc8 | ericclack/racket-examples | 2d.rkt | #lang racket
;; Functions for 2d drawing and transformation
(require lang/posn)
(struct pos (x y) #:transparent)
(define (move-pos a-pos a-direction a-speed)
(define r (degrees->radians a-direction))
(pos (+ (pos-x a-pos) (* a-speed (cos r)))
(+ (pos-y a-pos) (* a-speed (sin r)))))
(define (add-directio... | null | https://raw.githubusercontent.com/ericclack/racket-examples/ee858daac3577ead0c8463b9701a8653220039de/2d.rkt | racket | Functions for 2d drawing and transformation
combined effect and return new direction and speed
-----------------------------------------------------------
----------------------------------------------------------- | #lang racket
(require lang/posn)
(struct pos (x y) #:transparent)
(define (move-pos a-pos a-direction a-speed)
(define r (degrees->radians a-direction))
(pos (+ (pos-x a-pos) (* a-speed (cos r)))
(+ (pos-y a-pos) (* a-speed (sin r)))))
(define (add-direction-speeds d1 s1 d2 s2)
Given two direction & s... |
863b389f3d52d02771089ef7f73324e93e4f489b805dbbf64961ca0b07bd65e3 | ku-fpg/hermit | Flatten.hs | # LANGUAGE CPP #
module Main where
import HList
data Tree a = Node (Tree a) (Tree a) | Leaf a
flatten :: Tree a -> [a]
flatten (Leaf a) = [a]
flatten (Node l r) = flatten l ++ flatten r
main :: IO ()
main = print (flatten (Node (Leaf 'h') (Leaf 'i')))
-- Should be in a "List" module
{-# RULES "++ []" forall xs... | null | https://raw.githubusercontent.com/ku-fpg/hermit/3e7be430fae74a9e3860b8b574f36efbf9648dec/examples/flatten/Flatten.hs | haskell | Should be in a "List" module
# RULES "++ []" forall xs . xs ++ [] = xs #
# RULES "++ strict" (++) undefined = undefined #
# RULES "repH ++" forall xs ys . repH (xs ++ ys) = repH xs . repH ys #
# RULES "repH []" repH [] = id #
# RULES "repH (:)" forall x xs . repH... | # LANGUAGE CPP #
module Main where
import HList
data Tree a = Node (Tree a) (Tree a) | Leaf a
flatten :: Tree a -> [a]
flatten (Leaf a) = [a]
flatten (Node l r) = flatten l ++ flatten r
main :: IO ()
main = print (flatten (Node (Leaf 'h') (Leaf 'i')))
The " Algebra " for repH
|
463d11bc43253f66a89848c6ce3be54fc918f613552d2973cf047addfb247732 | jtdaugherty/vty | Extra.hs | {-# OPTIONS_HADDOCK hide #-}
Copyright 2009
module Data.Sequence.Extra where
import Data.Sequence
import Control.Parallel.Strategies
instance NFData a => NFData (Seq a) where
rnf = rnf' . viewl
where
rnf' EmptyL = ()
rnf' (a :< r) = rnf a >| rnf' (viewl r)
| null | https://raw.githubusercontent.com/jtdaugherty/vty/fa74b0ae1ca2883e9c4fbfe55abc9253dc7b9841/src/Data/Sequence/Extra.hs | haskell | # OPTIONS_HADDOCK hide # | Copyright 2009
module Data.Sequence.Extra where
import Data.Sequence
import Control.Parallel.Strategies
instance NFData a => NFData (Seq a) where
rnf = rnf' . viewl
where
rnf' EmptyL = ()
rnf' (a :< r) = rnf a >| rnf' (viewl r)
|
b602532f55dc302a4bcd655b51207f0455142676544f4b3b3073a7964621782c | databrary/databrary | Email.hs | {-# LANGUAGE OverloadedStrings #-}
module View.Email
( emailNewlyAuthorized
) where
import Control.Monad (void)
import qualified Text.Blaze.Html5 as H
import qualified Text.Blaze.Html5.Attributes as HA
import View.Template
emailTemplate :: H.Html -> H.Html
emailTemplate content = H.docTypeHtml $ do
H.head $
... | null | https://raw.githubusercontent.com/databrary/databrary/685f3c625b960268f5d9b04e3d7c6146bea5afda/src/View/Email.hs | haskell | # LANGUAGE OverloadedStrings # | module View.Email
( emailNewlyAuthorized
) where
import Control.Monad (void)
import qualified Text.Blaze.Html5 as H
import qualified Text.Blaze.Html5.Attributes as HA
import View.Template
emailTemplate :: H.Html -> H.Html
emailTemplate content = H.docTypeHtml $ do
H.head $
H.style H.! HA.type_ "text/css" $... |
a09bc3eb7499602fea65bcdd6c0aa7b41c73cc042f63ca15d7b58f98a15b4acf | slipstream/SlipStreamServer | pricing.clj | (ns sixsq.slipstream.pricing.lib.pricing)
;;UTIL FUNCTIONS
(defn- >0? [v] (> v 0))
(defn- no-unit? [v] (= v "C62"))
(defn- is-defined? [v] (not (no-unit? v)))
(defn- +list [l] (reduce + l))
TIME CONVERSION & HANDLING FUNCTIONS
(def timecode-hours {:ANN 1/8760
:MON 1/730
:WEE ... | null | https://raw.githubusercontent.com/slipstream/SlipStreamServer/3ee5c516877699746c61c48fc72779fe3d4e4652/jar-pricing-lib/src/sixsq/slipstream/pricing/lib/pricing.clj | clojure | UTIL FUNCTIONS
then aggregate
(println "aggregate" (sample-periods entity quantity) (count (:values quantity)))
else repeat
(println "repeat" (sample-periods entity quantity) (count (:values quantity)))
This may not be correct.
Compare billing period to sampling period maybe ?
DISCOUNT FUNCTIONS
NB : Reservation is equ... | (ns sixsq.slipstream.pricing.lib.pricing)
(defn- >0? [v] (> v 0))
(defn- no-unit? [v] (= v "C62"))
(defn- is-defined? [v] (not (no-unit? v)))
(defn- +list [l] (reduce + l))
TIME CONVERSION & HANDLING FUNCTIONS
(def timecode-hours {:ANN 1/8760
:MON 1/730
:WEE 1/168
... |
6d117e41fdb88454629bf3b171fe44e025fbe70913548c0ba2aa332363f19f7c | janestreet/base_quickcheck | environment.mli | open! Import
(** Maps type variables to patterns and expressions for gensym'd variables. Used to handle
type parameters in polymorphic type definitions. *)
type t
val empty : t
val lookup : t -> loc:location -> tyvar:string -> expression
val create
: loc:location
-> prefix:string
-> (core_type * (variance... | null | https://raw.githubusercontent.com/janestreet/base_quickcheck/b3dc5bda5084253f62362293977e451a6c4257de/ppx_quickcheck/expander/environment.mli | ocaml | * Maps type variables to patterns and expressions for gensym'd variables. Used to handle
type parameters in polymorphic type definitions.
* For generators, we want contravariant type parameters to map to observer names. For
observers, vice versa. So we create both environment simultaneously. | open! Import
type t
val empty : t
val lookup : t -> loc:location -> tyvar:string -> expression
val create
: loc:location
-> prefix:string
-> (core_type * (variance * injectivity)) list
-> pattern list * t
val create_with_variance
: loc:location
-> covariant:string
-> contravariant:string
-> (core_... |
4ee238fc7e0f96d315dace9ad0e7609e5b4eb07adb886f52f12c6ac981558df4 | uwplse/synapse | stress-test.rkt | #lang s-exp rosette
(require "../engine/metasketch.rkt" "../bv/lang.rkt" "imetasketch.rkt")
(provide test-metasketch tm-shuffled-order)
(define (test-metasketch #:length len #:order order)
(imeta #:arity 1
#:ref tm-ref
#:subset (tm-make-subset len order)
#:post tm-post
#:structu... | null | https://raw.githubusercontent.com/uwplse/synapse/10f605f8f1fff6dade90607f516550b961a10169/opsyn/metasketches/stress-test.rkt | racket | (struct nondet-space (len c)
#:transparent
#:property prop:sequence
(lambda (self) (in-set self))
#:methods gen:set
[(define (set-count self)
(min (nondet-space-len self) (nondet-space-c self)))
(define (in-set self)
(sequence-map list (shuffle all))))]) | #lang s-exp rosette
(require "../engine/metasketch.rkt" "../bv/lang.rkt" "imetasketch.rkt")
(provide test-metasketch tm-shuffled-order)
(define (test-metasketch #:length len #:order order)
(imeta #:arity 1
#:ref tm-ref
#:subset (tm-make-subset len order)
#:post tm-post
#:structu... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.