_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 |
|---|---|---|---|---|---|---|---|---|
631d03b1ee858f4e92f1fd85f409bdb9c6a0f7f4b4ff30de80791a5793a89e54 | luc-tielen/eclair-lang | Hash.hs | # LANGUAGE TypeApplications , UndecidableInstances , TypeOperators , DefaultSignatures #
module Eclair.LLVM.Hash
( Hash
, unHash
, HashEnum(..)
, HashWithPrefix(..)
, HashOnly(..)
, ToHash(..)
) where
import qualified Data.Text as T
newtype Hash = Hash { unHash :: T.Text }
instance Semigroup Hash whe... | null | https://raw.githubusercontent.com/luc-tielen/eclair-lang/924475850fd3d9e911c2eeb6f2528cc7d111aff6/lib/Eclair/LLVM/Hash.hs | haskell | # LANGUAGE TypeApplications , UndecidableInstances , TypeOperators , DefaultSignatures #
module Eclair.LLVM.Hash
( Hash
, unHash
, HashEnum(..)
, HashWithPrefix(..)
, HashOnly(..)
, ToHash(..)
) where
import qualified Data.Text as T
newtype Hash = Hash { unHash :: T.Text }
instance Semigroup Hash whe... | |
fb71de5edd2c24e711258ae7679f3ab8d15f2a2d80fe3e268f65f438cdb007c8 | reborg/clojure-essential-reference | 5.clj | (def data
[{:fee-attributes [49 8 13 38 100]
:product {:visible true
:online true
:name "Switcher AA126"
:company-id 183
:part-repayment true
:min-loan-amount 5000
:max-loan-amount 1175000
:fixed true}
:created-a... | null | https://raw.githubusercontent.com/reborg/clojure-essential-reference/c37fa19d45dd52b2995a191e3e96f0ebdc3f6d69/ReducersandTransducers/Transducers/eduction/5.clj | clojure | (def data
[{:fee-attributes [49 8 13 38 100]
:product {:visible true
:online true
:name "Switcher AA126"
:company-id 183
:part-repayment true
:min-loan-amount 5000
:max-loan-amount 1175000
:fixed true}
:created-a... | |
1a4a8a86c6a31f549b82911abf90d10d727389e800869afbae85c5fe78a025e4 | dwayne/eopl3 | ex2.17a.prev.rkt | #lang eopl
; An implementation using the representation specified by the following:
;
; Lc-exp ::= (var Identifier)
; ::= (lambda Identifier Lc-exp)
; ::= (app Lc-exp Lc-exp)
; The constructors
(define (var-exp var)
(list 'var var))
(define (lambda-exp bound-var body)
(list 'lambda bound-var body)... | null | https://raw.githubusercontent.com/dwayne/eopl3/9d5fdb2a8dafac3bc48852d49cda8b83e7a825cf/solutions/02-ch2/racket/ex2.17a.prev.rkt | racket | An implementation using the representation specified by the following:
Lc-exp ::= (var Identifier)
::= (lambda Identifier Lc-exp)
::= (app Lc-exp Lc-exp)
The constructors
The predicates
The extractors
#t
#f
(lambda (y) (y x))
#t
#f | #lang eopl
(define (var-exp var)
(list 'var var))
(define (lambda-exp bound-var body)
(list 'lambda bound-var body))
(define (app-exp rator rand)
(list 'app rator rand))
(define (var-exp? exp)
(eqv? (car exp) 'var))
(define (lambda-exp? exp)
(eqv? (car exp) 'lambda))
(define (app-exp? exp)
(eqv? (c... |
df00d5f60d51fdabb9a9bdced74baeb71b5ec67b2247b2e26330f2aea7cedb07 | SKS-Keyserver/sks-keyserver | parsePGP.mli | exception Overlong_mpi
exception Partial_body_length of int
val parse_new_packet_length : < read_byte : int; .. > -> int
val read_packet :
< read_byte : int; read_string : int -> string; .. > -> Packet.packet
val offset_read_packet :
< inchan : in_channel; read_byte : int; read_string : int -> string; .. > ->
int... | null | https://raw.githubusercontent.com/SKS-Keyserver/sks-keyserver/a4e5267d817cddbdfee13d07a7fb38a9b94b3eee/parsePGP.mli | ocaml | exception Overlong_mpi
exception Partial_body_length of int
val parse_new_packet_length : < read_byte : int; .. > -> int
val read_packet :
< read_byte : int; read_string : int -> string; .. > -> Packet.packet
val offset_read_packet :
< inchan : in_channel; read_byte : int; read_string : int -> string; .. > ->
int... | |
7af2260388e936c414928dfe8c918fe23684b9ad1e206200766a128372610d83 | aws-beam/aws-erlang | aws_elastic_inference.erl | %% WARNING: DO NOT EDIT, AUTO-GENERATED CODE!
See -beam/aws-codegen for more details .
%% @doc Elastic Inference public APIs.
-module(aws_elastic_inference).
-export([describe_accelerator_offerings/2,
describe_accelerator_offerings/3,
describe_accelerator_types/1,
describe_accelerator_typ... | null | https://raw.githubusercontent.com/aws-beam/aws-erlang/699287cee7dfc9dc8c08ced5f090dcc192c9cba8/src/aws_elastic_inference.erl | erlang | WARNING: DO NOT EDIT, AUTO-GENERATED CODE!
@doc Elastic Inference public APIs.
====================================================================
API
====================================================================
@doc Describes the locations in which a given accelerator type or set of
types is present in a... | See -beam/aws-codegen for more details .
-module(aws_elastic_inference).
-export([describe_accelerator_offerings/2,
describe_accelerator_offerings/3,
describe_accelerator_types/1,
describe_accelerator_types/3,
describe_accelerator_types/4,
describe_accelerators/2,
... |
372e48030e946a3f08f364a6c333d04a711bca474ae1a99167acd8b093ddda59 | francescoc/scalabilitywitherlangotp | coffee_fsm_timeout.erl | -module(coffee_fsm_timeout).
-behaviour(gen_fsm).
-export([start_link/0, stop/0]).
-export([init/1, terminate/3, handle_event/3]). %% Callback functions
States
-export([americano/0, cappuccino/0, tea/0, %% Client Functions
espresso/0, pay/1, cancel/0, cup_removed/0]).
-define(TIMEOUT, 10000).
s... | null | https://raw.githubusercontent.com/francescoc/scalabilitywitherlangotp/961de968f034e55eba22eea9a368fe9f47c608cc/ch6/otp/coffee_fsm_timeout.erl | erlang | Callback functions
Client Functions
Client Functions for Actions | -module(coffee_fsm_timeout).
-behaviour(gen_fsm).
-export([start_link/0, stop/0]).
States
espresso/0, pay/1, cancel/0, cup_removed/0]).
-define(TIMEOUT, 10000).
start_link() ->
gen_fsm:start_link({local, ?MODULE}, ?MODULE, [], []).
init([]) ->
hw:reboot(),
hw:display("Make Your Selection", []... |
bbcc83a7abca31694580810d476e51edf89922fff202f304f1ae05552ccd7355 | msakai/toysolver | toysmt.hs | # OPTIONS_GHC -Wall #
# LANGUAGE CPP #
-----------------------------------------------------------------------------
-- |
-- Module : toysmt
Copyright : ( c ) 2015
-- License : BSD-style
--
-- Maintainer :
-- Stability : experimental
-- Portability : non-portable
--
--------------------------... | null | https://raw.githubusercontent.com/msakai/toysolver/5dc84559c2ec782b2247febe529e4abd0971d1d3/app/toysmt/toysmt.hs | haskell | ---------------------------------------------------------------------------
|
Module : toysmt
License : BSD-style
Maintainer :
Stability : experimental
Portability : non-portable
--------------------------------------------------------------------------- | # OPTIONS_GHC -Wall #
# LANGUAGE CPP #
Copyright : ( c ) 2015
module Main where
import Control.Applicative
import Control.Monad
import Control.Monad.Trans
import Data.Version
import Options.Applicative hiding (Parser)
import qualified Options.Applicative as Opt
#ifdef USE_HASKELINE_PACKAGE
import qualified Sy... |
bbbfef0897cb6e6b2f5169a28efdb11f9d0de9b816274d7ddecda3e043067c26 | haskell-compat/base-compat | Batteries.hs | {-# LANGUAGE PackageImports #-}
# OPTIONS_GHC -fno - warn - dodgy - exports -fno - warn - unused - imports #
-- | Reexports "Data.Version.Compat"
-- from a globally unique namespace.
module Data.Version.Compat.Repl.Batteries (
module Data.Version.Compat
) where
import "this" Data.Version.Compat
| null | https://raw.githubusercontent.com/haskell-compat/base-compat/847aa35c4142f529525ffc645cd035ddb23ce8ee/base-compat-batteries/src/Data/Version/Compat/Repl/Batteries.hs | haskell | # LANGUAGE PackageImports #
| Reexports "Data.Version.Compat"
from a globally unique namespace. | # OPTIONS_GHC -fno - warn - dodgy - exports -fno - warn - unused - imports #
module Data.Version.Compat.Repl.Batteries (
module Data.Version.Compat
) where
import "this" Data.Version.Compat
|
e47be66f70dc9b8fc963a9b8258f34ea8d5d895167985d58c806d0c626e4056d | jepsen-io/jepsen | checker_test.clj | (ns jepsen.checker-test
(:refer-clojure :exclude [set])
(:use clojure.test)
(:require [clojure [datafy :refer [datafy]]
[pprint :refer [pprint]]]
[jepsen [checker :refer :all]
[db :as db]
[history :as h]
[store :as store]... | null | https://raw.githubusercontent.com/jepsen-io/jepsen/fb22d4c5422b620782cbe8eda24e8fbe68d5871d/jepsen/test/jepsen/checker_test.clj | clojure | Helpers for making ops
OK writes
Info writes
Failed writes
Final read
nope
Broadening identical points
Normal integers
Bigger integers
Tiny numbers
I don't like these answers but whatever
Go check store/latency graph, store/perf graph, etc to make sure these
look right
Hnnnnnnnnnng we should simplify this... | (ns jepsen.checker-test
(:refer-clojure :exclude [set])
(:use clojure.test)
(:require [clojure [datafy :refer [datafy]]
[pprint :refer [pprint]]]
[jepsen [checker :refer :all]
[db :as db]
[history :as h]
[store :as store]... |
644b3c185aa8de715c0e64cc05ced4de00f5873e85680f2c7b5bed2ab9fe2153 | learningclojurescript/code-examples | async.cljs | (ns experiment.async
"Logic for handling messages from the kitten factory."
(:require [cljs.core.async :as async]
[ajax.core :refer [GET]])
(:require-macros
[cljs.core.async.macros :as async-macros]))
(defn error?
[x]
(instance? js/Error x))
(defn throw-err
[x]
(if (error? x)
(throw ... | null | https://raw.githubusercontent.com/learningclojurescript/code-examples/fdbd0e35ae5a16d53f1f784a52c25bcd4e5a8097/chapter-2/experiment/src/experiment/async.cljs | clojure | (send-success-report-to-cat-hq)
(send-error-report-to-cat-hq e) | (ns experiment.async
"Logic for handling messages from the kitten factory."
(:require [cljs.core.async :as async]
[ajax.core :refer [GET]])
(:require-macros
[cljs.core.async.macros :as async-macros]))
(defn error?
[x]
(instance? js/Error x))
(defn throw-err
[x]
(if (error? x)
(throw ... |
b18e02f504763a79f73ea02608466060b129bfd6f7bc83806aa34101c7efd90a | data61/Mirza | GS1BeamOrphans.hs | {-# LANGUAGE DeriveGeneric #-}
# LANGUAGE FlexibleContexts #
# LANGUAGE FlexibleInstances #
# LANGUAGE GeneralizedNewtypeDeriving #
# LANGUAGE MultiParamTypeClasses #
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE PartialTypeSignatures #-}
# LANGUAGE StandaloneDeri... | null | https://raw.githubusercontent.com/data61/Mirza/24e5ccddfc307cceebcc5ce26d35e91020b8ee10/projects/mirza-common-haskell/src/Mirza/Common/GS1BeamOrphans.hs | haskell | # LANGUAGE DeriveGeneric #
# LANGUAGE OverloadedStrings #
# LANGUAGE PartialTypeSignatures #
# LANGUAGE TemplateHaskell #
# LANGUAGE UndecidableInstances #
| This module contains the
TODO: Add proper parsing for EPC.GS1CompanyPrefix
Beam Type definitions
======= Event Typ... | # LANGUAGE FlexibleContexts #
# LANGUAGE FlexibleInstances #
# LANGUAGE GeneralizedNewtypeDeriving #
# LANGUAGE MultiParamTypeClasses #
# LANGUAGE StandaloneDeriving #
# OPTIONS_GHC -fno - warn - orphans #
| This module includes all of the orphaned instances for GS1 types f... |
42141bb07c07601f2b604ba764b796ea94a8f745733791f2ef6272fda923f999 | darkleaf/publicator | form_renderer.clj | (ns publicator.web.form-renderer
(:require
[cljstache.core :as mustache]
[publicator.web.transit :as transit]))
(defn render [form]
(mustache/render "<div data-form-ujs=\"{{ data }}\" />", {:data (transit/write form)}))
| null | https://raw.githubusercontent.com/darkleaf/publicator/e07eee93d8f3d9c07a15d574619d5ea59c00f87d/web/src/publicator/web/form_renderer.clj | clojure | (ns publicator.web.form-renderer
(:require
[cljstache.core :as mustache]
[publicator.web.transit :as transit]))
(defn render [form]
(mustache/render "<div data-form-ujs=\"{{ data }}\" />", {:data (transit/write form)}))
| |
5185bb3b02e22cf2d249295812e6e3ef5b4e8972c1b76b9c134578f28898f094 | basho/riak_test | ts_simple_select_nogap.erl | %% -------------------------------------------------------------------
%%
Copyright ( c ) 2015 Basho Technologies , Inc.
%%
This file is provided to you under the Apache License ,
%% Version 2.0 (the "License"); you may not use this file
except in compliance with the License . You may obtain
%% a copy of the Li... | null | https://raw.githubusercontent.com/basho/riak_test/8170137b283061ba94bc85bf42575021e26c929d/tests/ts_simple_select_nogap.erl | erlang | -------------------------------------------------------------------
Version 2.0 (the "License"); you may not use this file
a copy of the License at
-2.0
Unless required by applicable law or agreed to in writing,
KIND, either express or implied. See the License for the
specific language governing permissio... | Copyright ( c ) 2015 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
1.4.0 shipped with a exceptio... |
2aec7f2f541e59104447ad8ac8905cae00717948e461f0d0b501ac48c0498f6d | arrdem/microfiche | microfiche.clj | (ns microfiche
"Tools for locating and extracting Java documentation from Javadocs.
This namespace is HEAVILY inspired by `clojure.java.javadoc`, which
has a particular and dated API unsuited to composition or
programmatic access."
{:authors ["Reid \"arrdem\" McKenzie <>"
"Christophe Grand"
... | null | https://raw.githubusercontent.com/arrdem/microfiche/d45b5358e612afc573ee857ad6911d2f9064c2b5/src/main/clj/microfiche.clj | clojure | (ns microfiche
"Tools for locating and extracting Java documentation from Javadocs.
This namespace is HEAVILY inspired by `clojure.java.javadoc`, which
has a particular and dated API unsuited to composition or
programmatic access."
{:authors ["Reid \"arrdem\" McKenzie <>"
"Christophe Grand"
... | |
0edb3cf742f5e9f543514170a41575aa713d6d3280d11b72563c35e6a4c0b56a | sthilaid/space-invaders | font-macro.scm | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;
;; filename: font-macro.scm
;;
description : This file contains abstraction related to symmertric
bitmap fonts . By symmertric , it is meant that all the characters
;; must have the same size.
;;
author :
;;
;;;;;;;;;;;;;;;;;;;... | null | https://raw.githubusercontent.com/sthilaid/space-invaders/42baab45e3f477c630f782cd93d2d1f0b3f00bf6/font-macro.scm | scheme |
filename: font-macro.scm
must have the same size.
Generates code that will load an bitmap font called font-name at
runtime into a C array of the same name. The array must have been
and good-char-(width|height) is that the good ones should be the
font-name.ppm (here font-name is the value passed on the
mac... | description : This file contains abstraction related to symmertric
bitmap fonts . By symmertric , it is meant that all the characters
author :
(c-declare "#include <gl.h>\n")
previously be declared . The difference between )
lowest power of 2 greater then the corresponding ) .
(define-macro (runtime-f... |
a62d82054e747e2e1e69ce1e911f82d7ed5ceeacb7fd7ccc2647fb05e88e8d64 | stuartsierra/lazytest | test_pretty.clj | test_pretty.clj -- part of the pretty printer for Clojure
Copyright ( c ) . All rights reserved .
; The use and distribution terms for this software are covered by the
; Eclipse Public License 1.0 (-1.0.php)
; which can be found in the file epl-v10.html at the root of this distribution.
; By using this... | null | https://raw.githubusercontent.com/stuartsierra/lazytest/3b0f419ce3d6f259d2ab3cfde475fa491a4db23e/modules/clojure-language-tests/test/clojure/test_clojure/pprint/test_pretty.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 ... | test_pretty.clj -- part of the pretty printer for Clojure
Copyright ( c ) . All rights reserved .
Author :
April 3 , 2009
(in-ns 'clojure.test-clojure.pprint)
(simple-tests xp-fill-test
(binding [*print-pprint-dispatch* simple-dispatch
*print-right-margin* 38
*print-miser-w... |
957192d35e262c2f4166be83d63ce51028f86a19ce58389d87ce1fdf0c37ecea | fission-codes/fission | Types.hs | module Fission.Web.Server.Environment.Storage.Types (Environment (..)) where
import Fission.Prelude
import Fission.Web.Server.Storage.PostgreSQL.ConnectionInfo.Types
-- | Configuration for the web application
data Environment = Environment
{ pgConnectInfo :: ConnectionInfo -- ^ PostgreSQL con... | null | https://raw.githubusercontent.com/fission-codes/fission/11d14b729ccebfd69499a534445fb072ac3433a3/fission-web-server/library/Fission/Web/Server/Environment/Storage/Types.hs | haskell | | Configuration for the web application
^ PostgreSQL configuration
^ Number of database stripes
^ Maximum number of concurrent connections per stripe
^ Maxiumum connection time | module Fission.Web.Server.Environment.Storage.Types (Environment (..)) where
import Fission.Prelude
import Fission.Web.Server.Storage.PostgreSQL.ConnectionInfo.Types
data Environment = Environment
} deriving Show
instance FromJSON Environment where
parseJSON = withObject "Storage.Environment... |
ddccb15a7ea8fa91add068d0b87ff0abb5d234d820f38625f2aedcae594062ce | boot-clj/bootstrap | properties.clj | (ns bootstrap.properties
"Boot .properties file management."
(:require [clojure.java.io :as io]
[clojure.string :as s])
(:import [java.io File]
[java.util Properties]))
(defn- normalize-key [index]
(-> index
(s/lower-case)
(s/replace "_" "-")
(s/replace "." "-")
(keyword... | null | https://raw.githubusercontent.com/boot-clj/bootstrap/55538d9942e32a2acddb490a4f3a5bb916c9e49f/src/bootstrap/properties.clj | clojure | TODO: normalize more types of input | (ns bootstrap.properties
"Boot .properties file management."
(:require [clojure.java.io :as io]
[clojure.string :as s])
(:import [java.io File]
[java.util Properties]))
(defn- normalize-key [index]
(-> index
(s/lower-case)
(s/replace "_" "-")
(s/replace "." "-")
(keyword... |
baec3146d69edcce5972d17fe73ed39b9fd0878f9dcc04873f14cfa20059b2ce | adacapo21/plutusPioneerProgram | EvenOdd.hs | {-# LANGUAGE DataKinds #-}
{-# LANGUAGE DeriveAnyClass #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE FlexibleContexts #-}
# LANGUAGE MultiParamTypeClasses #
# LANGUAGE NoImplicitPrelude #
# LANGUAGE OverloadedStrings #
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE Templ... | null | https://raw.githubusercontent.com/adacapo21/plutusPioneerProgram/8e1152659fe4c05a4e29d18150835fb615471231/week07/src/Week07/EvenOdd.hs | haskell | # LANGUAGE DataKinds #
# LANGUAGE DeriveAnyClass #
# LANGUAGE DeriveGeneric #
# LANGUAGE FlexibleContexts #
# LANGUAGE ScopedTypeVariables #
# LANGUAGE TemplateHaskell #
# LANGUAGE TypeOperators #
data type Game - a parameter for the contract
players identified by their... | # LANGUAGE MultiParamTypeClasses #
# LANGUAGE NoImplicitPrelude #
# LANGUAGE OverloadedStrings #
# LANGUAGE TypeApplications #
# LANGUAGE TypeFamilies #
module Week07.EvenOdd
( Game (..)
, GameChoice (..)
, FirstParams (..)
, SecondParams (..)
, GameSchema
, endpoints
... |
ae4abcbe5d17fac4230cf153f3b406290d03af3b8621af94ccec8112a55665be | chrisdone/chrisdone-xmonad | Main.hs | {-# OPTIONS -Wall #-}
| XMonad program .
module Main where
import Control.Monad
import qualified Data.Map as M
import XMonad
import XMonad.Actions.DeManage (demanage)
import XMonad.Config.Gnome (gnomeConfig)
import XMonad.Hooks.EwmhDeskt... | null | https://raw.githubusercontent.com/chrisdone/chrisdone-xmonad/5a3a4d7da7ef653becb8e4b5da3b76a52b1feb52/src/Main.hs | haskell | # OPTIONS -Wall #
| Main entry point. |
| XMonad program .
module Main where
import Control.Monad
import qualified Data.Map as M
import XMonad
import XMonad.Actions.DeManage (demanage)
import XMonad.Config.Gnome (gnomeConfig)
import XMonad.Hooks.EwmhDesktops (ewmh)
import ... |
86209d58e0407863ae325e739ad22b13a6d7b9c7428f02f4f961635abf8d2ebe | wlitwin/graphv | color.ml | type t = {
r : float;
g : float;
b : float;
a : float;
}
let premultiply t = {
t with
r = t.r *. t.a;
g = t.g *. t.a;
b = t.b *. t.a;
}
let rgbaf ~r ~g ~b ~a = {
r; g; b; a;
}
let rgbf ~r ~g ~b =
rgbaf ~r ~g ~b ~a:1.
let rgba ~r ~g ~b ~a = {
r = float r /. 255.;
g = ... | null | https://raw.githubusercontent.com/wlitwin/graphv/d0a09575c5ff5ee3727c222dd6130d22e4cf62d9/gles3/core/color.ml | ocaml | type t = {
r : float;
g : float;
b : float;
a : float;
}
let premultiply t = {
t with
r = t.r *. t.a;
g = t.g *. t.a;
b = t.b *. t.a;
}
let rgbaf ~r ~g ~b ~a = {
r; g; b; a;
}
let rgbf ~r ~g ~b =
rgbaf ~r ~g ~b ~a:1.
let rgba ~r ~g ~b ~a = {
r = float r /. 255.;
g = ... | |
22dd50ec4ca3e80e7e662616f05ee8a65598746cadf2a3c4a873eeeb049202b9 | libguestfs/virt-v2v | create_kubevirt_yaml.ml | virt - v2v
* Copyright ( C ) 2009 - 2022 Red Hat Inc.
*
* This program is free software ; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation ; either version 2 of the License , or
* ( at your option ) any later ... | null | https://raw.githubusercontent.com/libguestfs/virt-v2v/8db50a85f0363d90918edd1af4fc20ddc245b421/output/create_kubevirt_yaml.ml | ocaml | The guest name.
XXX genid
Memory.
# vCPUs. XXX vendor, model, topology
XXX firmware, display, sound
We're using local ("host") disks here which is not realistic.
XXX How to place devices on the bus?
XXX removables
Create the final document.
Return the YAML document. | virt - v2v
* Copyright ( C ) 2009 - 2022 Red Hat Inc.
*
* This program is free software ; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation ; either version 2 of the License , or
* ( at your option ) any later ... |
3eeeddd9cacfc7b891a3beb48d6b1c347e60e7b741462ae373d21fdba63995a5 | oofp/Beseder | ListHelper.hs | # LANGUAGE DataKinds #
# LANGUAGE ExistentialQuantification #
# LANGUAGE FlexibleContexts #
# LANGUAGE FlexibleInstances #
# LANGUAGE LambdaCase #
# LANGUAGE MultiParamTypeClasses #
# LANGUAGE TypeApplications #
{-# LANGUAGE TypeFamilies #-... | null | https://raw.githubusercontent.com/oofp/Beseder/a0f5c5e3138938b6fa18811d646535ee6df1a4f4/src/Beseder/Utils/ListHelper.hs | haskell | # LANGUAGE TypeFamilies #
# LANGUAGE TypeOperators #
# LANGUAGE TypeSynonymInstances #
# LANGUAGE ScopedTypeVariables #
# LANGUAGE UndecidableInstances #
TODO:: unify with Contains from Machine
Subtract '["1","2"] '["1"] :: [Symbol]
= '["2"]
Subtract '["1","2","5","3"] '["... | # LANGUAGE DataKinds #
# LANGUAGE ExistentialQuantification #
# LANGUAGE FlexibleContexts #
# LANGUAGE FlexibleInstances #
# LANGUAGE LambdaCase #
# LANGUAGE MultiParamTypeClasses #
# LANGUAGE TypeApplications #
# LANGUAGE FunctionalDependencies #
#... |
76678d9cd363f8116ef89df7f23889c6faaeda5bd99b2b91ff7a035b057cf9d6 | uim/sigscheme | test-srfi1-another.scm | #! /usr/bin/env sscm -C UTF-8
;; Filename : test-srfi1-another.scm
;; About : unit test for SRFI-1 (another version)
;;
Copyright ( c ) 2007 - 2008 SigScheme Project < uim - en AT googlegroups.com >
;;
;; All rights reserved.
;;
;; Redistribution and use in source and binary forms, with or without
;; modifi... | null | https://raw.githubusercontent.com/uim/sigscheme/ccf1f92d6c2a0f45c15d93da82e399c2a78fe5f3/test/test-srfi1-another.scm | scheme | Filename : test-srfi1-another.scm
About : unit test for SRFI-1 (another version)
All rights reserved.
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 d... | #! /usr/bin/env sscm -C UTF-8
Copyright ( c ) 2007 - 2008 SigScheme Project < uim - en AT googlegroups.com >
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 authors nor the names of its contribu... |
fb6f9aac5f0506aa40d1854af7ae5cf3ea940e6a204b44664d01c8da634449dc | triffon/fp-2022-23 | 02-is-em.rkt | #lang racket
даден списък l от числа и двуместна ⊕.
Функцията f наричаме “ ендоморфизъм над l ” , ако f трансформира l си , запазвайки операцията ⊕ , .
;; ∀x∈l f(x)∈l и
∀x , y∈l f(x ) ⊕ f(y ) = f(x ⊕ y ) .
Да се реализира функция is - em ? , дали f е ендоморфизъм .
;; ∀x∈l f(x)∈l
(define (maps-into-... | null | https://raw.githubusercontent.com/triffon/fp-2022-23/700762784b7bcaac3dd1ea45b6220de816e3ed50/exercises/inf2/exams/01-exam/exam-2018-2019/02-is-em.rkt | racket | ∀x∈l f(x)∈l и
∀x∈l f(x)∈l
; = > # t | #lang racket
даден списък l от числа и двуместна ⊕.
Функцията f наричаме “ ендоморфизъм над l ” , ако f трансформира l си , запазвайки операцията ⊕ , .
∀x , y∈l f(x ) ⊕ f(y ) = f(x ⊕ y ) .
Да се реализира функция is - em ? , дали f е ендоморфизъм .
(define (maps-into-itself? list function)
(foldl
... |
2a3bbbb86af08178e4003410f1284e9e287be4b6161e395a1bae1d9c8f52572f | emqx/emqx-reloader | emqx_reloader_sup.erl | %%--------------------------------------------------------------------
Copyright ( c ) 2020 EMQ Technologies Co. , Ltd. All Rights Reserved .
%%
Licensed under the Apache License , Version 2.0 ( the " License " ) ;
%% you may not use this file except in compliance with the License.
%% You may obtain a copy of the L... | null | https://raw.githubusercontent.com/emqx/emqx-reloader/151378d02512a06323e2978ae896580df396d472/src/emqx_reloader_sup.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 ) 2020 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_reloader_sup).
-behaviour(supervisor).
-export([start_link/0]).
-export([init/1]).
sta... |
fa83d1a61fd199b0c31a8fb25ec72b2e5bb38aac2f0b01779d50930614c6e5fa | tarides/dune-release | publish.ml | ---------------------------------------------------------------------------
Copyright ( c ) 2016 . All rights reserved .
Distributed under the ISC license , see terms at the end of the file .
% % NAME%% % % ---------------------------------------------------------------------------
Copyright (c) ... | null | https://raw.githubusercontent.com/tarides/dune-release/6bfed0f299b82c0931c78d4e216fd0efedff0673/bin/publish.ml | ocaml | If `publish doc` is invoked explicitly from the CLI, we should fail if the
documentation cannot be published. If it is not called explicitly, we can
skip this step if the `doc` field of the opam file is not set.
Command line interface | ---------------------------------------------------------------------------
Copyright ( c ) 2016 . All rights reserved .
Distributed under the ISC license , see terms at the end of the file .
% % NAME%% % % ---------------------------------------------------------------------------
Copyright (c) ... |
0f9e00e46fd0bc6d02a114e5548723ac6ba383c53840438906dcefe4c6cfa66c | lojic/LearningRacket | advent-test.rkt | #lang racket
;; Tests for advent.rkt
(require "./advent.rkt")
(module+ test
(require rackunit)
;; ascending-permutations-generator ---------------------------------------------------------
(let ([ g (ascending-permutations-generator 3 '(1 2 3 4 5)) ])
(for ([ lst (in-list '((1 2 3) (1 2 4) (1 2 5) (1 3 4... | null | https://raw.githubusercontent.com/lojic/LearningRacket/fab3c53a0d8d9e9e6e5fbe6e0825c2f9da72f465/advent-of-code-2022/advent-test.rkt | racket | Tests for advent.rkt
ascending-permutations-generator ---------------------------------------------------------
atom -------------------------------------------------------------------------------------
atom? ------------------------------------------------------------------------------------
atoms ---------------... | #lang racket
(require "./advent.rkt")
(module+ test
(require rackunit)
(let ([ g (ascending-permutations-generator 3 '(1 2 3 4 5)) ])
(for ([ lst (in-list '((1 2 3) (1 2 4) (1 2 5) (1 3 4) (1 3 5)
(1 4 5) (2 3 4) (2 3 5) (2 4 5) (3 4 5))) ])
(check-equal? (g) lst)))
(fo... |
f6e6f04ebec2b83ac3c59c84619ef99234f88eafc3a1934668fd788b77701181 | robert-strandh/Clordane | gui.lisp | (cl:in-package #:clordane)
(clim:define-application-frame clordane ()
((%queue :initform (receptacle:make-blocking-queue)
:reader queue)
(%source :initform nil :accessor source))
(:panes (backtrace :application :scroll-bars nil)
(source :application :scroll-bars nil :display-function 'displ... | null | https://raw.githubusercontent.com/robert-strandh/Clordane/da95f2f4d555e9ea10028e1a74aca5a152f7596f/Code/gui.lisp | lisp | (cl:in-package #:clordane)
(clim:define-application-frame clordane ()
((%queue :initform (receptacle:make-blocking-queue)
:reader queue)
(%source :initform nil :accessor source))
(:panes (backtrace :application :scroll-bars nil)
(source :application :scroll-bars nil :display-function 'displ... | |
84bf55c03f3a9047a9998e730ee98b0bfaec8b34ec409d828da9778dfb295f99 | francescoc/erlangprogramming | echo.erl | %% Code from
%% Erlang Programming
and
O'Reilly , 2008
%% /
/
( c ) and
-module(echo).
-export([go/0, loop/0]).
go() ->
Pid = spawn(echo, loop, []),
Pid ! {self(), hello},
receive
{Pid, Msg} ->
io:format("~w~n",[Msg])
end,
Pid ! stop.
loop() ->
receive
... | null | https://raw.githubusercontent.com/francescoc/erlangprogramming/b4c39cbebe6599f23eb9d1a052316baf75e40a47/chapter4/echo.erl | erlang | Code from
Erlang Programming
/ | and
O'Reilly , 2008
/
( c ) and
-module(echo).
-export([go/0, loop/0]).
go() ->
Pid = spawn(echo, loop, []),
Pid ! {self(), hello},
receive
{Pid, Msg} ->
io:format("~w~n",[Msg])
end,
Pid ! stop.
loop() ->
receive
{From, Msg} ->
From ! {self(), Msg},... |
e6724993851a1c386ee678faf4d8ee62fad590541db6f1d3a87924e81c596913 | orchid-hybrid/microKanren-sagittarius | t1.scm | (import (scheme base)
(test-check))
(test-check "test check working!"
'yes
'yes)
| null | https://raw.githubusercontent.com/orchid-hybrid/microKanren-sagittarius/9e740bbf94ed2930f88bbcf32636d3480934cfbb/t/t1.scm | scheme | (import (scheme base)
(test-check))
(test-check "test check working!"
'yes
'yes)
| |
db5a9543dec56806a02a00727f7c8cddde7ed622906f384851ea771d6ef1d5c5 | emillon/switch-builder | monorepo.ml | open Import
let depends_on_any packages (formula : OpamTypes.filtered_formula) =
let packages = List.map OpamPackage.Name.of_string packages in
let is_one_of_packages name =
List.exists (fun p -> OpamPackage.Name.compare p name = 0) packages
in
OpamFormula.fold_left
(fun acc (name, _) -> acc || is_one_... | null | https://raw.githubusercontent.com/emillon/switch-builder/353136ebca5df5dd552efd9bb022b8e9a69078a7/monorepo.ml | ocaml | open Import
let depends_on_any packages (formula : OpamTypes.filtered_formula) =
let packages = List.map OpamPackage.Name.of_string packages in
let is_one_of_packages name =
List.exists (fun p -> OpamPackage.Name.compare p name = 0) packages
in
OpamFormula.fold_left
(fun acc (name, _) -> acc || is_one_... | |
1c5559ae3718b4b689c875d5cdc8752e85c87f422646f5b801aaa7c142c03fbd | gren-lang/compiler | Primitives.hs | {-# LANGUAGE BangPatterns #-}
{-# LANGUAGE Rank2Types #-}
# LANGUAGE UnboxedTuples #
# OPTIONS_GHC -fno - warn - name - shadowing #
module Parse.Primitives
( fromByteString,
Parser (..),
State (..),
Row,
Col,
oneOf,
oneOfWithFallback,
inContext,
specialize,
getPosition,
getCol... | null | https://raw.githubusercontent.com/gren-lang/compiler/7fd91be8a45cef1f3356f8247b409fbbe87e193d/compiler/src/Parse/Primitives.hs | haskell | # LANGUAGE BangPatterns #
# LANGUAGE Rank2Types #
PARSER
consumed ok
empty ok
consumed err
empty err
PERF try taking some out to avoid allocation
APPLICATIVE
PERF is this function okay? Worried about allocation/laziness with fallback values.
FROM BYTESTRING
POSITION
INDENT
CONTEXT
LOW-LEVEL CHECKS | # LANGUAGE UnboxedTuples #
# OPTIONS_GHC -fno - warn - name - shadowing #
module Parse.Primitives
( fromByteString,
Parser (..),
State (..),
Row,
Col,
oneOf,
oneOfWithFallback,
inContext,
specialize,
getPosition,
getCol,
addLocation,
addEnd,
getIndent,
setInden... |
5a61cf8225f2623dfc9960e3cf17253cab74be09e5760b003e8d63981ccb62ed | stepcut/ircbot | PosixLogger.hs | {-# LANGUAGE OverloadedStrings #-}
{-
Use the 'unix' library to write the log file. Why not 'Handles' you
ask? I believe it is because 'Handles' lock the file, and we want to
be able to serve the file while it is still being written.
-}
module Network.IRC.Bot.PosixLogger where
import Control.Concurrent.Chan
import D... | null | https://raw.githubusercontent.com/stepcut/ircbot/13c43bb31bf87eeeb9f96c0f2210c21041ecc2b6/Network/IRC/Bot/PosixLogger.hs | haskell | # LANGUAGE OverloadedStrings #
Use the 'unix' library to write the log file. Why not 'Handles' you
ask? I believe it is because 'Handles' lock the file, and we want to
be able to serve the file while it is still being written.
TODO: This should be modified so that a formatting filter can be applied to the log mess... | module Network.IRC.Bot.PosixLogger where
import Control.Concurrent.Chan
import Data.ByteString (ByteString)
import qualified Data.ByteString as B
import Data.ByteString.Char8 (pack, unpack)
import Data.Time.Calendar (Day(..))
import Data.Time.Clock (UTCTime(..), getCurrentTime)
import Data.Time.Format (defa... |
84a7fc99a1bd287af53b40e0ef78e3ea1fb9aa1d671302c63018d6ad39237414 | repl-acement/repl-acement | hashing.cljc | (ns replacement.protocol.hashing
#?(:cljs (:require [promesa.core :as p])
:clj (:import (java.security MessageDigest)
(org.apache.commons.codec.binary Hex))))
(defn string->encoded-data
[s]
#?(:clj s
Always UTF-8
(.encode encoder s))))
(defn bytes->hex
[array-buffer]... | null | https://raw.githubusercontent.com/repl-acement/repl-acement/ba60e2f0c58e1143235d147396b310bdd30791a0/repl-shared/replacement/protocol/hashing.cljc | clojure | (ns replacement.protocol.hashing
#?(:cljs (:require [promesa.core :as p])
:clj (:import (java.security MessageDigest)
(org.apache.commons.codec.binary Hex))))
(defn string->encoded-data
[s]
#?(:clj s
Always UTF-8
(.encode encoder s))))
(defn bytes->hex
[array-buffer]... | |
22edddbd28ddd7e170a3a00542285ed344c276bab77386be6820933c68ae3354 | ostinelli/syn | syn_app.erl | %% ==========================================================================================================
Syn - A global Process Registry and Process Group manager .
%%
The MIT License ( MIT )
%%
Copyright ( c ) 2015 - 2022 < > and Neato Robotics , Inc.
%%
%% Permission is hereby granted, free of charge, t... | null | https://raw.githubusercontent.com/ostinelli/syn/0993c938592c6f8a80f6b88bad9168880dde1bf3/src/syn_app.erl | erlang | ==========================================================================================================
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
to use, copy, modify, merge, publish, distribute, s... | Syn - A global Process Registry and Process Group manager .
The MIT License ( MIT )
Copyright ( c ) 2015 - 2022 < > and Neato Robotics , Inc.
in the Software without restriction , including without limitation the rights
copies of the Software , and to permit persons to whom the Software is
all copies or ... |
df2f37a426c8241a7ed76b7c815ec7dd0f717265fa4b37b404ae827fc255a250 | lpw25/ecaml | error.mli | * Error reporting
All internal errors are represented uniformly with a single exception that
carries additional details such as error kind ( syntax , typing , ... ) , message
or location .
Errors are raised through helper functions that take an optional location
and a message in form of ... | null | https://raw.githubusercontent.com/lpw25/ecaml/4588abb18436fb8a4983a353923ee667bf8c90a0/src/utils/error.mli | ocaml | * Type of errors.
* Print an error.
* Exception representing all possible errors.
* Fatal errors.
* Syntax errors.
* Typing errors.
* Runtime errors. | * Error reporting
All internal errors are represented uniformly with a single exception that
carries additional details such as error kind ( syntax , typing , ... ) , message
or location .
Errors are raised through helper functions that take an optional location
and a message in form of ... |
6a6f34d62d5184cd5dfad25d8ba5156b92337c714e44fa8029bf07e92d1889d2 | nyu-acsys/drift | bcopy.ml |
let make_array n = n
let arraysize src = src
let update des i x = assert (0 <= i && i < des)
let sub src i = assert (0 <= i && i < src); 0
let rec bcopy_aux src des i m =
if i >= m
then ()
else
begin
update des i (sub src i);
bcopy_aux src des (i+1) m
end
let bcopy src des = bcopy_aux src d... | null | https://raw.githubusercontent.com/nyu-acsys/drift/51a3160d74b761626180da4f7dd0bb950cfe40c0/tests/benchmarks/r_type/high/bcopy.ml | ocaml | -:{v:Int|true}
-:{v:Int|true} |
let make_array n = n
let arraysize src = src
let update des i x = assert (0 <= i && i < des)
let sub src i = assert (0 <= i && i < src); 0
let rec bcopy_aux src des i m =
if i >= m
then ()
else
begin
update des i (sub src i);
bcopy_aux src des (i+1) m
end
let bcopy src des = bcopy_aux src d... |
5432ca0fd9ede7563eacbf168b6a2c24cbf3d4b5d6940a4651e1ac8aba086f7b | yjqww6/racket-x64asm | sysv.rkt | #lang typed/racket
(require x64asm
typed/racket/unsafe)
(define-cast flfls
#:type (FlVector FlVector -> Void)
#:ctype (let ()
(local-require racket/flonum)
(_fun (a b) ::
(_pointer = (flvector->cpointer a))
(_pointer = (flvector->cpointer b))
... | null | https://raw.githubusercontent.com/yjqww6/racket-x64asm/73c2b8edc7e96a6248a7ee25fd7a6ae7065ee966/x64asm-test/x64asm/examples/sysv.rkt | racket | from gcc outputs | #lang typed/racket
(require x64asm
typed/racket/unsafe)
(define-cast flfls
#:type (FlVector FlVector -> Void)
#:ctype (let ()
(local-require racket/flonum)
(_fun (a b) ::
(_pointer = (flvector->cpointer a))
(_pointer = (flvector->cpointer b))
... |
2e806e102a61d02b74dee14232e496d62203ef0348aee1685799e8c8237e3371 | racket/racket7 | trash.rkt | #lang racket/base
(require racket/list
racket/file
"config.rkt"
"dirs.rkt"
"print.rkt"
"params.rkt")
(provide select-trash-dest
pkg-empty-trash)
(define (find-trash-dir) (build-path (pkg-dir #f) ".trash"))
(define (select-trash-dest pkg-name
... | null | https://raw.githubusercontent.com/racket/racket7/5dbb62c6bbec198b4a790f1dc08fef0c45c2e32b/racket/collects/pkg/private/trash.rkt | racket | #lang racket/base
(require racket/list
racket/file
"config.rkt"
"dirs.rkt"
"print.rkt"
"params.rkt")
(provide select-trash-dest
pkg-empty-trash)
(define (find-trash-dir) (build-path (pkg-dir #f) ".trash"))
(define (select-trash-dest pkg-name
... | |
18a45ec782d518921dd304b2c4511fc47f8de1f72d1b374e63883f908353ee8b | boot-clj/boot | task_helpers.clj | (ns boot.task-helpers
(:require
[clojure.java.io :as io]
[clojure.set :as set]
[clojure.string :as string]
[clojure.stacktrace :as trace]
[boot.from.io.aviso.ansi :as ansi]
[boot.from.digest :as digest]
[boot.pod :as pod]
[boot.co... | null | https://raw.githubusercontent.com/boot-clj/boot/64334b4d5744b1444634f4a5a5a52b3ae67dddeb/boot/core/src/boot/task_helpers.clj | clojure | sift helpers ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; | (ns boot.task-helpers
(:require
[clojure.java.io :as io]
[clojure.set :as set]
[clojure.string :as string]
[clojure.stacktrace :as trace]
[boot.from.io.aviso.ansi :as ansi]
[boot.from.digest :as digest]
[boot.pod :as pod]
[boot.co... |
b00ceab1b8bb261738c3b08d780a41f946ea1ec1246fa66dbe5abcb6f474e9bb | may-liu/qtalk | mod_shared_roster_ldap.erl | %%%-------------------------------------------------------------------
File :
%%% Author : Realloc <>
< >
< >
%%% Description : LDAP shared roster management
Created : 5 Mar 2005 by < >
%%%
%%%
ejabberd , Copyright ( C ) 2002 - 2014 ProcessOne
%%%
%%% This program is fr... | null | https://raw.githubusercontent.com/may-liu/qtalk/f5431e5a7123975e9656e7ab239e674ce33713cd/qtalk_opensource/src/mod_shared_roster_ldap.erl | erlang | -------------------------------------------------------------------
Author : Realloc <>
Description : LDAP shared roster management
This program is free software; you can redistribute it and/or
License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but... | File :
< >
< >
Created : 5 Mar 2005 by < >
ejabberd , Copyright ( C ) 2002 - 2014 ProcessOne
modify it under the terms of the GNU General Public License as
published by the Free Software Foundation ; either version 2 of the
You should have received a copy of the GN... |
b9f6d3d1468e19ef4213337f8a7ec4c8b1ee7516c9e89288257a5b70702ee566 | chetmurthy/ensemble | marsh.mli | (**************************************************************)
MARSH.MLI
Author : , 12/96
Modified by Ohad Rodeh , 10/2001
(**************************************************************)
This now provides by hand marshaling for strings and integers .
* The usage is for C applications that need to commun... | null | https://raw.githubusercontent.com/chetmurthy/ensemble/8266a89e68be24a4aaa5d594662e211eeaa6dc89/ensemble/server/util/marsh.mli | ocaml | ************************************************************
************************************************************
************************************************************
************************************************************
Type of marshalled objects: used at sender.
Convert a marshaller into a ... | MARSH.MLI
Author : , 12/96
Modified by Ohad Rodeh , 10/2001
This now provides by hand marshaling for strings and integers .
* The usage is for C applications that need to communicate
* through an agreed protocol with ML .
* The usage is for C applications that need to communicate
* through an agreed p... |
c0d645956feda51cd9e0dca5155db317ab908285ad8926f03d8bab8e87bfb24d | rtoy/cmucl | mac-roman.lisp | ;;; -*- Mode: LISP; Syntax: ANSI-Common-Lisp; Package: STREAM -*-
;;;
;;; **********************************************************************
This code was written by and has been placed in the public
;;; domain.
;;;
(ext:file-comment "$Header: src/pcl/simple-streams/external-formats/mac-roman.lisp $")
(in-pack... | null | https://raw.githubusercontent.com/rtoy/cmucl/9b1abca53598f03a5b39ded4185471a5b8777dea/src/pcl/simple-streams/external-formats/mac-roman.lisp | lisp | -*- Mode: LISP; Syntax: ANSI-Common-Lisp; Package: STREAM -*-
**********************************************************************
domain.
See . We
No warnings about fdefinition | This code was written by and has been placed in the public
(ext:file-comment "$Header: src/pcl/simple-streams/external-formats/mac-roman.lisp $")
(in-package "STREAM")
(intl:textdomain "cmucl")
only need the entries from 128 to 255 .
(defconstant +mac-roman+
(make-array 128 :element-type '(unsigned-byte 16)
... |
65c0963be5f426bffe70acef5053626546365161f9a77ecb47d7181b95cce2ba | xxyzz/SICP | Exercise_1_32.rkt | #lang racket/base
; recursive
(define (accumulate combiner null-value term a next b)
(if (> a b)
null-value
(combiner
(term a)
(accumulate combiner null-value term (next a) next b))))
; iterative
(define (accumulate combiner null-value term a next b)
(define (iter x res... | null | https://raw.githubusercontent.com/xxyzz/SICP/e26aea1c58fd896297dbf5406f7fcd32bb4f8f78/1_Building_Abstractions_with_Procedures/1.3_Formulating_Abstractions_with_Higher-Order_Procedures/Exercise_1_32.rkt | racket | recursive
iterative | #lang racket/base
(define (accumulate combiner null-value term a next b)
(if (> a b)
null-value
(combiner
(term a)
(accumulate combiner null-value term (next a) next b))))
(define (accumulate combiner null-value term a next b)
(define (iter x result)
(if (> x b)... |
7a5ea58e78e7d910e883544ffc4f7477d79e117df7c1959df7277e975c95674b | Helium4Haskell/helium | DerivableSyn.hs | type A = Int
data B = B A deriving Show
main = show (B 100) | null | https://raw.githubusercontent.com/Helium4Haskell/helium/5928bff479e6f151b4ceb6c69bbc15d71e29eb47/test/correct/DerivableSyn.hs | haskell | type A = Int
data B = B A deriving Show
main = show (B 100) | |
9c8659ca36e9335e4fd6ad685b877abf8156fc3df47cca2b1145d4fbd959616b | ralsei/graphite | chicago.rkt | #lang racket
(require data-frame gregor plot/utils graphite)
(provide (all-defined-out))
(define chic-raw (df-read/csv "data/chicago-nmmaps.csv"))
(graph #:data chic-raw
#:title "Temperatures in Chicago"
#:x-label "Year"
#:y-label "Temperature (degrees F)"
#:mapping (aes #:x "date" #:y "te... | null | https://raw.githubusercontent.com/ralsei/graphite/2e353be9d3c7e727b6f28597e0f6d64a7c42ee63/graphite-examples/chicago.rkt | racket | #lang racket
(require data-frame gregor plot/utils graphite)
(provide (all-defined-out))
(define chic-raw (df-read/csv "data/chicago-nmmaps.csv"))
(graph #:data chic-raw
#:title "Temperatures in Chicago"
#:x-label "Year"
#:y-label "Temperature (degrees F)"
#:mapping (aes #:x "date" #:y "te... | |
dbead9992a414f3da29ea45643e7c1327d1d077818b6b71f6b5be46f97d5bc82 | spk121/potato-make | exceptions.scm | -(define-module (potato exceptions)
#:use-module (ice-9 exceptions)
#:export (bad-key-type
bad-value-type
bad-proc-output
invalid-macro
not-a-regular-file
not-a-procedure
no-read-access-to-file
))
(define (make-bad-key-type origin ... | null | https://raw.githubusercontent.com/spk121/potato-make/8aeef1d8eb2524de447d102c5e0b435d4c71a4d7/potato/exceptions.scm | scheme | -(define-module (potato exceptions)
#:use-module (ice-9 exceptions)
#:export (bad-key-type
bad-value-type
bad-proc-output
invalid-macro
not-a-regular-file
not-a-procedure
no-read-access-to-file
))
(define (make-bad-key-type origin ... | |
63f3c147e8ab9f67e7e67a3eb6e2348af028007d80e19a90dd7b4b6c4ded5362 | ezrakilty/narc | Debug.hs | # LANGUAGE ScopedTypeVariables #
module Database.Narc.Debug where
import Prelude hiding (catch)
import Control.Exception (catch, evaluate, throwIO, SomeException)
import Debug.Trace (trace)
import System.IO.Unsafe (unsafePerformIO)
-- | Enable/disable debugging messages
debugFlag :: Bool
debugFlag = False
-- | Trac... | null | https://raw.githubusercontent.com/ezrakilty/narc/76310e6ac528fe038d8bdd4aa78fa8c555501fad/Database/Narc/Debug.hs | haskell | | Enable/disable debugging messages
| Trace the given string if debugging is on, or do nothing if not.
a hook for a breakpoint in GHCi debugger
| Force an arbitrary expression, tracing the @String@ arg if
forcing produces an exception. | # LANGUAGE ScopedTypeVariables #
module Database.Narc.Debug where
import Prelude hiding (catch)
import Control.Exception (catch, evaluate, throwIO, SomeException)
import Debug.Trace (trace)
import System.IO.Unsafe (unsafePerformIO)
debugFlag :: Bool
debugFlag = False
debug :: String -> a -> a
debug str = if debugFl... |
c279ef722aaf3038715af13d30f8e3d7e11ffd4fd094cf0f0a093221c0253a88 | elaforge/karya | ManualTest.hs | Copyright 2013
-- This program is distributed under the terms of the GNU General Public
-- License 3.0, see COPYING or -3.0.txt
| Skeleton for one - off tests , presumably using the output of
-- LDebug.dump_block.
module Derive.ManualTest where
import qualified Data.Map as Map
import qualified Data.Set as Set
i... | null | https://raw.githubusercontent.com/elaforge/karya/471a2131f5a68b3b10b1a138e6f9ed1282980a18/Derive/ManualTest.hs | haskell | This program is distributed under the terms of the GNU General Public
License 3.0, see COPYING or -3.0.txt
LDebug.dump_block.
prettyp logs
* cache | Copyright 2013
| Skeleton for one - off tests , presumably using the output of
module Derive.ManualTest where
import qualified Data.Map as Map
import qualified Data.Set as Set
import qualified Util.Log as Log
import qualified Util.Ranges as Ranges
import Util.Test
import qualified Ui.UiTest as UiTest
import qu... |
9fa9cfa62b13201c6e47b5e64273ba03db7b0486d8f4d9faf6377b4e192ec4be | wavejumper/rehook | events.cljs | (ns rehook.events
(:require [rehook.core :as rehook]))
(defn init
[{:keys [db ctx subscriptions events effects]}]
{:subscriptions subscriptions
:events events
:effects effects
:subscribe (fn [[id & args]]
(if-let [subscription (get subscriptions id)]
(first (rehook/use-... | null | https://raw.githubusercontent.com/wavejumper/rehook/c1a4207918827f4b738cdad9a9645385e5e10ff4/rehook-events/src/rehook/events.cljs | clojure | (ns rehook.events
(:require [rehook.core :as rehook]))
(defn init
[{:keys [db ctx subscriptions events effects]}]
{:subscriptions subscriptions
:events events
:effects effects
:subscribe (fn [[id & args]]
(if-let [subscription (get subscriptions id)]
(first (rehook/use-... | |
bcfdddcc48d085269abd70327daea1ffe8a3d6bda20389ad75992b819fd8ed01 | dybber/fcl | Optimise.hs | module FCL.IL.Optimise (optimise, optimiseExp) where
import FCL.IL.Optimise.ConstantFold (constantFold, foldExp)
import FCL.IL.Optimise.ConstantPropagation (constantProp)
import FCL.IL.Optimise.CopyPropagation (copyProp)
import FCL.IL.Optimise.DeadCodeElimination (deadCodeElimination)
import FCL.IL.Optimise.LoopUnroll... | null | https://raw.githubusercontent.com/dybber/fcl/e794a4b9d3ab6207fbe89fcddaafe97ae0d379dd/src/FCL/IL/Optimise.hs | haskell | module FCL.IL.Optimise (optimise, optimiseExp) where
import FCL.IL.Optimise.ConstantFold (constantFold, foldExp)
import FCL.IL.Optimise.ConstantPropagation (constantProp)
import FCL.IL.Optimise.CopyPropagation (copyProp)
import FCL.IL.Optimise.DeadCodeElimination (deadCodeElimination)
import FCL.IL.Optimise.LoopUnroll... | |
529c66728dec563f6642fe6ea657f66b162f5d131a1ad6c6333d3401cb662bdd | rudymatela/tankode | List.hs | -- |
-- Module : List
Copyright : ( c ) 2017
License : LGPL 2.1 ( see the file LICENSE )
--
-- Additional list functions to complement the functionality from "Data.List".
module List
( module Data.List
, discard
, discardLater
, choices
, choicesWith
, mapChoices
, maybeMinimum
, co... | null | https://raw.githubusercontent.com/rudymatela/tankode/299ec6f78a9a18a8fc902be911a556d0497c30e1/runner/src/List.hs | haskell | |
Module : List
Additional list functions to complement the functionality from "Data.List".
| dropWhile == x on both ends
> trim ' ' " blah " == "blah"
TODO: make this prettier and more efficient | Copyright : ( c ) 2017
License : LGPL 2.1 ( see the file LICENSE )
module List
( module Data.List
, discard
, discardLater
, choices
, choicesWith
, mapChoices
, maybeMinimum
, compose
, mapThat
, gsub
, pairwise
, split
, join
, trim
)
where
import Data.List
discard :: (... |
479ad64f3c0f5fa782d709be75d36a6f01f79d968bc96ad701ec289c318a6a61 | CloudI/CloudI | cloudi_service_cron.erl | -*-Mode : erlang;coding : utf-8;tab - width:4;c - basic - offset:4;indent - tabs - mode:()-*-
ex : set utf-8 sts=4 ts=4 sw=4 et nomod :
%%%
%%%------------------------------------------------------------------------
%%% @doc
= = CloudI Cron Service==
Cron expression events are supported within the limitation... | null | https://raw.githubusercontent.com/CloudI/CloudI/81bcdce56848a23a18cdbb46a95ba50c91218db4/src/lib/cloudi_service_cron/src/cloudi_service_cron.erl | erlang |
------------------------------------------------------------------------
@doc
If the system clock is adjusted backwards, the same sequence of
events that have already occurred before the time change. That means
the adjustment backwards only delays the next event's occurrence
by the adjustment amount.
If the s... | -*-Mode : erlang;coding : utf-8;tab - width:4;c - basic - offset:4;indent - tabs - mode:()-*-
ex : set utf-8 sts=4 ts=4 sw=4 et nomod :
= = CloudI Cron Service==
Cron expression events are supported within the limitation defined by
erlang : system_info(end_time ) ( events during a 250 year period ) .
The... |
412e8d59506166ec14d3bc3c579edfaaba7a331b0c34281393613e77d5cf26fc | pkpkpk/cljs-node-io | async_tests.cljs | (ns cljs-node-io.async-tests
(:require-macros [cljs.core.async.macros :refer [go go-loop]])
(:require [cljs.test :refer-macros [deftest is async testing]]
[cljs.core.async :as casync :refer [<! >! put! take! close! chan ]]
[cljs-node-io.async :refer [go-proc mux admux unmux unmux-all
... | null | https://raw.githubusercontent.com/pkpkpk/cljs-node-io/d4a2e0031df7f3f6b0baf1fbb07de5ae4dd40b19/src/test/cljs_node_io/async_tests.cljs | clojure | wait a round
cb() -> [:event nil]
cb(a) -> [:event [a]]
cb(a,b) -> [:event [a b]]
"close"
end method is writable mechanic, here resource is done
induce backpressure
signal to write again
| (ns cljs-node-io.async-tests
(:require-macros [cljs.core.async.macros :refer [go go-loop]])
(:require [cljs.test :refer-macros [deftest is async testing]]
[cljs.core.async :as casync :refer [<! >! put! take! close! chan ]]
[cljs-node-io.async :refer [go-proc mux admux unmux unmux-all
... |
7254fac6853a011886f7a83dda443c1c67264a808058e0e740c4b76065bf38be | tweag/ormolu | normalize-magic-comments-out.hs | {- ORMOLU_DISABLE -}
{- ORMOLU_DISABLE -}
foo=bar
ORMOLU_ENABLE
ORMOLU_ENABLE
bar = baz
{- ORMOLU_DISABLE -}
baz=foo
| null | https://raw.githubusercontent.com/tweag/ormolu/897e6736ec17d7e359091abe3c24f4abfec015c4/data/examples/other/disabling/normalize-magic-comments-out.hs | haskell | ORMOLU_DISABLE
ORMOLU_DISABLE
ORMOLU_DISABLE | foo=bar
ORMOLU_ENABLE
ORMOLU_ENABLE
bar = baz
baz=foo
|
1e73fafc0734f1f2f77065981e464a1c0301df93f072034a50c4ebe6e63d3046 | kosmikus/multirec | ASTExamples.hs | # LANGUAGE FlexibleContexts #
{-# LANGUAGE LiberalTypeSynonyms #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE GADTs #-}
module ASTExamples where
import Data.Maybe (fromJust)
import Control.Arrow ((>>>))
import Control.Monad ((>=>))
-- Replace ASTUse with ASTTHUse below if you want
to t... | null | https://raw.githubusercontent.com/kosmikus/multirec/10ea901f0e1067bbe3632b1fab34103c83eeff0f/examples/ASTExamples.hs | haskell | # LANGUAGE LiberalTypeSynonyms #
# LANGUAGE TypeFamilies #
# LANGUAGE GADTs #
Replace ASTUse with ASTTHUse below if you want
| Example expression
| Renaming variables using 'compos'
| Test for 'renameVar'
| Result of evaluating an expression
| Algebra for evaluating an expression
| More c... | # LANGUAGE FlexibleContexts #
module ASTExamples where
import Data.Maybe (fromJust)
import Control.Arrow ((>>>))
import Control.Monad ((>=>))
to test TH code generation .
import qualified ASTUse
import ASTTHUse
import AST
import Generics.MultiRec.Base
import Generics.MultiRec.Compos
import qualified Generics... |
760c835d8cc951a4d9ea39dedb18a1dfd9a8e99784bc6c6754b377a2d338b4c3 | meetalik8/pcpf | lengthlist.hs | len[]=0
len(x:xs)=1+len(xs)
main =do
putStrLn ("Enter first number: ")
ain <- getLine
let a = (read ain :: Int)
putStrLn ("Enter second number: ")
bin <- getLine
let b = (read bin :: Int)
putStrLn ("Enter third number: ")
cin <- getLine
let c = (read cin ::... | null | https://raw.githubusercontent.com/meetalik8/pcpf/c79374c0c227201e37534124e2c7f4154e03ef65/haskell/lengthlist.hs | haskell | len[]=0
len(x:xs)=1+len(xs)
main =do
putStrLn ("Enter first number: ")
ain <- getLine
let a = (read ain :: Int)
putStrLn ("Enter second number: ")
bin <- getLine
let b = (read bin :: Int)
putStrLn ("Enter third number: ")
cin <- getLine
let c = (read cin ::... | |
4f066454d0254f4d9bea573c9596cdb8153b7ef44fef2ae7c0efc719e365b671 | henrik42/spring-break | swank.clj | (ns spring-break.swank
(:use swank.swank)
(:require [spring-break.core :as core]))
(defn swank-starter []
(let [state (atom {})
started (promise)]
(reify
org.springframework.context.SmartLifecycle
(getPhase [this] 0)
(isAutoStartup [this]
true)
(isRunning [this]
... | null | https://raw.githubusercontent.com/henrik42/spring-break/0d4e51f6ec0ffab023c46709a43b9d877fac4536/src/main/clojure/spring_break/swank.clj | clojure | (ns spring-break.swank
(:use swank.swank)
(:require [spring-break.core :as core]))
(defn swank-starter []
(let [state (atom {})
started (promise)]
(reify
org.springframework.context.SmartLifecycle
(getPhase [this] 0)
(isAutoStartup [this]
true)
(isRunning [this]
... | |
8e9bc80329803c7913cc644d38f310736ed63818256b1bf3e9714bac659e12f0 | irastypain/sicp-on-language-racket | exercise_2_31.rkt | #lang racket
(require "../lib/base.rkt")
; Процедура применения переданной процедуры
к каждому элементу
(define (tree-map proc tree)
(map (lambda (sub-tree)
(if (pair? sub-tree)
(tree-map proc sub-tree)
(proc sub-tree)))
tree))
Процедура возведения в квадрат
; элемент... | null | https://raw.githubusercontent.com/irastypain/sicp-on-language-racket/0052f91d3c2432a00e7e15310f416cb77eeb4c9c/src/chapter02/exercise_2_31.rkt | racket | Процедура применения переданной процедуры
элементов дерева | #lang racket
(require "../lib/base.rkt")
к каждому элементу
(define (tree-map proc tree)
(map (lambda (sub-tree)
(if (pair? sub-tree)
(tree-map proc sub-tree)
(proc sub-tree)))
tree))
Процедура возведения в квадрат
(define (square-tree tree) (tree-map square tree))
... |
c57d5cd8f9efb567fde413be96f427e8b1160038b01a606b853e6b0758e17850 | rems-project/cerberus | lexer_feedback.ml | Created by 2017 - 10 - 04
Based on and 2017 :
" A simple , possibly correct LR parser for C11 "
"A simple, possibly correct LR parser for C11" *)
open Cerb_frontend
module IdSet = Set.Make(String)
exception KnR_declaration of Location_ocaml.t
type context = IdSet.t
let cerb_builtin_types =
... | null | https://raw.githubusercontent.com/rems-project/cerberus/0da89fec655f568f291258d169595d9c9c5485d5/parsers/c/lexer_feedback.ml | ocaml | Created by 2017 - 10 - 04
Based on and 2017 :
" A simple , possibly correct LR parser for C11 "
"A simple, possibly correct LR parser for C11" *)
open Cerb_frontend
module IdSet = Set.Make(String)
exception KnR_declaration of Location_ocaml.t
type context = IdSet.t
let cerb_builtin_types =
... | |
d947647160021b040afa4562634de1d141d010520f66b43b7e1a64fd6c16de0d | ayazhafiz/plts | ast.ml | open Surface
open Util
let noloc = ((0, 0), (0, 0))
(** A generic type variable.
Either unbound, a reference to another type, or a resolved type. *)
type 'content var =
| Unbd of int (** unbound type *)
| Link of 'content var ref
| Content of 'content (** concrete type *)
[@@deriving show]
type fx_conten... | null | https://raw.githubusercontent.com/ayazhafiz/plts/6dfa9340457ec897ddf40a87feee44dd6200921a/fx_cap/ast.ml | ocaml | * A generic type variable.
Either unbound, a reference to another type, or a resolved type.
* unbound type
* concrete type
* Effect operation type F has signature t1 -> t2
* effect signature
* an effect type
* ordered stack shape
* effectful function type t -> [t]_{\bar{t}} where \bar{t} is the stack shape
... | open Surface
open Util
let noloc = ((0, 0), (0, 0))
type 'content var =
| Link of 'content var ref
[@@deriving show]
type fx_content = [ `Fx of string * fx_signature ]
and fx_signature = ty * ty
and fx_op = fx_content var ref
and ty_content =
| TBool
| TInt
| TFnFx of (ty * ty * stack_shape)
| TFnCap o... |
be5a1b788955ec4b0720d0db072a9672bfa39dc9f334a5ad58f87539ce3a87d3 | aistrate/Okasaki | Ex02_06_Test2.hs | import Test.QuickCheck
import Text.Printf
import Data.List
import TestHelper
import Ex02_06
main = printTime $ mapM_ (\(s,a) -> printf "%-25s: " s >> a) tests
tests = [
("(Int, Double)", verboseCheck (testBindLookupFM::[(Int, Float)] -> Bool)) ]
testBindLookupFM ps = let rs = nubBy (\(a, _) (b, _) -> a == b) ... | null | https://raw.githubusercontent.com/aistrate/Okasaki/cc1473c81d053483bb5e327409346da7fda10fb4/MyCode/Ch02/Ex02_06_Test2.hs | haskell | import Test.QuickCheck
import Text.Printf
import Data.List
import TestHelper
import Ex02_06
main = printTime $ mapM_ (\(s,a) -> printf "%-25s: " s >> a) tests
tests = [
("(Int, Double)", verboseCheck (testBindLookupFM::[(Int, Float)] -> Bool)) ]
testBindLookupFM ps = let rs = nubBy (\(a, _) (b, _) -> a == b) ... | |
2ac0042c7c0263d70e2dd368f244d19805acb069d975200dff8aed7e6a8ecf24 | facebookarchive/duckling_old | numbers.clj | (
; Context map
{}
"0"
"nul"
(number 0)
"1"
"én"
"en"
"ét"
"et"
(number 1)
"2"
"to"
"et par"
(number 2)
"14"
"fjorten"
(number 14)
"16"
"seksten"
(number 16)
"17"
"sytten"
(number 17)
"18"
"atten"
(number 18)
"1,1"
"1,10"
"01,10"
(number 1.1)
... | null | https://raw.githubusercontent.com/facebookarchive/duckling_old/bf5bb9758c36313b56e136a28ba401696eeff10b/resources/languages/da/corpus/numbers.clj | clojure | Context map | (
{}
"0"
"nul"
(number 0)
"1"
"én"
"en"
"ét"
"et"
(number 1)
"2"
"to"
"et par"
(number 2)
"14"
"fjorten"
(number 14)
"16"
"seksten"
(number 16)
"17"
"sytten"
(number 17)
"18"
"atten"
(number 18)
"1,1"
"1,10"
"01,10"
(number 1.1)
"0,77"
",77"
... |
3f0e3b5b80cb455629a7839d1a5b028ac2dcfe3bcc9602bdfea528a1ceebf57f | anchpop/wise_mans_haskell | currency_with_newtype_derived.hs | # LANGUAGE GeneralizedNewtypeDeriving #
newtype Dollar = Dollar Double deriving (Read, Show, Num)
newtype Euro = Euro Double deriving (Read, Show, Num)
newtype Yen = Yen Double deriving (Read, Show, Num) | null | https://raw.githubusercontent.com/anchpop/wise_mans_haskell/021ca3f3d96ebc0ecf2daf1a802fc33d067e24cc/haskelltests/should_compile/currency_with_newtype_derived.hs | haskell | # LANGUAGE GeneralizedNewtypeDeriving #
newtype Dollar = Dollar Double deriving (Read, Show, Num)
newtype Euro = Euro Double deriving (Read, Show, Num)
newtype Yen = Yen Double deriving (Read, Show, Num) | |
2345768910f9bbc42f37fdcbfabb18eb91b7e8038a2accc61556e2b1e4fed772 | nuvla/api-server | credential_infrastructure_service_vpn.clj | (ns sixsq.nuvla.server.resources.credential-infrastructure-service-vpn
"
This represents an VPN client credential that allows users to access the
VPN service.
"
(:require
[sixsq.nuvla.auth.utils :as auth]
[sixsq.nuvla.server.resources.common.utils :as u]
[sixsq.nuvla.server.resources.credential :as p]
... | null | https://raw.githubusercontent.com/nuvla/api-server/2cd666718b5770f496c54115b2d9419600e42201/code/src/sixsq/nuvla/server/resources/credential_infrastructure_service_vpn.clj | clojure |
initialization
convert template to credential: just copies the necessary keys from the provided template.
multimethods for validation
| (ns sixsq.nuvla.server.resources.credential-infrastructure-service-vpn
"
This represents an VPN client credential that allows users to access the
VPN service.
"
(:require
[sixsq.nuvla.auth.utils :as auth]
[sixsq.nuvla.server.resources.common.utils :as u]
[sixsq.nuvla.server.resources.credential :as p]
... |
33ac0837a616c935ae42a19a5381974795f2a0c0e5b6192ceacafc35b5861347 | cxa/ppx_bsx | ppx_bsx.ml | let () =
Ppxlib.Driver.run_as_ppx_rewriter ()
| null | https://raw.githubusercontent.com/cxa/ppx_bsx/7475475c40a754291ddef4b24d011bd121d2aec1/src/ppx_bsx.ml | ocaml | let () =
Ppxlib.Driver.run_as_ppx_rewriter ()
| |
d7f0f3e107c10152b7baf60b9921c3dae51a0065c6168d82aa22813f5814c636 | dalaing/reflex-host-examples | Host4.hs |
Copyright : ( c ) , 2016
License : :
Stability : experimental
Portability : non - portable
Copyright : (c) Dave Laing, 2016
License : BSD3
Maintainer :
Stability : experimental
Portability : non-portable
-}
{-# LANGUAGE RankNTypes #-}
module Host4 (
go4
) where
import Data.... | null | https://raw.githubusercontent.com/dalaing/reflex-host-examples/ef3aa5f428e87b289fd7999c97ee679c231b5e05/src/Host4.hs | haskell | # LANGUAGE RankNTypes #
Previously we used this:
data Input t = Input {
ieOpen :: Event t ()
}
for our input events.
We're going to wind our input back to 'Event t String' while keeping
our outputs as they were.
after the event network has been set up.
Our application type changes to:
So we can use our ... |
Copyright : ( c ) , 2016
License : :
Stability : experimental
Portability : non - portable
Copyright : (c) Dave Laing, 2016
License : BSD3
Maintainer :
Stability : experimental
Portability : non-portable
-}
module Host4 (
go4
) where
import Data.Maybe (isJust)
import Contro... |
9d1e3915242859417b3e110ef4fe4a2890433d27b75202e0925cd597203ac81b | deadeyejoe/fabrikk | interface.cljc | (ns fabrikk.directory.interface
(:require [fabrikk.directory.core :as directory])
(:refer-clojure :exclude [resolve]))
(defn register [category k v]
(directory/register category k v))
(defn resolve [category k]
(directory/resolve category k))
(defn register-factory [k v]
(directory/register :factory k v))
... | null | https://raw.githubusercontent.com/deadeyejoe/fabrikk/c731cd435baaf241450a9b280286b894c8cee81c/components/directory/src/fabrikk/directory/interface.cljc | clojure | (ns fabrikk.directory.interface
(:require [fabrikk.directory.core :as directory])
(:refer-clojure :exclude [resolve]))
(defn register [category k v]
(directory/register category k v))
(defn resolve [category k]
(directory/resolve category k))
(defn register-factory [k v]
(directory/register :factory k v))
... | |
394a3ff14d49883ae1a06225a401b4ff52446549ae317ff57d45037fe61fbb66 | fossas/fossa-cli | Common.hs | module Strategy.Scala.Common (
removeLogPrefixes,
SbtArtifact (..),
) where
import Data.Maybe (fromMaybe)
import Data.Text (Text)
import Data.Text qualified as Text
data SbtArtifact = SbtArtifact
{ groupId :: Text
, artifactId :: Text
, version :: Text
}
deriving (Eq, Ord, Show)
-- | Removes log prefix... | null | https://raw.githubusercontent.com/fossas/fossa-cli/260c763cf065a2eaff2604f71949856fc466c75b/src/Strategy/Scala/Common.hs | haskell | | Removes log prefix from the log.
>> removeLogPrefixes "[info] someInfo" = "someInfo" | module Strategy.Scala.Common (
removeLogPrefixes,
SbtArtifact (..),
) where
import Data.Maybe (fromMaybe)
import Data.Text (Text)
import Data.Text qualified as Text
data SbtArtifact = SbtArtifact
{ groupId :: Text
, artifactId :: Text
, version :: Text
}
deriving (Eq, Ord, Show)
removeLogPrefixes :: Te... |
a11abefcaef216d9cad906b9791871539417f93bdc0cf4483bafd6e0170761ce | hslua/tasty-lua | Lua.hs | {-# LANGUAGE RankNTypes #-}
# LANGUAGE ScopedTypeVariables #
|
Module : Test . Tasty . Lua
Copyright : © 2019–2020 : MIT
Maintainer : >
Stability : alpha
Portability : Requires TemplateHaskell
Convert Lua test results into a tasty test trees .
Module : Test.Tasty.Lua
Copyr... | null | https://raw.githubusercontent.com/hslua/tasty-lua/8105036277e737227f18c475dc3e24cd7924b53a/src/Test/Tasty/Lua.hs | haskell | # LANGUAGE RankNTypes #
* Lua module
* Running tests
* Helpers
| Run the given file as a single test. It is possible to use
`tasty.lua` in the script. This test collects and summarizes all
errors, but shows generally no information on the successful tests.
| Lua test case action
| Failure message generated by t... | # LANGUAGE ScopedTypeVariables #
|
Module : Test . Tasty . Lua
Copyright : © 2019–2020 : MIT
Maintainer : >
Stability : alpha
Portability : Requires TemplateHaskell
Convert Lua test results into a tasty test trees .
Module : Test.Tasty.Lua
Copyright : © 2019–2020 Albert ... |
eb718af54f6ee5e99fedc1c5ce1acd10700231c0770c5f52990e5da3ec850dfa | clash-lang/clash-compiler | Queens.hs | module Queens where
import Clash.Prelude
import Data.Maybe
mem <~ (i,x) = replace i x mem
type Word3 = Unsigned 3
type MbWord3 = Maybe Word3
type Din = Vec 8 (MbWord3)
type Dout = Vec 8 Word3
din :: Din
din = $(listToVecTH [ Nothing :: Maybe (Unsigned 3), Just 1, Nothing, Nothing, Just 4, Nothing, Just 6... | null | https://raw.githubusercontent.com/clash-lang/clash-compiler/8e461a910f2f37c900705a0847a9b533bce4d2ea/examples/Queens.hs | haskell | module Queens where
import Clash.Prelude
import Data.Maybe
mem <~ (i,x) = replace i x mem
type Word3 = Unsigned 3
type MbWord3 = Maybe Word3
type Din = Vec 8 (MbWord3)
type Dout = Vec 8 Word3
din :: Din
din = $(listToVecTH [ Nothing :: Maybe (Unsigned 3), Just 1, Nothing, Nothing, Just 4, Nothing, Just 6... | |
2e9d5c458edcad1f2281676d4e7df6e5016fb2e9dc2c5bf987a71cc3d53eb1c6 | fetburner/compelib | kruskal.ml | module F
(Weight : sig
type t
val compare : t -> t -> int
end)
(Edge : sig
type t
type vertex
type weight = Weight.t
val weight : t -> weight
val vertex1 : t -> vertex
val vertex2 : t -> vertex
end)
(Array : sig
type 'a t
type key = Edge.vertex
type size
val get... | null | https://raw.githubusercontent.com/fetburner/compelib/d8fc5d9acd04e676c4d4d2ca9c6a7140f1b85670/lib/graph/kruskal.ml | ocaml | module F
(Weight : sig
type t
val compare : t -> t -> int
end)
(Edge : sig
type t
type vertex
type weight = Weight.t
val weight : t -> weight
val vertex1 : t -> vertex
val vertex2 : t -> vertex
end)
(Array : sig
type 'a t
type key = Edge.vertex
type size
val get... | |
b271cf0296ed963bbc3bcb8e806881c3b0115f21fd4434370ac464eca7567d4c | brick-lang/kekka | name.ml | open Core
open Core.Poly
open BasicClasses
open Util
(*********************************
* Names
*********************************)
*
* Names defined by the user .
* Uses a hash to speed up comparisons . The hash is constructed
* such that they can be compared too . ( h1 > h2 = > name1 > )
* The hash is ... | null | https://raw.githubusercontent.com/brick-lang/kekka/7ede659ffb49959b140e6ab0a72d38ff6c63311b/common/name.ml | ocaml | ********************************
* Names
********************************
Checks whether both names are in the same namespace
We're guranteed non-zero length
* Show quotes around the name
*************************************************
* Modules paths
*************************************************
*******... | open Core
open Core.Poly
open BasicClasses
open Util
*
* Names defined by the user .
* Uses a hash to speed up comparisons . The hash is constructed
* such that they can be compared too . ( h1 > h2 = > name1 > )
* The hash is case - insensitive , just like comparisons on names .
* Use ' case_equal ' fo... |
88dc7ae0c67b3ca3d6fad0928ce9f8a10f8866d83cc900ba27baa20ade793227 | cram2/cram | cloud-logger-client.lisp | (in-package :ccl)
(defparameter *cloud-logger-client* nil)
(defparameter *is-client-connected* nil)
(defparameter *is-logging-enabled* nil)
(defparameter *host* "''")
;;(defparameter *host* "''")
(defparameter *cert-path* "'/home/koralewski/Desktop/localhost.pem'")
;;(defparameter *cert-path* "'/home/ease/asil.pem'"... | null | https://raw.githubusercontent.com/cram2/cram/dcb73031ee944d04215bbff9e98b9e8c210ef6c5/cram_knowrob/cram_cloud_logger/src/cloud-logger-client.lisp | lisp | (defparameter *host* "''")
(defparameter *cert-path* "'/home/ease/asil.pem'")
LOCAL PC
(defparameter *api-key* "'0nYZRYs5AxDeZAWhWBKYmLF1IJCtRM7gkYTqSV3Noyhl5V3yyxzSaA7Nxi8FFQsC'")
(defparameter *api-key* "'DiI6fqr5I2ObbeMyI9cDyzjoEHjfz3E48O45M3bKAZh465PUvNtOPB9v8xodMCQT'")
(defparameter *api-key* "'MxtU9V2cdstw3ocKXbi... | (in-package :ccl)
(defparameter *cloud-logger-client* nil)
(defparameter *is-client-connected* nil)
(defparameter *is-logging-enabled* nil)
(defparameter *host* "''")
(defparameter *cert-path* "'/home/koralewski/Desktop/localhost.pem'")
AI PC
(defparameter *api-key* "'K103jdr40Rp8UX4egmRf42VbdB1b5PW7qYOOVvTDAoiNG6lc... |
f34fefb8164347850799898b912a247f5e9e5a21807758874d9aa3d415edb2fe | astrada/ocaml-extjs | ext_util_MixedCollection.mli | * Represents a collection of a set of key and value ...
{ % < p > Represents a collection of a set of key and value pairs . Each key in the MixedCollection
must be unique , the same key can not exist twice . This collection is ordered , items in the
collection can be accessed by index or via the key . Newl... | null | https://raw.githubusercontent.com/astrada/ocaml-extjs/77df630a75fb84667ee953f218c9ce375b3e7484/lib/ext_util_MixedCollection.mli | ocaml | * {% <p>Sorts the collection by a single sorter function</p> %}
{b Parameters}:
{ul {- sorterFn: [_ Js.callback] {% <p>The function to sort by</p> %}
}
}
* {% <p>Configure as <code>true</code> if the <a href="#!/api/Ext.util.MixedCollection-method-addAll" rel="Ext.util.MixedCollection-method-a... | * Represents a collection of a set of key and value ...
{ % < p > Represents a collection of a set of key and value pairs . Each key in the MixedCollection
must be unique , the same key can not exist twice . This collection is ordered , items in the
collection can be accessed by index or via the key . Newl... |
c29c6b3e85b159e3a105cbcc4d470ace215b10cad6136434cf569bf67f39ba8f | deverl-ide/deverl | deverl.erl | %% =====================================================================
%% This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation , either version 3 of the License , or
%% (at your option) any later vers... | null | https://raw.githubusercontent.com/deverl-ide/deverl/69216c7720ce2a32344711f5526c0eb9676bcae0/deverl/src/deverl.erl | erlang | =====================================================================
This program is free software: you can redistribute it and/or modify
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTAB... | it under the terms of the GNU General Public License as published by
the Free Software Foundation , either version 3 of the License , or
You should have received a copy of the GNU General Public License
@author < >
@author < >
, 2014
-module(deverl).
-include_lib("wx/include/wx.hrl").
-include_... |
7a7cd4a769bee455e1fb437c96538f0ee4255efabac28197bae2c914ca7a7c47 | OCamlPro/ocp-build | ocpFilename.mli | (**************************************************************************)
(* *)
(* Typerex Libraries *)
(* *)
Copyrigh... | null | https://raw.githubusercontent.com/OCamlPro/ocp-build/56aff560bb438c12b2929feaf8379bc6f31b9840/libs/ocplib-system/ocpFilename.mli | ocaml | ************************************************************************
Typerex Libraries
... | Copyright 2011 - 2017 OCamlPro SAS
the GNU Lesser General Public License version 2.1 , with the
module Op : sig
val (/) : string -> string -> string
end
val get_extension : string -> string option
val suffix : string -> string option
|
1b63c8a8a14c6767baa2d36415e18760407fc89c3186e1e846f459cae5573a48 | manuel-serrano/bigloo | isloop.scm | ;*=====================================================================*/
* serrano / prgm / project / bigloo / / comptime / Trace / isloop.scm * /
;* ------------------------------------------------------------- */
* Author : * /
* Creation : ... | null | https://raw.githubusercontent.com/manuel-serrano/bigloo/eb650ed4429155f795a32465e009706bbf1b8d74/comptime/Trace/isloop.scm | scheme | *=====================================================================*/
* ------------------------------------------------------------- */
* ------------------------------------------------------------- */
* implementation of the isloop? predicate */
*===========================... | * serrano / prgm / project / bigloo / / comptime / Trace / isloop.scm * /
* Author : * /
* Creation : We d Jan 8 13:51:43 2020 * /
* Last change : We d Jan 8 16:29:52 2020 ( serrano ) * /
* Copy... |
e2085a0976580fb93af5d0d95df67244576222321ff3bb683e81f0e06ac664fb | softwarelanguageslab/maf | R5RS_scp1_compress-measurements-4.scm | ; Changes:
* removed : 0
* added : 1
* swaps : 0
; * negated predicates: 0
; * swapped branches: 0
* calls to i d fun : 1
(letrec ((comprimeer (lambda (metingen)
(letrec ((hulp (lambda (lst prev count)
(if (null? lst)
... | null | https://raw.githubusercontent.com/softwarelanguageslab/maf/11acedf56b9bf0c8e55ddb6aea754b6766d8bb40/test/changes/scheme/generated/R5RS_scp1_compress-measurements-4.scm | scheme | Changes:
* negated predicates: 0
* swapped branches: 0 | * removed : 0
* added : 1
* swaps : 0
* calls to i d fun : 1
(letrec ((comprimeer (lambda (metingen)
(letrec ((hulp (lambda (lst prev count)
(if (null? lst)
(list (list prev count))
... |
70b615614df9e377ab20575f821a3784978f70f0a66302f0b76ce03d695cf037 | racket/drracket | drracket-errortrace-key.rkt | (module drracket-errortrace-key '#%kernel
(void '#:errortrace-dont-annotate)
as with errortrace / errortrace - key :
;; Defining `errortrace-key' as a function is a performance hack:
;; the compiler can track function constants, and in particular the
;; fact that it's not an impersonated/chaperoned mark key,... | null | https://raw.githubusercontent.com/racket/drracket/df4905c2b132b9cbe14316c0b6a31086ba05fda0/drracket/drracket/private/drracket-errortrace-key.rkt | racket | Defining `errortrace-key' as a function is a performance hack:
the compiler can track function constants, and in particular the
fact that it's not an impersonated/chaperoned mark key, so that a
`with-continuation-mark' using this key can be dropped if the
body expression is simple. | (module drracket-errortrace-key '#%kernel
(void '#:errortrace-dont-annotate)
as with errortrace / errortrace - key :
(define-values (drracket-errortrace-key) (lambda () 'anything))
(#%provide drracket-errortrace-key))
|
d105e20a320b310b13735f702cdcf2a4e0bedc11bb94b04180141d4a39ef3931 | arsenm/Clutterhs | BindingPoolTest.hs | # LANGUAGE ScopedTypeVariables #
import Graphics.UI.Clutter hiding (show, Nothing)
import System.Glib.Signals (on, after)
import Control.Monad
import Control.Monad.Trans (liftIO)
import Data.Maybe
action (_::Rectangle) str kc ms = print (str,kc,ms) >> return True
main = do
clutterInit
stg <- stageGetDefault
... | null | https://raw.githubusercontent.com/arsenm/Clutterhs/ad3390895264c46906b5d3d954c4b04b04d96b1d/clutter/demo/BindingPoolTest.hs | haskell | LOL on shift-space
lol should not work / blocked
aoeu should be blocked, then unblocked and work | # LANGUAGE ScopedTypeVariables #
import Graphics.UI.Clutter hiding (show, Nothing)
import System.Glib.Signals (on, after)
import Control.Monad
import Control.Monad.Trans (liftIO)
import Data.Maybe
action (_::Rectangle) str kc ms = print (str,kc,ms) >> return True
main = do
clutterInit
stg <- stageGetDefault
... |
495929a84774d3fc115a8bc8ef66185b9365fc317b23f3d3ccfc48035b242586 | muldvarp/CFGAnalyzer | parsetree.mli | open Cfg ;;
type parsetree = Leaf of string
| BinNode of string * parsetree * parsetree
| Node of string * parsetree
| Derivation of string * parsetree
| AmbDerivation of string * parsetree
val extractParseTree : fullCFG -> int -> parsetree
val extractTwoParseTrees :... | null | https://raw.githubusercontent.com/muldvarp/CFGAnalyzer/03888cc31399b34ea967e0f54c447ca7ee6b5ae0/src/parsetree.mli | ocaml | open Cfg ;;
type parsetree = Leaf of string
| BinNode of string * parsetree * parsetree
| Node of string * parsetree
| Derivation of string * parsetree
| AmbDerivation of string * parsetree
val extractParseTree : fullCFG -> int -> parsetree
val extractTwoParseTrees :... | |
3c9e25e90a6b2b9c9ca02aeb622cded1dab0d96935444e39861ef556be4fc8dd | LPCIC/matita | cicNotationPres.ml | Copyright ( C ) 2004 - 2005 , HELM Team .
*
* This file is part of HELM , an Hypertextual , Electronic
* Library of Mathematics , developed at the Computer Science
* Department , University of Bologna , Italy .
*
* is free software ; you can redistribute it and/or
* modify it under the terms of ... | null | https://raw.githubusercontent.com/LPCIC/matita/794ed25e6e608b2136ce7fa2963bca4115c7e175/matita/components/content_pres/cicNotationPres.ml | ocaml | let use_unicode = true in
"xref" is
should have been instantiated
assert (!expected_level = None);
prerr_endline "reset";
prerr_endline (NotationPp.pp_term t);
TODO?
let render_to_boxml id_to_uri t =
let xml_stream = print_box (box_of_mpres (render id_to_uri t)) in
Xml.add_xml_decl... | Copyright ( C ) 2004 - 2005 , HELM Team .
*
* This file is part of HELM , an Hypertextual , Electronic
* Library of Mathematics , developed at the Computer Science
* Department , University of Bologna , Italy .
*
* is free software ; you can redistribute it and/or
* modify it under the terms of ... |
8ad93f6ecd1581afdb88160c942a92e6b44c2640cce40610cc059f1497338080 | ghcjs/ghcjs | 1861.hs | import System.Environment
main = do [x] <- getArgs
print (read x < (1e400 :: Double))
print (read x < (-1e400 :: Double))
print (read x == (0/0 :: Double))
the last does n't get constant - folded to NaN , so we 're not really
-- testing properly here. Still, we might manage to... | null | https://raw.githubusercontent.com/ghcjs/ghcjs/e4cd4232a31f6371c761acd93853702f4c7ca74c/test/ghc/codeGen/1861.hs | haskell | testing properly here. Still, we might manage to constant fold
this in the future, so I'll leave it in place. | import System.Environment
main = do [x] <- getArgs
print (read x < (1e400 :: Double))
print (read x < (-1e400 :: Double))
print (read x == (0/0 :: Double))
the last does n't get constant - folded to NaN , so we 're not really
|
915d1b4050b23fad158cd7b077e4a214dd9a4033fe716dfd0fcd0f510b0f3f5e | bitemyapp/fp-course | JsonParserSpec.hs | # OPTIONS_GHC -fno - warn - type - defaults #
# LANGUAGE NoImplicitPrelude #
{-# LANGUAGE OverloadedStrings #-}
module Course.JsonParserSpec where
import Data.Ratio ((%))
import Test.Hspec (Spec, describe, it, shouldBe)
import Course.Core
import Course.Jso... | null | https://raw.githubusercontent.com/bitemyapp/fp-course/a9a325cd895a0953151ec3d02f40006eb7993fb8/test/Course/JsonParserSpec.hs | haskell | # LANGUAGE OverloadedStrings # | # OPTIONS_GHC -fno - warn - type - defaults #
# LANGUAGE NoImplicitPrelude #
module Course.JsonParserSpec where
import Data.Ratio ((%))
import Test.Hspec (Spec, describe, it, shouldBe)
import Course.Core
import Course.JsonParser (jsonArray, jsonFalse, json... |
26552f4928beeaa2b0199cb2bc9340cfd69e1735ef4fa5995da8084880dc93cd | FlowForwarding/lincx | linc_us3_test_utils.erl | %%------------------------------------------------------------------------------
Copyright 2012 FlowForwarding.org
%%
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
%%... | null | https://raw.githubusercontent.com/FlowForwarding/lincx/7795923b51fa1e680511669f4a27404b2ed1f1dc/apps/linc_us3/src/linc_us3_test_utils.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, eithe... | Copyright 2012 FlowForwarding.org
Licensed under the Apache License , Version 2.0 ( the " License " ) ;
distributed under the License is distributed on an " AS IS " BASIS ,
@author Erlang Solutions Ltd. < >
2012 FlowForwarding.org
-module(linc_us3_test_utils).
-export([mock/1,
unmock/1,
... |
ce9e9d9ad1684e43e6afb9844c51a75437839838e750308f7ed541f01b09c90d | jbracker/supermonad | Types.hs |
# LANGUAGE TypeOperators #
# LANGUAGE TypeFamilies #
module Types
( Message, User
, Update(..), Request(..), Response(..)
, UpdateS, RequestS, EndS
, ServerInit, ServerProtocol
, ClientInit, ClientProtocol
, Connection(..), mkConnection
) where
import Control.Concurrent.SimpleSession.SessionTypes
... | null | https://raw.githubusercontent.com/jbracker/supermonad/2595396a225a65b1dce6ed9a1ce59960f392a55b/examples/monad/session-chat/original/Types.hs | haskell | | Type of the user identifier.
| Type of messages.
| Updates from the server.
| Requests from the client.
| Responses from the server to the client 'Request's.
| Type of a connection between server and client (View from server-side).
| Create a new connection.
| The server send the most current 'Update's to the... |
# LANGUAGE TypeOperators #
# LANGUAGE TypeFamilies #
module Types
( Message, User
, Update(..), Request(..), Response(..)
, UpdateS, RequestS, EndS
, ServerInit, ServerProtocol
, ClientInit, ClientProtocol
, Connection(..), mkConnection
) where
import Control.Concurrent.SimpleSession.SessionTypes
... |
428e94c0e659f21a6739c6410e2d006300023ec08727d876d174ec3af612dcf5 | kahua/Kahua | test-xml.scm | -*- coding : utf-8 ; mode : scheme -*-
;; test for kahua.test.xml
(use gauche.test)
(test-start "kahua.test.xml")
(use kahua.test.xml)
(test-module 'kahua.test.xml)
;;-----------------------------------------------------------------
(test-section "elements")
(test* "atom" #t (test-sxml-match? 'a 'a))
(test* "ato... | null | https://raw.githubusercontent.com/kahua/Kahua/41fa415511c54beab4922820989faf7ea71d2818/test/test-xml.scm | scheme | mode : scheme -*-
test for kahua.test.xml
-----------------------------------------------------------------
-----------------------------------------------------------------
-----------------------------------------------------------------
this is for compatiblity w/ older test code
---------------------------------... |
(use gauche.test)
(test-start "kahua.test.xml")
(use kahua.test.xml)
(test-module 'kahua.test.xml)
(test-section "elements")
(test* "atom" #t (test-sxml-match? 'a 'a))
(test* "atom" #f (test-sxml-match? 'a 'b))
(test* "atom" #t (test-sxml-match? "1" "1"))
(test* "atom" #f (test-sxml-match? "1" "2"))
(test* "atom" ... |
ac9aa12992b5ba26e176d82aa69c2db7c6c3f8db1f3333f1ef2a9342d0e75af9 | ocaml-multicore/parafuzz | ephetest4.ml | (* TEST *)
module E = Ephemeron.K1
let e = E.create ()
let _ =
let k = ref (ref 0) in
E.set_key e !k;
assert (E.check_key e);
Gc.full_major ();
assert (E.check_key e);
let d = Domain.spawn (fun () ->
let d = ref 0 in
E.set_data e d;
assert (E.check_key e);
assert (E.check_data e);
Gc.... | null | https://raw.githubusercontent.com/ocaml-multicore/parafuzz/6a92906f1ba03287ffcb433063bded831a644fd5/testsuite/tests/weak-ephe-final/ephetest4.ml | ocaml | TEST |
module E = Ephemeron.K1
let e = E.create ()
let _ =
let k = ref (ref 0) in
E.set_key e !k;
assert (E.check_key e);
Gc.full_major ();
assert (E.check_key e);
let d = Domain.spawn (fun () ->
let d = ref 0 in
E.set_data e d;
assert (E.check_key e);
assert (E.check_data e);
Gc.full_major ... |
64b1c1b91edbfa00a19f97ddd4871298350b8910c85254b44dde62ad70d0f8e7 | facebook/flow | serverMonitorListener.ml |
* Copyright ( c ) Meta Platforms , Inc. and affiliates .
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree .
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in t... | null | https://raw.githubusercontent.com/facebook/flow/948f34d87e8b4814e2ea8b954ad95f76f9e6c88f/src/server/monitor_listener/serverMonitorListener.ml | ocaml | Immediately register the new client
Immediately remove the dead client
* This is a thread that keeps reading messages from the monitor process and
adding them to a stream. It runs in parallel with the [Server.serve] loop, which
consumes the stream.
read a message from the monitor |
* Copyright ( c ) Meta Platforms , Inc. and affiliates .
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree .
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in t... |
8f3de74157956a5395f0554d5365189bec3ba894994972dc317549c9bf50d58b | nd/bird | 4.3.2.hs | map f undefined = undefined (by case exhaustion)
map undefined [] = [] | null | https://raw.githubusercontent.com/nd/bird/06dba97af7cfb11f558eaeb31a75bd04cacf7201/ch04/4.3.2.hs | haskell | map f undefined = undefined (by case exhaustion)
map undefined [] = [] | |
00648577a23e9971125c282c721a7879363d5461b252be84cbe6612d8fe62cfb | l04m33/parenscript-react-examples | example.lisp | (in-package #:react-examples/quadratic)
(defvar QuadraticCalculator
(chain React
(createClass
(create
getInitialState
(lambda ()
(create
a 1
b 3
c -4))
handleInputChange
... | null | https://raw.githubusercontent.com/l04m33/parenscript-react-examples/104063d1b73ef4ed41c04817d8b9bae9a1e0948f/examples/quadratic/example.lisp | lisp | (in-package #:react-examples/quadratic)
(defvar QuadraticCalculator
(chain React
(createClass
(create
getInitialState
(lambda ()
(create
a 1
b 3
c -4))
handleInputChange
... | |
5c8850a7a49ab6cb74e1bee328e88e71d062cb7ce736697593d13207896b8d2f | huangz1990/SICP-answers | test-28-better-fringe.scm | (load "test-manager/load.scm")
(load "28-better-fringe.scm")
(define x (list (list 1 2) (list 3 4)))
(define-each-check
(equal? (fringe '())
'())
(equal? (fringe x)
(list 1 2 3 4))
(equal? (fringe (list x x))
(list 1 2 3 4 1 2 3 4))
)
(run-registered-tests)
| null | https://raw.githubusercontent.com/huangz1990/SICP-answers/15e3475003ef10eb738cf93c1932277bc56bacbe/chp2/code/test-28-better-fringe.scm | scheme | (load "test-manager/load.scm")
(load "28-better-fringe.scm")
(define x (list (list 1 2) (list 3 4)))
(define-each-check
(equal? (fringe '())
'())
(equal? (fringe x)
(list 1 2 3 4))
(equal? (fringe (list x x))
(list 1 2 3 4 1 2 3 4))
)
(run-registered-tests)
| |
59511ad3857939402f9a8f9041b0baa97b43843fc53b175ccb534841e8d7df69 | nikita-volkov/hasql | Statement.hs | module Hasql.Statement
( Statement (..),
refineResult,
-- * Recipies
-- ** Insert many
-- $insertMany
-- ** IN and NOT IN
-- $inAndNotIn
)
where
import qualified Hasql.Decoders as Decoders
import qualified Hasql.Encoders as Encoders
import qualified Hasql.Private.Decoders as Decoders
imp... | null | https://raw.githubusercontent.com/nikita-volkov/hasql/0dda3e587a4d076b2ca9524b29a3ac4b1863eabe/library/Hasql/Statement.hs | haskell | * Recipies
** Insert many
$insertMany
** IN and NOT IN
$inAndNotIn
|
Specification of a strictly single-statement query, which can be parameterized and prepared.
Consists of the following:
* SQL template,
* params encoder,
* result decoder,
* a flag, determining whether it should be prepared.
According ... | module Hasql.Statement
( Statement (..),
refineResult,
)
where
import qualified Hasql.Decoders as Decoders
import qualified Hasql.Encoders as Encoders
import qualified Hasql.Private.Decoders as Decoders
import Hasql.Private.Prelude
The SQL template must be formatted according to Postgres ' standard ,
w... |
3a0eb2acc3d00f1947eb0eeac746e7f9f3fda26a34c7e6988d4602e2e12aec9a | sky-big/RabbitMQ | rabbit_federation_event.erl | The contents of this file are subject to the Mozilla Public License
%% Version 1.1 (the "License"); you may not use this file except in
%% compliance with the License. You may obtain a copy of the License
%% at /
%%
Software distributed under the License is distributed on an " AS IS "
%% basis, WITHOUT WARRANTY OF ... | null | https://raw.githubusercontent.com/sky-big/RabbitMQ/d7a773e11f93fcde4497c764c9fa185aad049ce2/plugins-src/rabbitmq-federation/src/rabbit_federation_event.erl | erlang | Version 1.1 (the "License"); you may not use this file except in
compliance with the License. You may obtain a copy of the License
at /
basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
the License for the specific language governing rights and
limitations under the License.
----------------... | The contents of this file are subject to the Mozilla Public License
Software distributed under the License is distributed on an " AS IS "
The Original Code is RabbitMQ .
The Initial Developer of the Original Code is GoPivotal , Inc.
Copyright ( c ) 2007 - 2014 GoPivotal , Inc. All rights reserved .
-module... |
c21bbdf36f07e61d27e3f307715ff4716102b709196e2be1a5db077bcaa4099e | isakmp/ike | monad.ml | open Result
* Monad core -- copied from ocaml - tls at 3428c0f37d4f7df94b371d34307112898c3ad6ea
* Monad core -- copied from ocaml-tls at 3428c0f37d4f7df94b371d34307112898c3ad6ea
*)
Generic monad core ; we could maybe import it from somewhere else .
module type Monad = sig
type 'a t
val return : 'a -> 'a... | null | https://raw.githubusercontent.com/isakmp/ike/fa93543941a77f6b09c88d8bb149dd0d40acc635/common/monad.ml | ocaml | A larger monadic api over the core.
* Concrete monads.
| open Result
* Monad core -- copied from ocaml - tls at 3428c0f37d4f7df94b371d34307112898c3ad6ea
* Monad core -- copied from ocaml-tls at 3428c0f37d4f7df94b371d34307112898c3ad6ea
*)
Generic monad core ; we could maybe import it from somewhere else .
module type Monad = sig
type 'a t
val return : 'a -> 'a... |
369e172a61c1f28d3483893a3fb6ee101243985a4f9b51344e807a374c022aa5 | ryanpbrewster/haskell | 091.hs | -- 091.hs
- The points P ( x1 , y1 ) and Q ( x2 , y2 ) are plotted at integer co - ordinates and
- are joined to the origin , O ( 0,0 ) , to form ΔOPQ .
-
-
- There are exactly fourteen triangles containing a right angle that can be
- formed when each co - ordinate lies between 0 and 2 inclusive ; tha... | null | https://raw.githubusercontent.com/ryanpbrewster/haskell/6edd0afe234008a48b4871032dedfd143ca6e412/project-euler/src/Old/091.hs | haskell | 091.hs
--> Tan[theta2] > Tan[theta1]
--> y2/x2 > y1/x1
> x1*y2 > x2*y1 |
- The points P ( x1 , y1 ) and Q ( x2 , y2 ) are plotted at integer co - ordinates and
- are joined to the origin , O ( 0,0 ) , to form ΔOPQ .
-
-
- There are exactly fourteen triangles containing a right angle that can be
- formed when each co - ordinate lies between 0 and 2 inclusive ; that is , 0 ... |
338d3238deb38c9f638a1567179be292ab60d480e7fd0cc745d330810fcba486 | flipstone/haskell-for-beginners | 1_algebraic_data_types_intro.hs | Define a data type that represents a Complex number :
--
-- Use Floats simplicity
--
Define add , sub , mult , and divide for Complex numbers
-- Define a set of data types allowing sandwiches to be constructed.
A sandwich include a choice of bread ( bun or roll ) , ( beef ,
-- chicke, or veggie) and an... | null | https://raw.githubusercontent.com/flipstone/haskell-for-beginners/e586a1f3ef08f21d5181171fe7a7b27057391f0b/problems/chapter_08/1_algebraic_data_types_intro.hs | haskell |
Use Floats simplicity
Define a set of data types allowing sandwiches to be constructed.
chicke, or veggie) and any numbers of toppings (ketchup, mustard,
cheese, lettuce, and tomato).
When you're done, you should be able to construct a sandwich like this:
Define a function to calculate the damage done (a... | Define a data type that represents a Complex number :
Define add , sub , mult , and divide for Complex numbers
A sandwich include a choice of bread ( bun or roll ) , ( beef ,
plain Roll Veggie ` with ` Cheese ` with ` Tomato ` with ` Ketchup
|
524d70ff8d9f5e98cb0df8aee877cf7be5121f9fb598f33bc8961bfb0f09798c | rads/up-clojure | project.clj | (defproject up-clojure "0.1.0-SNAPSHOT"
:dependencies [[org.clojure/clojure "1.9.0"]
[ring/ring-core "1.6.3"]
[ring/ring-jetty-adapter "1.6.3"]]
:main up-clojure.server
:uberjar-name "server.jar"
:profiles {:uberjar {:aot :all}})
| null | https://raw.githubusercontent.com/rads/up-clojure/b533597371d57f2bfb640cd5f9da5d67ecfa0f26/project.clj | clojure | (defproject up-clojure "0.1.0-SNAPSHOT"
:dependencies [[org.clojure/clojure "1.9.0"]
[ring/ring-core "1.6.3"]
[ring/ring-jetty-adapter "1.6.3"]]
:main up-clojure.server
:uberjar-name "server.jar"
:profiles {:uberjar {:aot :all}})
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.