_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 |
|---|---|---|---|---|---|---|---|---|
9e21014b47d7ba8d902e19464444dcc61106f0ad0bdffd9867ce923b6d3b2ce8 | rwmjones/guestfs-tools | sysprep_operation_blkid_tab.ml | virt - sysprep
* Copyright ( C ) 2012 FUJITSU LIMITED
*
* 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/rwmjones/guestfs-tools/3a498512f58bc431db490e96cdb712b19389bda4/sysprep/sysprep_operation_blkid_tab.ml | ocaml | virt - sysprep
* Copyright ( C ) 2012 FUJITSU LIMITED
*
* 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 ... | |
13e69188a51919c3ae5d0c0b7cee2a9a5e7c4a83eb3cd85cd04b36dd2e1f078a | roburio/udns | dns_server.ml | ( c ) 2017 , 2018 , all rights reserved
open Rresult
open R.Infix
open Dns
let src = Logs.Src.create "dns_server" ~doc:"DNS server"
module Log = (val Logs.src_log src : Logs.LOG)
module IPM = Map.Make(Ipaddr.V4)
let guard p err = if p then Ok () else Error err
let guardf p err = if p then Ok () else Error (err... | null | https://raw.githubusercontent.com/roburio/udns/585c40933ac3d5eceb351f7edd3f45cf2615a9f8/server/dns_server.ml | ocaml | if only domain-name had proper types
TODO: should randomize answers + ad?
this won't happen, decoder constructs `Axfr
this implements RFC 2136 Section 2.4 + 3.2
RFC 2136 Section 2.5 + 3.4.2
TODO AAAA records / use lookup_glue?
outstanding notifications, with timestamp and retry count
(at most one per ... | ( c ) 2017 , 2018 , all rights reserved
open Rresult
open R.Infix
open Dns
let src = Logs.Src.create "dns_server" ~doc:"DNS server"
module Log = (val Logs.src_log src : Logs.LOG)
module IPM = Map.Make(Ipaddr.V4)
let guard p err = if p then Ok () else Error err
let guardf p err = if p then Ok () else Error (err... |
230e9159dfec84d53e33ba5a3a8e6c90dd645d1ad15b96992731724024bc1248 | filecoin-project/orient | zigzag.lisp | (in-package :filecoin)
(in-suite filecoin-suite)
;; Move these into system/schema.
Spedersen has landed , so this should remain 1 .
(defparameter *gpu-speedup* 1)
(defparameter *blake2s-speedup* 1)
(defun benchmark-clock-speed ()
"Benchmark clock speed in MHz."
(tref 'processor-base-frequency-hz (tref 'system (... | null | https://raw.githubusercontent.com/filecoin-project/orient/3a9ec7c41fd9f8ac5185c358ce908e5646ddffca/filecoin/zigzag.lisp | lisp | Move these into system/schema.
Groth16, BLS12-381 -- eventually should allow selection of proving systems/curves.
; Groth16 , SW6 -- eventually should allow selection of proving systems / curves .
TODO: account for other constraint sources.
(max-beta-merkle-height 0)
-- is not assigned internally, so this constrai... | (in-package :filecoin)
(in-suite filecoin-suite)
Spedersen has landed , so this should remain 1 .
(defparameter *gpu-speedup* 1)
(defparameter *blake2s-speedup* 1)
(defun benchmark-clock-speed ()
"Benchmark clock speed in MHz."
(tref 'processor-base-frequency-hz (tref 'system (benchmarks))))
(defun scale-bench... |
60ae93910d5c92d0634c610fbd4818060850bc5545e64bb7647c4dfe833199a0 | spawnfest/eep49ers | uri_string_SUITE.erl | %%
%% %CopyrightBegin%
%%
Copyright Ericsson AB 2008 - 2020 . All Rights Reserved .
%%
Licensed under the Apache License , Version 2.0 ( the " License " ) ;
%% you may not use this file except in compliance with the License.
%% You may obtain a copy of the License at
%%
%% -2.0
%%
%% Unless required by applicab... | null | https://raw.githubusercontent.com/spawnfest/eep49ers/d1020fd625a0bbda8ab01caf0e1738eb1cf74886/lib/stdlib/test/uri_string_SUITE.erl | erlang |
%CopyrightBegin%
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
-2.0
Unless required by applicable law or agreed to in writing, software
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific lan... | Copyright Ericsson AB 2008 - 2020 . 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(uri_string_SUITE).
-include_lib("common_test/include/ct.hrl").
-export([all/0, suite/0,groups/0,
n... |
e4eb3b0bde8b095f0e81d1b67d6b3024d72ee82c1a06b83d4220b9546a20551e | macourtney/Dark-Exchange | main_frame.clj | (ns darkexchange.view.main.main-frame
(:require [darkexchange.model.terms :as terms]
[darkexchange.view.main.main-menu-bar :as main-menu-bar]
[darkexchange.view.main.tabbed-pane :as tabbed-pane]
[darkexchange.view.utils :as view-utils]
[seesaw.core :as seesaw-core]))
(... | null | https://raw.githubusercontent.com/macourtney/Dark-Exchange/1654d05cda0c81585da7b8e64f9ea3e2944b27f1/src/darkexchange/view/main/main_frame.clj | clojure | (ns darkexchange.view.main.main-frame
(:require [darkexchange.model.terms :as terms]
[darkexchange.view.main.main-menu-bar :as main-menu-bar]
[darkexchange.view.main.tabbed-pane :as tabbed-pane]
[darkexchange.view.utils :as view-utils]
[seesaw.core :as seesaw-core]))
(... | |
cb196009bccd970a29dc96b097bd37a9c03afee95ed0f34a65971ef677324733 | aantron/markup.ml | namespace.mli | This file is part of Markup.ml , released under the MIT license . See
LICENSE.md for details , or visit .
LICENSE.md for details, or visit . *)
open Common
module Parsing :
sig
type context
val init : (string -> string option) -> context
val push :
unit Error.handler ->
context ->
string... | null | https://raw.githubusercontent.com/aantron/markup.ml/420aaa3d38d90ed84d1d7157840f7df5f3b5b349/src/namespace.mli | ocaml | This file is part of Markup.ml , released under the MIT license . See
LICENSE.md for details , or visit .
LICENSE.md for details, or visit . *)
open Common
module Parsing :
sig
type context
val init : (string -> string option) -> context
val push :
unit Error.handler ->
context ->
string... | |
1071d3a67668ad649e4cfd10e7a1636ecda44c3809e5a86ccb93c78ce71f2e04 | rufus-lang/rufus | rufus_forms_test.erl | -module(rufus_forms_test).
-include_lib("eunit/include/eunit.hrl").
%% Enumeration API
map_with_empty_input_test() ->
?assertEqual([], rufus_forms:map([], fun annotate/1)).
map_with_noop_function_test() ->
Form = rufus_form:make_literal(bool, true, 7),
?assertEqual([Form], rufus_forms:map([Form], fun(F)... | null | https://raw.githubusercontent.com/rufus-lang/rufus/c144a8db0c36fd270593234e5509dcc1beec4d04/rf/test/rufus_forms_test.erl | erlang | Enumeration API
Scope API | -module(rufus_forms_test).
-include_lib("eunit/include/eunit.hrl").
map_with_empty_input_test() ->
?assertEqual([], rufus_forms:map([], fun annotate/1)).
map_with_noop_function_test() ->
Form = rufus_form:make_literal(bool, true, 7),
?assertEqual([Form], rufus_forms:map([Form], fun(F) -> F end)).
map_t... |
238ae23aa4e878e7159fe76d0c73085ccf40831388339707c8a2e4325b290b4a | mflatt/scratchy | reader.rkt | #lang racket
(require "parser.rkt"
parser-tools/lex)
(provide read-syntax
read
get-info)
;; To read a module:
(define (read-syntax src-name in)
(define stx (parse src-name in))
(let* ([p-name (object-name in)]
[name (if (path? p-name)
(let-values ([(base name... | null | https://raw.githubusercontent.com/mflatt/scratchy/aef8883759fc962828bf977811697fccf06ef8b0/scratchy/reader.rkt | racket | To read a module:
In case `read' is used, instead of `read-syntax':
To get info about the language's environment support:
Environment support for token coloring:
Get next token:
Package classification with srcloc:
Convert token to classification: | #lang racket
(require "parser.rkt"
parser-tools/lex)
(provide read-syntax
read
get-info)
(define (read-syntax src-name in)
(define stx (parse src-name in))
(let* ([p-name (object-name in)]
[name (if (path? p-name)
(let-values ([(base name dir?) (split-path p-... |
49c44503dd7eec36c55f0e4540d4cde7846b25996ce027182457206a0400165f | debug-ito/greskell | Common.hs | {-# LANGUAGE OverloadedStrings #-}
-- |
-- Module: Network.Greskell.WebSocket.Request.Common
-- Description: Common data types for Request objects
Maintainer : < >
--
--
module Network.Greskell.WebSocket.Request.Common
( Operation (..)
, SASLMechanism (..)
, Base64 (..)
) where
import Co... | null | https://raw.githubusercontent.com/debug-ito/greskell/ff21b8297a158cb4b5bafcbb85094cef462c5390/greskell-websocket/src/Network/Greskell/WebSocket/Request/Common.hs | haskell | # LANGUAGE OverloadedStrings #
|
Module: Network.Greskell.WebSocket.Request.Common
Description: Common data types for Request objects
| Class of operation objects.
^ \"processor\" field.
^ \"op\" field.
| Possible SASL mechanisms.
^ \"PLAIN\" SASL
^ \"GSSAPI\" SASL
'Text'. 'FromJSON' is its inverse. | Maintainer : < >
module Network.Greskell.WebSocket.Request.Common
( Operation (..)
, SASLMechanism (..)
, Base64 (..)
) where
import Control.Applicative (empty)
import Data.Aeson (FromJSON (..), Object, ToJSON (..), Value (String))
import Data.ByteStrin... |
484827b46eec627478155c85562b49b39796a5b8dec79fc06763b4c33a0576ab | fractalide/fractalide | horizontal-panel.rkt | #lang racket/base
(require fractalide/modules/rkt/rkt-fbp/agent
fractalide/modules/rkt/rkt-fbp/agents/gui/helper)
(require racket/gui/base
racket/match
racket/list)
(require (rename-in racket/class [send class-send]))
(define (generate-hp input)
(lambda (frame)
(let* ([hp (new horiz... | null | https://raw.githubusercontent.com/fractalide/fractalide/9c54ec2615fcc2a1f3363292d4eed2a0fcb9c3a5/modules/rkt/rkt-fbp/agents/gui/horizontal-panel.rkt | racket | TODO: manage orientation
in port
out port
TRUE : A message in the input port
FALSE : At least a message in the input array port
Add it
order
must add
continue | #lang racket/base
(require fractalide/modules/rkt/rkt-fbp/agent
fractalide/modules/rkt/rkt-fbp/agents/gui/helper)
(require racket/gui/base
racket/match
racket/list)
(require (rename-in racket/class [send class-send]))
(define (generate-hp input)
(lambda (frame)
(let* ([hp (new horiz... |
08c9ae333b85e495699c3d9dc61f586294f71f48c754290624059d6d08021ac7 | uxbox/uxbox-backend | test_auth.clj | (ns uxbox.tests.test-auth
(:require [clojure.test :as t]
[promesa.core :as p]
[clj-http.client :as http]
[catacumba.testing :refer (with-server)]
[buddy.hashers :as hashers]
[uxbox.db :as db]
[uxbox.frontend :as uft]
[uxbox.services.u... | null | https://raw.githubusercontent.com/uxbox/uxbox-backend/036c42db8424be3ac34c38be80577ee279141681/test/uxbox/tests/test_auth.clj | clojure | (println "RESPONSE:" status data)
(println "RESPONSE:" status data) | (ns uxbox.tests.test-auth
(:require [clojure.test :as t]
[promesa.core :as p]
[clj-http.client :as http]
[catacumba.testing :refer (with-server)]
[buddy.hashers :as hashers]
[uxbox.db :as db]
[uxbox.frontend :as uft]
[uxbox.services.u... |
0f27945ef4afc940154f6440329f0fc7b7a2844778832441fa7618ae0cc5911b | psholtz/MIT-SICP | exercise2-37.scm | ;;
Exercise 2.37
;;
;; Suppose we represent vectors v = v(i) as sequences of numbers, and matrices m = m(ij) as sequences
;; of vectors (the rows of the matrix). For example, the matrix:
;;
| 1 2 3 4 |
| 4 5 6 6 |
;; | 6 7 8 9 |
;;
is represented as the sequence ( ( 1 2 3 4 ) ( 4 5 6 6 ) ( 6 7 8... | null | https://raw.githubusercontent.com/psholtz/MIT-SICP/01e9b722ac5008e26f386624849117ca8fa80906/Section-2.2/mit-scheme/exercise2-37.scm | scheme |
Suppose we represent vectors v = v(i) as sequences of numbers, and matrices m = m(ij) as sequences
of vectors (the rows of the matrix). For example, the matrix:
| 6 7 8 9 |
any sequence operations to concisely express the basic matrix and vector operations. These operations
(which are described in any book... | Exercise 2.37
| 1 2 3 4 |
| 4 5 6 6 |
is represented as the sequence ( ( 1 2 3 4 ) ( 4 5 6 6 ) ( 6 7 8 9 ) ) . With this representation we can use
( The procedure " accumulate - n " is defined in exercise 2.36 ) .
(define (accumulate op initial sequence)
(if (null? sequence)
initial
... |
219edf24b6b85d97ecdf92a2abd8c9c2f709c2ea4c09f40a3e785e3422d61427 | facebookincubator/hsthrift | RecursiveTest.hs | Copyright ( c ) Facebook , Inc. and its affiliates .
module RecursiveTest where
import Test.HUnit
import TestRunner
import qualified Data.Map.Strict as Map
import qualified Data.Text as Text
import Thrift.Compiler.Options
import Thrift.Compiler.Parser
import Thrift.Compiler.Plugins.Haskell
import Thrift.Compiler.T... | null | https://raw.githubusercontent.com/facebookincubator/hsthrift/d3ff75d487e9d0c2904d18327373b603456e7a01/tests/RecursiveTest.hs | haskell | Copyright ( c ) Facebook , Inc. and its affiliates .
module RecursiveTest where
import Test.HUnit
import TestRunner
import qualified Data.Map.Strict as Map
import qualified Data.Text as Text
import Thrift.Compiler.Options
import Thrift.Compiler.Parser
import Thrift.Compiler.Plugins.Haskell
import Thrift.Compiler.T... | |
30f5edfdde95f99560c75e4b816aaa532699ee2335589dd34a65acc41a43724e | thheller/shadow-cljsjs | vega_embed.cljs | (ns cljsjs.vega-embed
(:require ["vega-embed" :as vega-embed]))
(js/goog.exportSymbol "vegaEmbed" vega-embed) | null | https://raw.githubusercontent.com/thheller/shadow-cljsjs/eaf350d29d45adb85c0753dff77e276e7925a744/src/main/cljsjs/vega_embed.cljs | clojure | (ns cljsjs.vega-embed
(:require ["vega-embed" :as vega-embed]))
(js/goog.exportSymbol "vegaEmbed" vega-embed) | |
a59948c3beee16a4feeb7bfed36fb8a76a81c54af37e6107dfe261ced22828e4 | camllight/camllight | compiler_dependant_stuff.mli | #open "external_type";;
value read_interface :
string -> (string * GLOBAL_NAME * (int * int * EXTERNAL_TYPE)) list;;
| null | https://raw.githubusercontent.com/camllight/camllight/0cc537de0846393322058dbb26449427bfc76786/sources/contrib/camlsearch/source/compiler_dependant_stuff.mli | ocaml | #open "external_type";;
value read_interface :
string -> (string * GLOBAL_NAME * (int * int * EXTERNAL_TYPE)) list;;
| |
28343035c10c83b726cc9842a2d9297a567e61c6327ab27bd21d72277582f717 | declanoller/haskell-vae | produce_output.hs |
import Numeric.LinearAlgebra
import Data.List.Split
import System.Random
import Data.Typeable
import MatNNGradTypes
import Utils
import MatrixUtils
import NNUtils
import GradUtils
import TrainUtils
import System.Directory
main = do
let train_info = TrainInfo { batch_size = 32
, b... | null | https://raw.githubusercontent.com/declanoller/haskell-vae/08c54e37be8592e699dac412c6859a775eb92460/produce_output.hs | haskell | vae_name = "dogpeople_vae_0KL1500hidden_50latent"
vae_name = "current_running_VAE"
pt1_data < - get_contents_as_mat_from_fname ( " friends_faces_data/ " + + " face_david.txt " )
let pt1 = batch_to_mat $ forward_vae_to_latent_space new_vae ( Batch pt1_data )
let pt2 = ( batch_to_mat latent_batch ) ? ? ( Pos $ idxs... |
import Numeric.LinearAlgebra
import Data.List.Split
import System.Random
import Data.Typeable
import MatNNGradTypes
import Utils
import MatrixUtils
import NNUtils
import GradUtils
import TrainUtils
import System.Directory
main = do
let train_info = TrainInfo { batch_size = 32
, b... |
d34e6efaa5a62e1c817485989b2cb09c1407f861bdc8d0e5d2d222591394cd8f | dparis/gen-phzr | pixi.cljs | (ns phzr.pixi
(:require [phzr.impl.utils.core :refer [clj->phaser phaser->clj]]
[phzr.impl.extend :as ex]
[cljsjs.phaser]))
(defn can-use-new-canvas-blend-modes
"Checks whether the Canvas BlendModes are supported by the current browser for drawImage
Returns: Boolean - whether they are s... | null | https://raw.githubusercontent.com/dparis/gen-phzr/e4c7b272e225ac343718dc15fc84f5f0dce68023/out/pixi.cljs | clojure | ) | (ns phzr.pixi
(:require [phzr.impl.utils.core :refer [clj->phaser phaser->clj]]
[phzr.impl.extend :as ex]
[cljsjs.phaser]))
(defn can-use-new-canvas-blend-modes
"Checks whether the Canvas BlendModes are supported by the current browser for drawImage
Returns: Boolean - whether they are s... |
4183927e7a1595dc37472cb9f6b42358854b237b83612de55a9fbe308ad0f9e4 | Xylios13/archigd | abu-dhabi-revit-modified.rkt | #lang racket
(require rosetta/archicad)
(define beam-family (load-beam-family "C:\\ProgramData\\Autodesk\\RVT 2015\\Libraries\\US Metric\\Structural Framing\\Wood\\M_Timber.rfa" #:width "b" #:height "d"))
(define (rotate-p-z p a)
(xyz (- (* (cx p) (cos a))
(* (cy p) (sin a)))
(+ (* (cx p) (sin a))
... | null | https://raw.githubusercontent.com/Xylios13/archigd/2276679ae60858f80efdf286fdd9fb38663e2269/archicad/testing%20examples/abu-dhabi-revit-modified.rkt | racket | Upper
Lower | #lang racket
(require rosetta/archicad)
(define beam-family (load-beam-family "C:\\ProgramData\\Autodesk\\RVT 2015\\Libraries\\US Metric\\Structural Framing\\Wood\\M_Timber.rfa" #:width "b" #:height "d"))
(define (rotate-p-z p a)
(xyz (- (* (cx p) (cos a))
(* (cy p) (sin a)))
(+ (* (cx p) (sin a))
... |
0a0a9576fab5153293c8244ee9bffaec6ec60a8354bd876e5c98483cdd77a052 | janestreet/rpc_parallel | remote_executable.ml | open Core
open Poly
open Async
type 'a t =
{ host : string
; path : string
; host_key_checking : string list
}
[@@deriving fields]
let hostkey_checking_options opt =
match opt with
| None -> []
(* Use ssh default *)
| Some `Ask -> [ "-o"; "StrictHostKeyChecking=ask" ]
| Some `No -> [ "-o"; "StrictHo... | null | https://raw.githubusercontent.com/janestreet/rpc_parallel/b37ce51ddfd9d9b6f96d285c81db7fc36d66a1d5/src/remote_executable.ml | ocaml | Use ssh default
If we are running a test, we should propagate the relevant environment variable
through ssh so the spawned workers know they are running a test. | open Core
open Poly
open Async
type 'a t =
{ host : string
; path : string
; host_key_checking : string list
}
[@@deriving fields]
let hostkey_checking_options opt =
match opt with
| None -> []
| Some `Ask -> [ "-o"; "StrictHostKeyChecking=ask" ]
| Some `No -> [ "-o"; "StrictHostKeyChecking=no" ]
| ... |
587750fe8a53b06acea2c2fd3b1e6578fe8a69140fa8ab8bd1fb1fd7ce5ea894 | la-wu/ryu | Spec.hs | import Data.Floating.Ryu.F2S
import Data.Floating.Ryu.D2S
import Data.Floating.Ryu.Common
import Data.Floating.RealFloat
import Data.Bits
import Data.Bits.Floating (coerceToFloat, coerceToWord)
import qualified Data.ByteString.Builder as BB
import qualified Data.ByteString.Lazy as BL
import Data.Char (ord)
import Data.... | null | https://raw.githubusercontent.com/la-wu/ryu/f151ff06658cf3c525ce708bffe7c28d7e3e6b7f/test/Spec.hs | haskell | | Encode a 'String' of only ASCII characters using the ASCII encoding.
We go through the set of all possible values in stride-sized
steps, and go through all possible [0,stride) offsets. This gives
us good coverage across the whole range of floating point numbers
use a prime to avoid bit patterns in the floating p... | import Data.Floating.Ryu.F2S
import Data.Floating.Ryu.D2S
import Data.Floating.Ryu.Common
import Data.Floating.RealFloat
import Data.Bits
import Data.Bits.Floating (coerceToFloat, coerceToWord)
import qualified Data.ByteString.Builder as BB
import qualified Data.ByteString.Lazy as BL
import Data.Char (ord)
import Data.... |
43b2d5d129424e55dbdb72939e17677bf1c15597c8e4d30b59368fba688182cd | rixed/ramen | RamenIp.ml | Either v4 or v6
open Batteries
open Stdint
open DessserOCamlBackEndHelpers
open RamenHelpersNoLog
type t =
V4 of uint32 | V6 of uint128
[@@ppp PPP_OCaml]
(* Those are used by code generated by dessser: *)
let make_v4 n = V4 n
let make_v6 n = V6 n
let to_string = function
| V4 n -> RamenIpv4.to_string n
| V... | null | https://raw.githubusercontent.com/rixed/ramen/941b3c0180540266059c41c8d613beec1041337f/src/RamenIp.ml | ocaml | Those are used by code generated by dessser:
Those are used by code generated by dessser:
[ip] and [cidrs] can be nulls, but the individual cidr are not:
Whatever IP is not in the empty list
If list is unknown or not empty, then we don't know
[ip] and [cidrs] can be nulls, and so can be each of the individua... | Either v4 or v6
open Batteries
open Stdint
open DessserOCamlBackEndHelpers
open RamenHelpersNoLog
type t =
V4 of uint32 | V6 of uint128
[@@ppp PPP_OCaml]
let make_v4 n = V4 n
let make_v6 n = V6 n
let to_string = function
| V4 n -> RamenIpv4.to_string n
| V6 n -> RamenIpv6.to_string n
let print oc n = Stri... |
7f05069d428e2f22daada2767d5426f4aabd206a7a3fb9bf5628aa36c012b3cd | con-kitty/categorifier-c | Barbies.hs | # LANGUAGE AllowAmbiguousTypes #
{-# LANGUAGE ConstraintKinds #-}
{-# LANGUAGE RankNTypes #-}
# LANGUAGE UndecidableSuperClasses #
| This module exists only to fill in various gaps in the @barbies@ library for working with
-- higher-kinded functors.
--
-- __There are no new abstractions or concepts introduced in thi... | null | https://raw.githubusercontent.com/con-kitty/categorifier-c/a34ff2603529b4da7ad6ffe681dad095f102d1b9/Categorifier/C/Barbies.hs | haskell | # LANGUAGE ConstraintKinds #
# LANGUAGE RankNTypes #
higher-kinded functors.
__There are no new abstractions or concepts introduced in this module__. Everything here is
** Folds with specified associativity
** Effects-only traversal
** Side-effecting zips
** Effects-only zips
* Constraint support
# ANN module ... | # LANGUAGE AllowAmbiguousTypes #
# LANGUAGE UndecidableSuperClasses #
| This module exists only to fill in various gaps in the @barbies@ library for working with
defined in terms of functions from " Barbies " and components from @base@. Everything in this
module should eventually move upstream into the main @b... |
033f77bb6aefeb73479a57c77e4b3fe71f38485cfdb6736683bde55ed5123915 | danieljharvey/mimsa | CodegenError.hs | # LANGUAGE DerivingStrategies #
{-# LANGUAGE OverloadedStrings #-}
module Language.Mimsa.Types.Error.CodegenError where
import Language.Mimsa.Core
import Prettyprinter
data CodegenError
= TypeShouldHaveAtLeastOneVariable
| TypeShouldHaveNoVariables
| ExpectedNonEmptyMap
| NoConstructorMatches
| TooManyCons... | null | https://raw.githubusercontent.com/danieljharvey/mimsa/e6b177dd2c38e8a67d6e27063ca600406b3e6b56/compiler/src/Language/Mimsa/Types/Error/CodegenError.hs | haskell | # LANGUAGE OverloadedStrings #
for Monoid | # LANGUAGE DerivingStrategies #
module Language.Mimsa.Types.Error.CodegenError where
import Language.Mimsa.Core
import Prettyprinter
data CodegenError
= TypeShouldHaveAtLeastOneVariable
| TypeShouldHaveNoVariables
| ExpectedNonEmptyMap
| NoConstructorMatches
| TooManyConstructorMatches
| CannotUseNonFunc... |
7aad57bfde191d783eecb08257aa625de688360eea7d2419980f41bfc49d7b79 | potatosalad/erlang-jose | jose_jwe_alg_ecdh_es_props.erl | -*- mode : erlang ; tab - width : 4 ; indent - tabs - mode : 1 ; st - rulers : [ 70 ] -*-
%% vim: ts=4 sw=4 ft=erlang noet
-module(jose_jwe_alg_ecdh_es_props).
-include_lib("public_key/include/public_key.hrl").
-include_lib("proper/include/proper.hrl").
% -compile(export_all).
base64url_binary() ->
?LET(Binary,
... | null | https://raw.githubusercontent.com/potatosalad/erlang-jose/43d3db467f909bbc932bd663ddcb1af93180dfd3/test/property_test/jose_jwe_alg_ecdh_es_props.erl | erlang | vim: ts=4 sw=4 ft=erlang noet
-compile(export_all).
ec_curve() ->
?SUCHTHAT(CurveId,
begin
try pubkey_cert_records:namedCurves(CurveId) of
Curve when is_tuple(Curve) ->
true;
_ ->
false
catch
_:_ ->
false
end
end).
ec_keypair() ->
ec_curve(),
ec_keypair(Cur... | -*- mode : erlang ; tab - width : 4 ; indent - tabs - mode : 1 ; st - rulers : [ 70 ] -*-
-module(jose_jwe_alg_ecdh_es_props).
-include_lib("public_key/include/public_key.hrl").
-include_lib("proper/include/proper.hrl").
base64url_binary() ->
?LET(Binary,
binary(),
jose_jwa_base64url:encode(Binary)).
binary... |
5d1d08606edb57653feae3a29f69810ea7ade79146ab71e4a89ae3954e98041c | wenkokke/dep2con | Constituency.hs | module Language.Structure.Constituency where
import Prelude hiding (Word)
import Data.Monoid ((<>))
import qualified Data.Tree as Rose
import Language.POS (POS)
import Language.Word (Word (Word, serial))
-- |Constituency trees are rose trees with POS tags in their nodes and wo... | null | https://raw.githubusercontent.com/wenkokke/dep2con/eec24bc8e1a4db5b1582f0fd933ab02f8a6ce041/src/Language/Structure/Constituency.hs | haskell | |Constituency trees are rose trees with POS tags in their nodes and words in
their leaves.
|Get the left-most index from a constituency tree.
|Get all words in a constituency tree.
|Compute the minimum distance from any node in the (sub-)tree to a
specific serial. /O(n)/
|Convert the tree to an instance of `Da... | module Language.Structure.Constituency where
import Prelude hiding (Word)
import Data.Monoid ((<>))
import qualified Data.Tree as Rose
import Language.POS (POS)
import Language.Word (Word (Word, serial))
data Tree
= Leaf Word
| Node POS [Tree]
deriving (Eq)
instance Ord... |
812d640986f270138b81a9bfc849aaad4cd51a775e5026dbae77f64a4252ce60 | andrewthad/colonnade | Spec.hs | {-# LANGUAGE OverloadedStrings #-}
module Main (main) where
import Test.HUnit (Assertion,(@?=),assertBool,assertFailure)
import Test.Framework (defaultMainWithOpts, interpretArgsOrExit,
testGroup, Test)
import Test.Framework.... | null | https://raw.githubusercontent.com/andrewthad/colonnade/3d9fd928bc118fb40075601db4858863bbd5203a/geolite-csv/test/Spec.hs | haskell | # LANGUAGE OverloadedStrings #
----------------------------------------------
The default behavior of this test suite is to
test the CSV decoders against small samples of
the GeoLite2 databases. These small samples are
included as part of this repository. If you give
this test suite an argument named "large", it
... |
module Main (main) where
import Test.HUnit (Assertion,(@?=),assertBool,assertFailure)
import Test.Framework (defaultMainWithOpts, interpretArgsOrExit,
testGroup, Test)
import Test.Framework.Providers.HUnit (testCase)
im... |
428354d288884c840ef13461ac6500d755fe66ff1a549b809d6d66338b2162ed | pa-ba/compdata-param | Annotation.hs | # LANGUAGE TypeOperators , MultiParamTypeClasses , FlexibleInstances ,
UndecidableInstances , Rank2Types , GADTs , ScopedTypeVariables #
UndecidableInstances, Rank2Types, GADTs, ScopedTypeVariables #-}
--------------------------------------------------------------------------------
-- |
Module : Data . ... | null | https://raw.githubusercontent.com/pa-ba/compdata-param/5d6b0afa95a27fd3233f86e5efc6e6a6080f4236/src/Data/Comp/Param/Multi/Annotation.hs | haskell | ------------------------------------------------------------------------------
|
License : BSD3
Stability : experimental
This module defines annotations on signatures.
------------------------------------------------------------------------------
| Annotate each node of a term with a constant value.
| Th... | # LANGUAGE TypeOperators , MultiParamTypeClasses , FlexibleInstances ,
UndecidableInstances , Rank2Types , GADTs , ScopedTypeVariables #
UndecidableInstances, Rank2Types, GADTs, ScopedTypeVariables #-}
Module : Data . Comp . . Multi . Annotation
Copyright : ( c ) 2010 - 2011 ,
Maintainer ... |
81b7b9b4997eb00f8ade538fa14e4a70359d25b5748e6812f5cf78cfdead9837 | lichenscript/lichenscript | annotate.ml |
* Copyright 2022
*
* Licensed under the Apache License , Version 2.0 ( the " License " ) ;
* you may not use this file except in compliance with the License .
* You may obtain a copy of the License at
*
* -2.0
*
* Unless required by applicable law or agreed to in writing , software
... | null | https://raw.githubusercontent.com/lichenscript/lichenscript/67bc7fb37adac04b458ef805d28a572611dab5a8/lib/typing/annotate.ml | ocaml | 'c'
* it's class or enum, create a ref to it,
* for example, a None identifer, actually represents a constructor of None
* it's a namespace, return the var of the original symbol
* for example:
*
* import lib from "xxx";
*
... |
* Copyright 2022
*
* Licensed under the Apache License , Version 2.0 ( the " License " ) ;
* you may not use this file except in compliance with the License .
* You may obtain a copy of the License at
*
* -2.0
*
* Unless required by applicable law or agreed to in writing , software
... |
7c57378bb38cc30072f6b24b9b60e2d9a26c73cf2be23e5f5fc349e7a74dbe7c | amnh/poy5 | status_html.ml | POY 5.1.1 . A phylogenetic analysis program using Dynamic Homologies .
Copyright ( C ) 2014 , , , Ward Wheeler ,
and the American Museum of Natural History .
(* *)
(* This program is free softwa... | null | https://raw.githubusercontent.com/amnh/poy5/da563a2339d3fa9c0110ae86cc35fad576f728ab/src/status_html.ml | ocaml |
This program is free software; you can redistribute it and/or modify
(at your option) any later version.
This progra... | POY 5.1.1 . A phylogenetic analysis program using Dynamic Homologies .
Copyright ( C ) 2014 , , , Ward Wheeler ,
and the American Museum of Natural History .
it under the terms of the GNU General Public License as published by
the Free Software Foundation ; ... |
d77fae7b299fe26973b7a0eb972ce4c3c8d3ff0a9bfec210c1e109750eb1f4d6 | racket/racket7 | utf-16-decode.rkt | #lang racket/base
(require "../common/set-two.rkt")
(provide utf-16-decode)
(define big-endian? (system-big-endian?))
(define (utf-16-decode bstr)
(define len (bytes-length bstr))
(define surrogate-count
(for/fold ([n 0]) ([b (in-bytes bstr (if big-endian? 0 1) len 2)])
(if (= (bitwise-and b #xDC) #xD8... | null | https://raw.githubusercontent.com/racket/racket7/5dbb62c6bbec198b4a790f1dc08fef0c45c2e32b/racket/src/io/string/utf-16-decode.rkt | racket | surrogate pair | #lang racket/base
(require "../common/set-two.rkt")
(provide utf-16-decode)
(define big-endian? (system-big-endian?))
(define (utf-16-decode bstr)
(define len (bytes-length bstr))
(define surrogate-count
(for/fold ([n 0]) ([b (in-bytes bstr (if big-endian? 0 1) len 2)])
(if (= (bitwise-and b #xDC) #xD8... |
e97365e44a3e6b0dd24e269b6e05fdd4f3502fff652d41a2df678b8d9ed6b787 | ptal/AbSolute | bound_rat.ml | This program is free software ; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation ; either
version 3 of the License , or ( at your option ) any later version .
This program is distributed in the hope that... | null | https://raw.githubusercontent.com/ptal/AbSolute/469159d87e3a717499573c1e187e5cfa1b569829/src/bounds/bound_rat.ml | ocaml | useful constants
classification
conversion, printing
Is equal to Bound_int.inf and Bound_int.minus_inf.
We cannot use them directly otherwise we have a circular dependency.
This is a helper function that apply `f` to `x` only for finite value.
printing
exact operators
operators with rounding
helper: o... | This program is free software ; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation ; either
version 3 of the License , or ( at your option ) any later version .
This program is distributed in the hope that... |
d37675f65f210e8832a727bfb2d53f6e20db83a5cb820cb27dda428bc46cd0f9 | input-output-hk/rscoin-core | CryptoSpec.hs | | RSCoin . Core . Crypto specification
module Test.RSCoin.Core.CryptoSpec
( spec
) where
import Test.Hspec (Spec, describe)
import Test.Hspec.QuickCheck (prop)
import RSCoin.Core.Crypto (PublicKey, SecretKey, checkKeyPair,
... | null | https://raw.githubusercontent.com/input-output-hk/rscoin-core/5b3fde8de1bdce71ee6ea0e8f1582ea28f451171/test/Test/RSCoin/Core/CryptoSpec.hs | haskell | | RSCoin . Core . Crypto specification
module Test.RSCoin.Core.CryptoSpec
( spec
) where
import Test.Hspec (Spec, describe)
import Test.Hspec.QuickCheck (prop)
import RSCoin.Core.Crypto (PublicKey, SecretKey, checkKeyPair,
... | |
e234a63012e0dc3e1e141c344b44a38daecb2d09c0db2f7e67352e5a0f00ae4e | acl2/acl2 | switch-enum.cpp.ref.ast.lsp |
(funcdef foo (a) (block (declare b 0) (switch a (1 (assign b 1)) (2 (assign b 2)) (t (assign b 3))) (return b)))
| null | https://raw.githubusercontent.com/acl2/acl2/c2d69bad0ed3132cc19a00cb632de8b73558b1f9/books/projects/rac/tests/yaml_test/control_flow/switch-enum.cpp.ref.ast.lsp | lisp |
(funcdef foo (a) (block (declare b 0) (switch a (1 (assign b 1)) (2 (assign b 2)) (t (assign b 3))) (return b)))
| |
a0d62f8dafc53f442bf4b17077134164d2baa380cb9e16fe816f9cf939e86aad | mirage/irmin | import.ml |
* Copyright ( c ) 2021 < >
* Copyright ( c ) 2018 - 2022 Tarides < >
*
* Permission to use , copy , modify , and distribute this software for any
* purpose with or without fee is hereby granted , provided that the above
* copyright notice and this permission notice appear in all copies .
*
*... | null | https://raw.githubusercontent.com/mirage/irmin/abeee121a6db7b085b3c68af50ef24a8d8f9ed05/src/irmin-git/import.ml | ocaml |
* Copyright ( c ) 2021 < >
* Copyright ( c ) 2018 - 2022 Tarides < >
*
* Permission to use , copy , modify , and distribute this software for any
* purpose with or without fee is hereby granted , provided that the above
* copyright notice and this permission notice appear in all copies .
*
*... | |
239f5bb858e37925332255140e61e113944eca175c2e91b2307df33de5a93acd | discus-lang/ddc | Config.hs |
module DDC.Core.Check.Config
( Config (..)
, configOfProfile)
where
import DDC.Type.DataDef
import DDC.Type.Env (KindEnv, TypeEnv)
import qualified DDC.Core.Fragment as F
-- Config ---------------------------------------------------------------------
-- | Static configuration... | null | https://raw.githubusercontent.com/discus-lang/ddc/2baa1b4e2d43b6b02135257677671a83cb7384ac/src/s1/ddc-core/DDC/Core/Check/Config.hs | haskell | Config ---------------------------------------------------------------------
| Static configuration for the type checker.
These fields don't change as we decend into the tree.
The starting configuration should be converted from the profile that
defines the language fragment you are checking.
See "DDC.Co... |
module DDC.Core.Check.Config
( Config (..)
, configOfProfile)
where
import DDC.Type.DataDef
import DDC.Type.Env (KindEnv, TypeEnv)
import qualified DDC.Core.Fragment as F
data Config n
= Config
configPrimKinds :: KindEnv n
, configPrim... |
99e49aaec24bdbdf44880c7e057d55c2bb59ce49b70271fa4525ee5f29ff5092 | luxingwen/emqx-mysql | emqx_mysql_cfg.erl | Copyright ( c ) 2013 - 2019 EMQ Technologies Co. , Ltd. All Rights Reserved .
%%
Licensed under the Apache License , Version 2.0 ( the " License " ) ;
you may not use this file except in compliance with the License .
%% You may obtain a copy of the License at
%%
%% -2.0
%%
%% Unless required by app... | null | https://raw.githubusercontent.com/luxingwen/emqx-mysql/14076ccd4746379812bb76721f33649fdc72fe69/src/emqx_mysql_cfg.erl | erlang |
You may obtain a copy of the License at
-2.0
Unless required by applicable law or agreed to in writing, software
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
| Copyright ( c ) 2013 - 2019 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 .
distributed under the License is distributed on an " AS IS " BASIS ,
-module (emqx_mysql... |
bfae2b12f062b7a0a389134526d57f374ee9a45993bf45f3a9a3f5450f8a25aa | dharmatech/agave | ca-spirals.sps | Copyright 2016
;;
Licensed under the Apache License , Version 2.0 ( the " License " ) ;
;; you may not use this file except in compliance with the License.
;; You may obtain a copy of the License at
;;
;; -2.0
;;
;; Unless required by applicable law or agreed to in writing, software
distributed under the Li... | null | https://raw.githubusercontent.com/dharmatech/agave/a8c62ebb1e5328df7725ada49ce36f5ee02a0de4/demos/ca-spirals.sps | scheme |
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
-2.0
Unless required by applicable law or agreed to in writing, software
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing per... | Copyright 2016
distributed under the License is distributed on an " AS IS " BASIS ,
(import (agave demos ca-gen))
(ca-gen (width 100)
(height 100)
(S 2)
(B 2 3 4)
(C 5))
|
de37c31fc31c195536cd8f4d39cf3985cf8c01e53155ce0ece3cd2a18a3738a8 | hasura/graphql-data-specification | Name.hs | module Schema.Model.Type.AggregateFunctionFields.Name
( name,
)
where
import DDL qualified
import Language.GraphQL.Draft.Syntax as GraphQL
import Schema.NamingConvention
name :: DDL.ModelName -> DDL.AggregationFunctionName -> GraphQL.Name
name modelName functionName = mkTypeName $ modelName.wrapped <> "_aggregate... | null | https://raw.githubusercontent.com/hasura/graphql-data-specification/b82b899a7d015c810a571d31322619aff2154b81/tooling/lib/Schema/Model/Type/AggregateFunctionFields/Name.hs | haskell | module Schema.Model.Type.AggregateFunctionFields.Name
( name,
)
where
import DDL qualified
import Language.GraphQL.Draft.Syntax as GraphQL
import Schema.NamingConvention
name :: DDL.ModelName -> DDL.AggregationFunctionName -> GraphQL.Name
name modelName functionName = mkTypeName $ modelName.wrapped <> "_aggregate... | |
03542a18e546ef791f11aab55373f0abe36a631521e9e33a04585a315c9b2bfc | s-expressionists/Concrete-Syntax-Tree | grammar-symbols.lisp | (cl:in-package #:concrete-syntax-tree)
;;; This is the root class of all grammar symbols.
(defclass grammar-symbol ()
())
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;
;;; Parameter groups.
;;;
;;; A parameter group represents a list of parameters of the same kind
;;; and that appear to... | null | https://raw.githubusercontent.com/s-expressionists/Concrete-Syntax-Tree/884a3ebdd288d7d9c24d55b4680086a88cb2dbc6/Lambda-list/grammar-symbols.lisp | lisp | This is the root class of all grammar symbols.
Parameter groups.
A parameter group represents a list of parameters of the same kind
and that appear together in a lambda list.
The root of all classes that represent parameter groups.
Returns true iff the given parameter group accepts a variable
number of argume... | (cl:in-package #:concrete-syntax-tree)
(defclass grammar-symbol ()
())
(defclass parameter-group (grammar-symbol)
())
(defgeneric parameter-group-varargs-p (client parameter-group))
(defclass singleton-parameter-group-mixin ()
((%parameter :initarg :parameter :reader parameter)))
(defmethod print-object ((o... |
91ff11767d80c9d3f7963f22a4bca38297b1ab7bea1659b9931219f13ad71475 | robert-strandh/Second-Climacs | command.lisp | (cl:in-package #:second-climacs-command)
A COMMAND consists of two parts :
;;;
;;; * A FUNCTION that is called to execute some code that may modify
;;; the model or the view. This function can either be called
;;; directly as a normal Common Lisp function, or through the
;;; process of COMMAND INVOCAT... | null | https://raw.githubusercontent.com/robert-strandh/Second-Climacs/1bc87dc3058cbaddce5c51a5ac6140d3975bbb51/Code/Command/command.lisp | lisp |
* A FUNCTION that is called to execute some code that may modify
the model or the view. This function can either be called
directly as a normal Common Lisp function, or through the
process of COMMAND INVOCATION.
function.
according to the types. The function is then called with those
argum... | (cl:in-package #:second-climacs-command)
A COMMAND consists of two parts :
* A list of TYPE NAMES , one for each required parameter of the
When a command is invoked , the arguments are first acquired
In order to keep the two parts of a command together , we define a
class COMMAND to be a subclass of STANDA... |
13c2a0659dc688ee2fe5822af178dfb945595289bbab91a497e8db4875d57ef4 | ocaml-explore/explore | build.ml | open Core
let read_and_build ~build ~check ~dir =
let files = Files.all_files dir in
let filt = List.filter ~f:check files in
let content = List.map ~f:(fun f -> (f, Files.read_file f)) filt in
List.map ~f:build content
let build_page ~file =
let content = Files.read_file file in
Page.v ~path:file ~conten... | null | https://raw.githubusercontent.com/ocaml-explore/explore/117768b378959f18a8d818f37779a750e90f3438/explore/lib/build.ml | ocaml | open Core
let read_and_build ~build ~check ~dir =
let files = Files.all_files dir in
let filt = List.filter ~f:check files in
let content = List.map ~f:(fun f -> (f, Files.read_file f)) filt in
List.map ~f:build content
let build_page ~file =
let content = Files.read_file file in
Page.v ~path:file ~conten... | |
1c52770a48b7a89c77e7afd52fb8a3980eccbbe55e88432570b1736918eaa1c6 | SKA-ScienceDataProcessor/RC | test-read.hs | -- |test-read.hs
--
-- Test file read actor from DNA.
--
Copyright ( C ) 2014 Braam Research
# LANGUAGE TemplateHaskell #
module Main (main) where
import Control.Concurrent
import Control.Concurrent.MVar
import Control.Monad (forM_, forM, when)
import Control.Monad.Trans
import Control.Distributed.Process
import C... | null | https://raw.githubusercontent.com/SKA-ScienceDataProcessor/RC/1b5e25baf9204a9f7ef40ed8ee94a86cc6c674af/MS1/ddp-erlang-style/tests/test-read.hs | haskell | |test-read.hs
Test file read actor from DNA.
| Copyright ( C ) 2014 Braam Research
# LANGUAGE TemplateHaskell #
module Main (main) where
import Control.Concurrent
import Control.Concurrent.MVar
import Control.Monad (forM_, forM, when)
import Control.Monad.Trans
import Control.Distributed.Process
import Control.Distributed.Process.Closure
import Control.Distrib... |
8950e070b02329b88502d27f761d829a3e49e73cfa2d3571c768ac1393415808 | aeternity/aeternity | aec_block_genesis_tests.erl | -module(aec_block_genesis_tests).
-include_lib("eunit/include/eunit.hrl").
-include("blocks.hrl").
-define(TEST_MODULE, aec_block_genesis).
%%%===================================================================
%%% Test cases
%%%===================================================================
genesis_block_test_... | null | https://raw.githubusercontent.com/aeternity/aeternity/b7ce6ae15dab7fa22287c2da3d4405c29bb4edd7/apps/aecore/test/aec_block_genesis_tests.erl | erlang | ===================================================================
Test cases
===================================================================
same accounts shuffled
produced genesis headers are the same
same accounts, one is present twice
produced genesis headers are the same
produced genesis header has expe... | -module(aec_block_genesis_tests).
-include_lib("eunit/include/eunit.hrl").
-include("blocks.hrl").
-define(TEST_MODULE, aec_block_genesis).
genesis_block_test_() ->
{foreach,
fun() ->
meck:new(aec_fork_block_settings, [passthrough]),
ok
end,
fun(ok) ->
meck:unload(aec_f... |
8f186ea49f592230fd22961f040135607a5fd6d71ac901e560f715249086a4a4 | graninas/GraphServer | Constants.hs | module Common.Constants where
import Common.GLTypes
texturesPath = "./Textures"
helloTex = "hello.tga"
hazardStripeTex = "hazard_stripe.tga"
yellowBaseTex = "yellow_base.tga"
arrowTex = "arrow.tga"
equalSignTex = "equal_sign.tga"
rawTextureData :: RawTextures
rawTextureData = [ (helloTex, ... | null | https://raw.githubusercontent.com/graninas/GraphServer/088c234ae840162002f707559cfefc96bcc02bda/src/Common/Constants.hs | haskell | module Common.Constants where
import Common.GLTypes
texturesPath = "./Textures"
helloTex = "hello.tga"
hazardStripeTex = "hazard_stripe.tga"
yellowBaseTex = "yellow_base.tga"
arrowTex = "arrow.tga"
equalSignTex = "equal_sign.tga"
rawTextureData :: RawTextures
rawTextureData = [ (helloTex, ... | |
a2820f69461b50ae0af10ec4e9dba58f71d27b1c7772e606b7ce44eb6a2f5a17 | ocurrent/ocaml-docs-ci | solver.mli | type solve_result = (string * string list) list [@@deriving yojson]
val main : Git_unix.Store.Hash.t -> unit
* [ main hash ] runs a worker process that reads requests from stdin and writes results to stdout ,
using commit [ hash ] in opam - repository .
using commit [hash] in opam-repository. *)
| null | https://raw.githubusercontent.com/ocurrent/ocaml-docs-ci/df08e7aa0e467d106edf1c3d2c58bbedd41ff9b5/src/solver/solver.mli | ocaml | type solve_result = (string * string list) list [@@deriving yojson]
val main : Git_unix.Store.Hash.t -> unit
* [ main hash ] runs a worker process that reads requests from stdin and writes results to stdout ,
using commit [ hash ] in opam - repository .
using commit [hash] in opam-repository. *)
| |
ce3da6b7e7614125e5dfea51026e234233ce6fb173c66bd2e11ed901e8930923 | cdfa/frugel | Action.hs | # LANGUAGE FlexibleContexts #
# LANGUAGE RecordWildCards #
# LANGUAGE ScopedTypeVariables #
# LANGUAGE TupleSections #
# LANGUAGE TypeApplications #
# LANGUAGE TypeFamilies #
module Frugel.Action where
import Control.Lens.Plated
import Control.Zipper.Seq hiding ( insert )
import qualified Control.Zipper.Seq as Seq... | null | https://raw.githubusercontent.com/cdfa/frugel/3d043489e3bf0028b2abe8ec27419daa8716eb5b/src/Frugel/Action.hs | haskell | when the bad default of "exiting" after a node when transformation failed is fixed
backspace model
= case attemptEdit
model of
rest of the current line
\n
end of or same column on the previous line
rest of the current line
\n
end of or same column on the next line
Only count success if it's the o... | # LANGUAGE FlexibleContexts #
# LANGUAGE RecordWildCards #
# LANGUAGE ScopedTypeVariables #
# LANGUAGE TupleSections #
# LANGUAGE TypeApplications #
# LANGUAGE TypeFamilies #
module Frugel.Action where
import Control.Lens.Plated
import Control.Zipper.Seq hiding ( insert )
import qualified Control.Zipper.Seq as Seq... |
5dfc3ebc999417315d21ac789bf9a19665baa77adfc3428b4c0246935f2f16b4 | zinid/delimcc | tests0.ml | (* Testing the serialization of captured delimited continuations *)
(* If the code is given an argument, we load the previously serialized
continuation from the file
*)
open Delimcc
open Printf
let () = prerr_endline "\nInitializing tests0\n"
let save_state_file fname k =
let oc = open_out fname in
let () = ... | null | https://raw.githubusercontent.com/zinid/delimcc/93ffd621051858e9fefdbeffd86a6112063a436a/tests0.ml | ocaml | Testing the serialization of captured delimited continuations
If the code is given an argument, we load the previously serialized
continuation from the file
establish global data
Define the point for relativitization
End of global data
; exit 0 |
open Delimcc
open Printf
let () = prerr_endline "\nInitializing tests0\n"
let save_state_file fname k =
let oc = open_out fname in
let () = output_delim_value oc k in
close_out oc
;;
let load_state_file fname =
let ic = open_in fname in
let v = Marshal.from_channel ic in
let () = close_in ic in
v
;;
... |
b2e3f9b1c3548bb98f560ea569760930af8d96343b1cdc0cdf6a23b60dde355c | avsm/platform | rresult_top_init.ml | ---------------------------------------------------------------------------
Copyright ( c ) 2015 . All rights reserved .
Distributed under the ISC license , see terms at the end of the file .
% % NAME%% % % ---------------------------------------------------------------------------
Copyright (c) ... | null | https://raw.githubusercontent.com/avsm/platform/b254e3c6b60f3c0c09dfdcde92eb1abdc267fa1c/duniverse/rresult.0.6.0%2Bdune/src/rresult_top_init.ml | ocaml | ---------------------------------------------------------------------------
Copyright ( c ) 2015 . All rights reserved .
Distributed under the ISC license , see terms at the end of the file .
% % NAME%% % % ---------------------------------------------------------------------------
Copyright (c) ... | |
37ada9ce8d8bdae3c186727afa39a6602b0e61c76373c11d42caa612ca972d7b | facundoolano/house-taken-over | catalog.cljc | (ns house.puzzles.catalog
(:require [clojure.string :as string]
[advenjure.items :as item]
[advenjure.utils :as utils]
[advenjure.ui.request :refer [request]]
[advenjure.ui.input :refer [prompt-value]]
#?(:clj [advenjure.async :refer [alet]]))
#?(:cljs (:r... | null | https://raw.githubusercontent.com/facundoolano/house-taken-over/8ae7fa21b7e16cf2d0b15e30fb9c2c721aa6850b/src/house/puzzles/catalog.cljc | clojure | (ns house.puzzles.catalog
(:require [clojure.string :as string]
[advenjure.items :as item]
[advenjure.utils :as utils]
[advenjure.ui.request :refer [request]]
[advenjure.ui.input :refer [prompt-value]]
#?(:clj [advenjure.async :refer [alet]]))
#?(:cljs (:r... | |
08ac8ad0d80c154c37b2ddcc999c93f3e65bee2c740ff6e68f517d19f9266796 | BrewLLM/bosquet | wedding_guest_example.clj | ^{:nextjournal.clerk/visibility {:code :hide}}
(ns wedding-guest-example
(:require
[bosquet.generator :as gen]
[nextjournal.clerk :as clerk]))
;; # Generating thank you letters
;;
;; There was a wedding with lots of guests. They traveled far and wide to attend it, brough gifts and all.
;;
;; We want to generat... | null | https://raw.githubusercontent.com/BrewLLM/bosquet/8576c43d81208b0cc3c9e2e781b3891c07c17e48/notebook/wedding_guest_example.clj | clojure | # Generating thank you letters
There was a wedding with lots of guests. They traveled far and wide to attend it, brough gifts and all.
We want to generate thank you letters for each guest. The letters should be personalized and note how
far they traveled, and how great is their gift. Letters ought to be written i... | ^{:nextjournal.clerk/visibility {:code :hide}}
(ns wedding-guest-example
(:require
[bosquet.generator :as gen]
[nextjournal.clerk :as clerk]))
There were 178 guests in total , hence the need for automation . This sample shows typical types of guests '
^{::clerk/visibility {:code :fold}}
(def guests
[{:nam... |
f3dc3a81cb092dc4fab27300be3336f89652a1d989c8dd6b547750957cb5c1d5 | music-suite/music-score | Lilypond.hs |
-------------------------------------------------------------------------------------
-- |
Copyright : ( c ) 2012 - 2014
--
-- License : BSD-style
--
Maintainer :
-- Stability : experimental
Portability : non - portable ( TF , )
--
Provides Lilypond import .
--
-- /Warning/ Experimental module.
... | null | https://raw.githubusercontent.com/music-suite/music-score/aa7182d8ded25c03a56b83941fc625123a7931f8/src/Music/Score/Import/Lilypond.hs | haskell | -----------------------------------------------------------------------------------
|
License : BSD-style
Stability : experimental
/Warning/ Experimental module.
----------------------------------------------------------------------------------- |
Copyright : ( c ) 2012 - 2014
Maintainer :
Portability : non - portable ( TF , )
Provides Lilypond import .
module Music.Score.Import.Lilypond where
|
e595858fc14198d6de87abfb93ff8b5637c1b691bd1d18ce0f40db6f6fc61c1e | system-f/fp-course | Parser.hs | # LANGUAGE NoImplicitPrelude #
# LANGUAGE ScopedTypeVariables #
# LANGUAGE InstanceSigs #
{-# LANGUAGE OverloadedStrings #-}
# LANGUAGE RebindableSyntax #
module Course.Parser where
import Course.Core
import Course.Person
import Course.Functor
import Course.Applicative
import Course.Monad
import Course.List
import Co... | null | https://raw.githubusercontent.com/system-f/fp-course/d61b0a9798d4fa1c20926d943f57374626844871/src/Course/Parser.hs | haskell | # LANGUAGE OverloadedStrings #
$setup
>>> :set -XOverloadedStrings
>>> import Data.Char(isUpper)
Function to determine whether this @ParseResult@ is an error.
| Runs the given function on a successful parse result. Otherwise return the same failing parse result.
- | Return a parser that always returns the given pa... | # LANGUAGE NoImplicitPrelude #
# LANGUAGE ScopedTypeVariables #
# LANGUAGE InstanceSigs #
# LANGUAGE RebindableSyntax #
module Course.Parser where
import Course.Core
import Course.Person
import Course.Functor
import Course.Applicative
import Course.Monad
import Course.List
import Course.Optional
import Data.Char
ty... |
2e0c3b4c4dd017bd337cbf663f6ae9f884d9327acda00c287317f8a29fdf248f | codedownio/sandwich | Class.hs |
module Test.Sandwich.WebDriver.Class (
* The main WebDriver type
WebDriver
, getWdOptions
, getDisplayNumber
, getXvfbSession
, getWebDriverName
* The session
, XvfbSession(..)
) where
import Test.Sandwich.WebDriver.Internal.Types
| null | https://raw.githubusercontent.com/codedownio/sandwich/0e158153eef11eab3e56b5e3806d1fd25ea47f89/sandwich-webdriver/src/Test/Sandwich/WebDriver/Class.hs | haskell |
module Test.Sandwich.WebDriver.Class (
* The main WebDriver type
WebDriver
, getWdOptions
, getDisplayNumber
, getXvfbSession
, getWebDriverName
* The session
, XvfbSession(..)
) where
import Test.Sandwich.WebDriver.Internal.Types
| |
339fee4a765aba68ce9a61620564c64bdcf54deb01fc47fe54346416e3b419ec | spechub/Hets | ReasoningParameters.hs | # LANGUAGE DeriveGeneric #
module PGIP.ReasoningParameters where
import PGIP.Shared (ProverMode)
import Logic.Comorphism (AnyComorphism)
import Logic.Grothendieck (G_sublogics)
import Proofs.AbstractState (ProverOrConsChecker)
import Static.DevGraph (DGNodeLab)
import Static.GTheory (G_theory)
import qualified Persi... | null | https://raw.githubusercontent.com/spechub/Hets/af7b628a75aab0d510b8ae7f067a5c9bc48d0f9e/PGIP/ReasoningParameters.hs | haskell | required on "prove", must be omitted on "consistency-check"
ignored on "consistency-check"
ignored on "consistency-check"
"Nothing" iff doing consistency-checking
made "Just" in the setupReasoning step if a database is used
made "Just" in the preprocessReasoning step if a database is used | # LANGUAGE DeriveGeneric #
module PGIP.ReasoningParameters where
import PGIP.Shared (ProverMode)
import Logic.Comorphism (AnyComorphism)
import Logic.Grothendieck (G_sublogics)
import Proofs.AbstractState (ProverOrConsChecker)
import Static.DevGraph (DGNodeLab)
import Static.GTheory (G_theory)
import qualified Persi... |
4580a8e95f4e3d3f26e7d7c19461151d5392108f27b474eee8d520e4b4626510 | Cnly/clj-latex | dptab.clj | (ns dptab
(:require [clojure.core.matrix :as m]
[clj-latex.core :as l]))
(println
(l/render-latex
(:documentclass 'article)
(:usepackage 'tikz)
(:usepackage 'amsmath)
(:newcommand :rn [2]
(list
(:tikz ["remember picture", "baseline=(#1.base)"])
... | null | https://raw.githubusercontent.com/Cnly/clj-latex/800f11ffcc1861eb4ae64e455ab9a863cb082975/examples/dptab.clj | clojure | (ns dptab
(:require [clojure.core.matrix :as m]
[clj-latex.core :as l]))
(println
(l/render-latex
(:documentclass 'article)
(:usepackage 'tikz)
(:usepackage 'amsmath)
(:newcommand :rn [2]
(list
(:tikz ["remember picture", "baseline=(#1.base)"])
... | |
5b76be09b64ebe96f12e9bd0ed391c71421d25c02a98bb8bf745643c8d823dd0 | apache/dubbo-erlang | dubbo_traffic_control_tests.erl | %%------------------------------------------------------------------------------
Licensed to the Apache Software Foundation ( ASF ) under one or more
%% contributor license agreements. See the NOTICE file distributed with
%% this work for additional information regarding copyright ownership.
The ASF licenses this ... | null | https://raw.githubusercontent.com/apache/dubbo-erlang/24e0c1a9028b50d2e9e05e3fe26f4e3335384acc/test/dubbo_traffic_control_tests.erl | erlang | ------------------------------------------------------------------------------
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
-2.0
Unless required by applicable law or agreed to in writing, software
WITHOUT WARRANTIES ... | Licensed to the Apache Software Foundation ( ASF ) under one or more
The ASF licenses this file 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 License at
distributed under the License is distr... |
4315573f313cce00a51d55a4b55ca75264c9ffae31f33a578255f4fc6b7baa1e | MyPost/cassius | mutate_in.clj | (ns cassius.api.connection.mutate-in
(:require [cassius.net.command.keyspace :as ksp]
[cassius.net.command.column-family :as cf]
[cassius.net.command.delete :refer [delete-column-mutation
delete-sub-column-mutation]]
[cassius.net.comm... | null | https://raw.githubusercontent.com/MyPost/cassius/7b5f550fa8e8f825d4ecd7ba6a0d34c5ff606a7c/src/cassius/api/connection/mutate_in.clj | clojure |
Mutation mut = new Mutation();
mut.setColumn_or_supercolumn(new ColumnOrSuperColumn().setColumn(col_to_add));
insertion_list.add(mut);
columnFamilyValues.put("columnFamily",insertion_list);
rowDefinition.put(ByteBuffer.wrap(("key").getBytes("UTF8")), columnFamilyValues);
col_to_add -> col_or_super_col -... | (ns cassius.api.connection.mutate-in
(:require [cassius.net.command.keyspace :as ksp]
[cassius.net.command.column-family :as cf]
[cassius.net.command.delete :refer [delete-column-mutation
delete-sub-column-mutation]]
[cassius.net.comm... |
127a4c5386aeab63444dc32e7c26f5d022acc35e7f34e6b016a58ccb62c8886f | fpottier/mpri-2.4-projet-2022-2023 | Env.ml | include Map.Make(String)
type 'a env =
'a t
let lookup env x =
find x env
let bind env x v =
add x v env
let remove env x =
remove x env
let bind_many env xs vs =
List.fold_left2 bind env xs vs
exception Collision of string
let bind_new env x v =
match lookup env x with
| exception Not_found ->
... | null | https://raw.githubusercontent.com/fpottier/mpri-2.4-projet-2022-2023/1ce08cadfb3a8ec8bc72609bc82873b29d2ce241/src/Env.ml | ocaml | include Map.Make(String)
type 'a env =
'a t
let lookup env x =
find x env
let bind env x v =
add x v env
let remove env x =
remove x env
let bind_many env xs vs =
List.fold_left2 bind env xs vs
exception Collision of string
let bind_new env x v =
match lookup env x with
| exception Not_found ->
... | |
385c7712b1a6cfd191a1a8476f14c7e442cfe750e4561e86b244df33495fe962 | peti/funcmp | Symbols.hs | |
Module : FMP.Symbols
Copyright : ( c ) 2003 - 2010 ( c ) 2002 - 2003 ( c ) 2002 - 2003 Meik Hellmund
( c ) 1998 - 2002 ( c ) 1998 - 2002 Joachim Korittky
( c ) 1998 - 2002
License :
Maintainer :
Stability : pr... | null | https://raw.githubusercontent.com/peti/funcmp/1f6713a273b57b8b60b19958420748daf65d35af/FMP/Symbols.hs | haskell | -------------------
------------------- | |
Module : FMP.Symbols
Copyright : ( c ) 2003 - 2010 ( c ) 2002 - 2003 ( c ) 2002 - 2003 Meik Hellmund
( c ) 1998 - 2002 ( c ) 1998 - 2002 Joachim Korittky
( c ) 1998 - 2002
License :
Maintainer :
Stability : pr... |
8c1c32d7f4d6ffa878a0acf495173fb6546a485fa685b55537fccb812e6a0a1b | isovector/algebra-checkers | Theorems.hs | {-# LANGUAGE TemplateHaskellQuotes #-}
# LANGUAGE TupleSections #
# LANGUAGE ViewPatterns #
module AlgebraCheckers.Theorems where
import Data.Either
import Control.Monad
import Data.Bool
import Data.Char
import Data.Function (on)
import Data.Generics.Schemes (listify)
import Data.List (nub, (\\))
i... | null | https://raw.githubusercontent.com/isovector/algebra-checkers/40ed33d23ff36a78cef133d02cd9e44e4f7101f9/src/AlgebraCheckers/Theorems.hs | haskell | # LANGUAGE TemplateHaskellQuotes # | # LANGUAGE TupleSections #
# LANGUAGE ViewPatterns #
module AlgebraCheckers.Theorems where
import Data.Either
import Control.Monad
import Data.Bool
import Data.Char
import Data.Function (on)
import Data.Generics.Schemes (listify)
import Data.List (nub, (\\))
import Data.Maybe (isNothing, fromMaybe,... |
edd3277acaaf9f4c9dfc0b9d3733d35f4984f3a3b2aac6ce49a2558b645666e0 | vincenthz/hs-gauge | Time.hs | # LANGUAGE GeneralizedNewtypeDeriving #
{-# LANGUAGE DeriveDataTypeable #-}
# LANGUAGE DeriveGeneric #
module Gauge.Time
( MicroSeconds(..)
, MilliSeconds(..)
, NanoSeconds(..)
, PicoSeconds100(..)
-- * Convertion functions
, microSecondsToDouble
, milliSecondsToDouble
, nanoSecondsToDou... | null | https://raw.githubusercontent.com/vincenthz/hs-gauge/496a8b99e7fee3039fd89ecef7305d31eb5d5a6d/Gauge/Time.hs | haskell | # LANGUAGE DeriveDataTypeable #
* Convertion functions
| Represent a number of milliseconds.
| Represent a number of microseconds
| Represent a number of nanoseconds | # LANGUAGE GeneralizedNewtypeDeriving #
# LANGUAGE DeriveGeneric #
module Gauge.Time
( MicroSeconds(..)
, MilliSeconds(..)
, NanoSeconds(..)
, PicoSeconds100(..)
, microSecondsToDouble
, milliSecondsToDouble
, nanoSecondsToDouble
, picosecondsToNanoSeconds
, doubleToNanoSeconds
,... |
31458626cdd0e9a263452a60a68e9e37d05055a90f2558e4ce00f1f748108c2a | Elzair/nazghul | char-ready.scm | (load "naz.scm")
(kern-load "game.scm")
(load "tests/basic-time.scm")
(load "tests/test-map-1.scm")
(kern-mk-place 'p_test
"Test Place"
nil ; sprite
m_test_1
#f ;; wraps
#f ;; underground
#f ;; wilderness
... | null | https://raw.githubusercontent.com/Elzair/nazghul/8f3a45ed6289cd9f469c4ff618d39366f2fbc1d8/worlds/haxima-1.001/tests/char-ready.scm | scheme | sprite
wraps
underground
wilderness
tmp combat place
subplaces
neighbors
objects:
tag
name
species
occ
sprite
starting alignment
hp mod/mult
mp mod/mult
hp/xp/mp/lvl
conv
sched
special ai
readied
tag
name
species
occ
sprite
starting alignment
hp mod/mult
mp mod/mult
hp/xp/mp/lvl
conv
sch... | (load "naz.scm")
(kern-load "game.scm")
(load "tests/basic-time.scm")
(load "tests/test-map-1.scm")
(kern-mk-place 'p_test
"Test Place"
m_test_1
(list
(list (kern-tag 'portcullis-1 (mk-portcullis)) 5 12)
(list (mk-lever 'portcullis-1) 6 11)
... |
1b9b8f49d286c6788e260b42f900d21694b022bb84226e78581d57a7f972758f | blueberry/doing-bayesian-data-analysis-gpu-opencl | multiple_linear_regression.clj | 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) or later
;; which can be found in the file LICENSE at the root of this distribution.
;; By using this software in any fashion, you are agreeing to be boun... | null | https://raw.githubusercontent.com/blueberry/doing-bayesian-data-analysis-gpu-opencl/1b914aa6839a3517c5850ad53c7c972c304de0a9/src/dbda/ch18/multiple_linear_regression.clj | clojure | The use and distribution terms for this software are covered by the
Eclipse Public License 1.0 (-1.0.php) or later
which can be found in the file LICENSE 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 rem... | Copyright ( c ) . All rights reserved .
(ns ^{:author "Dragan Djuric"}
dbda.ch18.multiple-linear-regression
(:require [quil.core :as q]
[quil.applet :as qa]
[quil.middlewares.pause-on-error :refer [pause-on-error]]
[uncomplicate.commons.core :refer [with-release let-rele... |
ad44403a46d58970bcbb1d5edcc2231621f953b513eee3306086e47910093d84 | GaloisInc/what4 | Concrete.hs | -----------------------------------------------------------------------
-- |
-- Module : What4.Concrete
-- Description : Concrete values of base types
Copyright : ( c ) Galois , Inc 2018 - 2020
-- License : BSD3
Maintainer : < >
-- Stability : provisional
--
-- This ... | null | https://raw.githubusercontent.com/GaloisInc/what4/26a47b8e11031ff94b59b2d075086aef592a87d5/what4/src/What4/Concrete.hs | haskell | ---------------------------------------------------------------------
|
Module : What4.Concrete
Description : Concrete values of base types
License : BSD3
Stability : provisional
This module defines a representation of concrete values of base
types. These are values in fully-eval... | Copyright : ( c ) Galois , Inc 2018 - 2020
Maintainer : < >
# LANGUAGE DataKinds #
# LANGUAGE FlexibleContexts #
# LANGUAGE FlexibleInstances #
# LANGUAGE LambdaCase #
# LANGUAGE MultiParamTypeClasses #
# LANGUAGE PatternGuards #
# LANGUAGE PolyKinds #
# LANGUAGE ScopedTypeVariables #
# LANGUAGE ... |
ddff8186a129e24a1781649b5cc081191183fe3df9d4b1008ae95dc926b8448d | facebook/flow | lsCommand.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/b918b06104ac1489b516988707431d98833ce99f/src/commands/lsCommand.ml | ocaml | *********************************************************************
flow ls (list files) command
*********************************************************************
This is a lib file
Directories will return a closure that returns every file under that
directory. Individual files will return a closure that ... |
* 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... |
d063075c5dd08dc91d17f242ec98c44a31ff7df4a4f092e7bbcebb9f1e28f14a | jepsen-io/jepsen | client.clj | (ns jepsen.cockroach.client
"For talking to cockroachdb over the network"
(:require [clojure.tools.logging :refer :all]
[clojure.java.jdbc :as j]
[clojure.string :as str]
[clojure.pprint :refer [pprint]]
[jepsen [util :as util :refer [meh]]
[reconn... | null | https://raw.githubusercontent.com/jepsen-io/jepsen/a75d5a50dd5fa8d639a622c124bf61253460b754/cockroachdb/src/jepsen/cockroach/client.clj | clojure | for secure mode
Postgres user and dbname for jdbc-mode = :pg-*
must already exist
must already exist
must already exist
Wrap underlying exception error with [:batch ...] | (ns jepsen.cockroach.client
"For talking to cockroachdb over the network"
(:require [clojure.tools.logging :refer :all]
[clojure.java.jdbc :as j]
[clojure.string :as str]
[clojure.pprint :refer [pprint]]
[jepsen [util :as util :refer [meh]]
[reconn... |
61768acf128e0b4b7705f9109ceb83185cf363f2a8fcbc28a2883baeab395470 | faylang/fay | mutableReference.hs | {-# LANGUAGE EmptyDataDecls #-}
module MutableReference where
import FFI
main :: Fay ()
main = do
ref <- newRef "Hello, World!"
x <- readRef ref
writeRef ref "Hai!"
readRef ref >>= putStrLn
data Ref a
instance Show (Ref a)
newRef :: a -> Fay (Ref a)
newRef = ffi "new Fay$$Ref(%1)"
writeRef :: Ref... | null | https://raw.githubusercontent.com/faylang/fay/8455d975f9f0db2ecc922410e43e484fbd134699/tests/mutableReference.hs | haskell | # LANGUAGE EmptyDataDecls # | module MutableReference where
import FFI
main :: Fay ()
main = do
ref <- newRef "Hello, World!"
x <- readRef ref
writeRef ref "Hai!"
readRef ref >>= putStrLn
data Ref a
instance Show (Ref a)
newRef :: a -> Fay (Ref a)
newRef = ffi "new Fay$$Ref(%1)"
writeRef :: Ref a -> a -> Fay ()
writeRef = ffi... |
efa9bedc310a5ba9f12832e90d7993077d007415784e0a80df09cf3aa442dd05 | LennMars/algorithms_in_OCaml | test.ml | open Util
let points1 = [(0., 3.);(-3., 2.);(-1., 1.);(2., 1.);(-4., 0.);(0., 0.);(3., -1.);(-2., -2.);(1., -2.)]
let convex1 = Main.convex_hull points1
| null | https://raw.githubusercontent.com/LennMars/algorithms_in_OCaml/f7fb8ca9f497883d86be3167bfc98a4a28ac73c9/geometry/test.ml | ocaml | open Util
let points1 = [(0., 3.);(-3., 2.);(-1., 1.);(2., 1.);(-4., 0.);(0., 0.);(3., -1.);(-2., -2.);(1., -2.)]
let convex1 = Main.convex_hull points1
| |
d8f65d8a688d6f9031e3ff902b99329cd83c513a5cd154e6d0b80cae5f6ba02a | slipstream/SlipStreamServer | exception_handler.clj | (ns com.sixsq.slipstream.ssclj.middleware.exception-handler
(:require
[clj-stacktrace.repl :as st]
[clojure.tools.logging :as log]
[ring.util.response :as r]))
(defn treat-unexpected-exception
[e]
(let [msg (str "Unexpected exception thrown: " (.getMessage e))
body {:status 500 :message msg}
... | null | https://raw.githubusercontent.com/slipstream/SlipStreamServer/3ee5c516877699746c61c48fc72779fe3d4e4652/cimi/src/com/sixsq/slipstream/ssclj/middleware/exception_handler.clj | clojure | (ns com.sixsq.slipstream.ssclj.middleware.exception-handler
(:require
[clj-stacktrace.repl :as st]
[clojure.tools.logging :as log]
[ring.util.response :as r]))
(defn treat-unexpected-exception
[e]
(let [msg (str "Unexpected exception thrown: " (.getMessage e))
body {:status 500 :message msg}
... | |
f4bddcc1567b9bee99c5d1372689db963bfaff7cc6d70c269e6cf16c9620a2d7 | adam-james-v/svg-clj | algorithms.cljc | (ns svg-clj.algorithms
(:require [clojure.set :as set]
[svg-clj.utils :as u]))
;; todo: check if we need this fn here.
(def pow
"Raise the first number to the power of the second number."
#?(:clj #(Math/pow %1 %2) :cljs js/Math.pow))
;;
(defn- circumscribe-tri
[[[ax ay] [bx by] [cx cy]]]
(let [... | null | https://raw.githubusercontent.com/adam-james-v/svg-clj/d6c49a254480ce5f4c9ccc382ca71ac53979edb0/src/svg_clj/algorithms.cljc | clojure | todo: check if we need this fn here.
/
todo: Test this a bunch, see if I can get it to work with any arbitrary set of pts.
todo: see where it fails (eg. concave pt sets?) and fix
*should* always end where the last added point closes the poly | (ns svg-clj.algorithms
(:require [clojure.set :as set]
[svg-clj.utils :as u]))
(def pow
"Raise the first number to the power of the second number."
#?(:clj #(Math/pow %1 %2) :cljs js/Math.pow))
(defn- circumscribe-tri
[[[ax ay] [bx by] [cx cy]]]
(let [A (- bx ax)
B (- by ay)
C (-... |
3299395f3ece98f539c1757d5189cb71ded4f0c579ecf11de921d767d9c41ecb | acieroid/scala-am | browse.scm | BROWSE -- Benchmark to create and browse through
;;; an AI-like data base of units.
(define (lookup key table)
(let loop ((x table))
(if (null? x)
#f
(let ((pair (car x)))
(if (eq? (car pair) key)
pair
(loop (cdr x)))))))
(define properties '())
(define (... | null | https://raw.githubusercontent.com/acieroid/scala-am/13ef3befbfc664b77f31f56847c30d60f4ee7dfe/test/R5RS/gabriel/browse.scm | scheme | an AI-like data base of units.
n is # of symbols
m is maximum amount of stuff on the plist
npats is the number of basic patterns on the unit
this changes the run time quite a bit | BROWSE -- Benchmark to create and browse through
(define (lookup key table)
(let loop ((x table))
(if (null? x)
#f
(let ((pair (car x)))
(if (eq? (car pair) key)
pair
(loop (cdr x)))))))
(define properties '())
(define (get key1 key2)
(let ((x (lookup k... |
e82e06303a118349cdda0f3eb67d14c5f4805bad7344541de0afb39879ec23dd | clojureverse/clojurians-log-app | schema.clj | (ns clojurians-log.db.schema)
(def message-schema
[{:db/ident :message/key
:db/cardinality :db.cardinality/one
:db/valueType :db.type/string
:db/unique :db.unique/identity
:db/doc "Key consisting of channel id + ts. Useful for upserts and refs."}
{:db/ident :message/text... | null | https://raw.githubusercontent.com/clojureverse/clojurians-log-app/d34c9bd715e492c8f1899653548716d32c623fad/src/clojurians_log/db/schema.clj | clojure | (ns clojurians-log.db.schema)
(def message-schema
[{:db/ident :message/key
:db/cardinality :db.cardinality/one
:db/valueType :db.type/string
:db/unique :db.unique/identity
:db/doc "Key consisting of channel id + ts. Useful for upserts and refs."}
{:db/ident :message/text... | |
83d5e1ac722d49ef9c817e064ec1c4c421811f820c344f5ae474c89f5b513ab3 | jacekschae/learn-reitit-course-files | server.clj | (ns cheffy.server
(:require [reitit.ring :as ring]
[ring.adapter.jetty :as jetty]
[integrant.core :as ig]
[environ.core :refer [env]]
[cheffy.router :as router]
[next.jdbc :as jdbc]))
(defn app
[env]
(router/routes env))
(defmethod ig/prep-key :server/... | null | https://raw.githubusercontent.com/jacekschae/learn-reitit-course-files/c13a8eb622a371ad719d3d9023f1b4eff9392e4c/increments/51-list-conversations-alternative/src/cheffy/server.clj | clojure | (ns cheffy.server
(:require [reitit.ring :as ring]
[ring.adapter.jetty :as jetty]
[integrant.core :as ig]
[environ.core :refer [env]]
[cheffy.router :as router]
[next.jdbc :as jdbc]))
(defn app
[env]
(router/routes env))
(defmethod ig/prep-key :server/... | |
93bc01cf318b267d9f8580fb2627031fa3c0eed348d46661ab77080623144e15 | pdarragh/parsing-with-zippers-paper-artifact | pwz_plug.ml | open Pwz_abstract_types
open Pwz_types
let plug (p : pos) (zs : zipper list) : exp list =
let rec pl (e' : exp') (m : mem) : exp list =
let e = { m = m_bottom; e' = e' } in
m.end_pos <- p;
m.result <- e;
List.concat (List.map (pl' e) m.parents)
and pl' (e : exp) (c : cxt) : exp list =
match c ... | null | https://raw.githubusercontent.com/pdarragh/parsing-with-zippers-paper-artifact/c5c08306cfe4eec588237c7fa45b794649ccb68a/appendix/pwz_plug.ml | ocaml | open Pwz_abstract_types
open Pwz_types
let plug (p : pos) (zs : zipper list) : exp list =
let rec pl (e' : exp') (m : mem) : exp list =
let e = { m = m_bottom; e' = e' } in
m.end_pos <- p;
m.result <- e;
List.concat (List.map (pl' e) m.parents)
and pl' (e : exp) (c : cxt) : exp list =
match c ... | |
870cf9b6ad1cd3b63b73239c4768002d38efcf828299ae6bc02ec7c9c77b1553 | samply/blaze | resource_handle_spec.clj | (ns blaze.db.impl.index.resource-handle-spec
(:require
[blaze.byte-buffer :refer [byte-buffer?]]
[blaze.db.impl.codec-spec]
[blaze.db.impl.index.resource-handle :as rh]
[blaze.db.kv-spec]
[blaze.db.resource-store.spec]
[blaze.db.spec]
[blaze.fhir.spec]
[clojure.spec.alpha :as s]))
(s... | null | https://raw.githubusercontent.com/samply/blaze/6ef8eff7687513554131819d080fed9aaf531a34/modules/db/test/blaze/db/impl/index/resource_handle_spec.clj | clojure | (ns blaze.db.impl.index.resource-handle-spec
(:require
[blaze.byte-buffer :refer [byte-buffer?]]
[blaze.db.impl.codec-spec]
[blaze.db.impl.index.resource-handle :as rh]
[blaze.db.kv-spec]
[blaze.db.resource-store.spec]
[blaze.db.spec]
[blaze.fhir.spec]
[clojure.spec.alpha :as s]))
(s... | |
b78ae61d6e1328fca9f7020cdc9da226fdf1b060d0e3b9b4f6ba4189bfd33aba | input-output-hk/project-icarus-importer | Addresses.hs | module Cardano.Wallet.API.V1.Addresses where
import Servant
import Universum (Text)
import Cardano.Wallet.API.Response
import Cardano.Wallet.API.Types
import Cardano.Wallet.API.V1.Parameters
import Cardano.Wallet.API.V1.Types
type API = Tags '["Addresses"]... | null | https://raw.githubusercontent.com/input-output-hk/project-icarus-importer/36342f277bcb7f1902e677a02d1ce93e4cf224f0/wallet-new/src/Cardano/Wallet/API/V1/Addresses.hs | haskell | module Cardano.Wallet.API.V1.Addresses where
import Servant
import Universum (Text)
import Cardano.Wallet.API.Response
import Cardano.Wallet.API.Types
import Cardano.Wallet.API.V1.Parameters
import Cardano.Wallet.API.V1.Types
type API = Tags '["Addresses"]... | |
76bcf2f51d6db95b8a505af734b59d04a349e0548b9e02c27f96b6da575e7b14 | haskell-mafia/projector | Pretty.hs | # LANGUAGE NoImplicitPrelude #
# LANGUAGE OverloadedLists #
{-# LANGUAGE OverloadedStrings #-}
module Projector.Html.Pretty (
uglyPrintTemplate
, templateTokens
) where
import Data.DList (DList)
import qualified Data.DList as D
import qualified Data.List as L
import Data.List.NonEmpty (No... | null | https://raw.githubusercontent.com/haskell-mafia/projector/6af7c7f1e8a428b14c2c5a508f7d4a3ac2decd52/projector-html/src/Projector/Html/Pretty.hs | haskell | # LANGUAGE OverloadedStrings #
-----------------------------------------------------------------------------
Template to tokens | # LANGUAGE NoImplicitPrelude #
# LANGUAGE OverloadedLists #
module Projector.Html.Pretty (
uglyPrintTemplate
, templateTokens
) where
import Data.DList (DList)
import qualified Data.DList as D
import qualified Data.List as L
import Data.List.NonEmpty (NonEmpty(..))
import qualified Data.L... |
c4cf1d13dcdf8f93d31aacb4e738864c3d267b7cb482fc039157db81d4e97d03 | macchiato-framework/examples | app.cljs | (ns catfacts.app
(:require
[doo.runner :refer-macros [doo-tests]]
[catfacts.core-test]))
(doo-tests 'catfacts.core-test)
| null | https://raw.githubusercontent.com/macchiato-framework/examples/946bdf1a04f5ef787fc83affdcbf6603bbf29b5c/catfacts/env/test/catfacts/app.cljs | clojure | (ns catfacts.app
(:require
[doo.runner :refer-macros [doo-tests]]
[catfacts.core-test]))
(doo-tests 'catfacts.core-test)
| |
b7b5002ba8735dfebbcec7f71d994316ba1f208822724127cbaea21d267e6cd0 | ekmett/haskell | Occurrence.hs | {-# Language CPP #-}
{-# Language ImportQualifiedPost #-}
{-# Language RankNTypes #-}
{-# Language LambdaCase #-}
{-# Language ScopedTypeVariables #-}
-- |
Copyright : ( c ) 2020 , 2020
License : BSD-2 - Clause OR Apache-2.0
Maintainer : < >
-- Stability : experimental
-- Portability: non-portab... | null | https://raw.githubusercontent.com/ekmett/haskell/37ad048531f5a3a13c6dfbf4772ee4325f0e4458/ulf/src/Elaborate/Occurrence.hs | haskell | # Language CPP #
# Language ImportQualifiedPost #
# Language RankNTypes #
# Language LambdaCase #
# Language ScopedTypeVariables #
|
Stability : experimental
Portability: non-portable
^ All occurrences are inside spines of metas. We store the set of such metas.
^ The variable does not occur.
| Occurs check for t... |
Copyright : ( c ) 2020 , 2020
License : BSD-2 - Clause OR Apache-2.0
Maintainer : < >
module Elaborate.Occurrence
( Occurs(..)
, occurs
, occurrence
) where
import Control.Applicative (liftA2)
import Data.HashSet qualified as HS
import Elaborate.Evaluation
import Elaborate.Value
data... |
fa7ccd490d4ed5c2669daad771acb61da0aff2a0be2ddb6f230ef57f5c9da6ef | genenetwork/guix-bioinformatics | afnumpy.scm | ;;; GNU Guix --- Functional package management for GNU
Copyright © 2016 < >
;;;
;;; This file is part of GNU Guix.
;;;
GNU 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 Lice... | null | https://raw.githubusercontent.com/genenetwork/guix-bioinformatics/9e1e668e4f9f9e2b595620fda831da0525db4095/gn/packages/afnumpy.scm | scheme | GNU Guix --- Functional package management for GNU
This file is part of GNU Guix.
you can redistribute it and/or modify it
either version 3 of the License , or ( at
your option) any later version.
GNU Guix is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied wa... | Copyright © 2016 < >
under the terms of the GNU General Public License as published by
You should have received a copy of the GNU General Public License
along with GNU . If not , see < / > .
(define-module (gn packages afnumpy)
#:use-module ((guix licenses) #:prefix license:)
#:use-module (guix packa... |
49e5ef5935437439b6b356df896c793eab87f4b43e6ba5b798c5ae5d9fb8c45a | kadena-io/pact | PactTestsSpec.hs | {-# LANGUAGE OverloadedStrings #-}
# LANGUAGE RecordWildCards #
module PactTestsSpec (spec) where
import Test.Hspec
import Control.Concurrent
import Control.Monad.State.Strict
import Data.Either (isLeft, isRight)
import Data.List
import qualified Data.HashMap.Strict as HM
import qualified Data.Map.Strict as M
import... | null | https://raw.githubusercontent.com/kadena-io/pact/603f1523162c95742fb3e040ac065ff82f2b2aea/tests/PactTestsSpec.hs | haskell | # LANGUAGE OverloadedStrings #
| Pair file path with snippet of error string
ghci utility to load a string and get the refmap
-------------------------------------------------------------------------- --
Production Parser Tests | # LANGUAGE RecordWildCards #
module PactTestsSpec (spec) where
import Test.Hspec
import Control.Concurrent
import Control.Monad.State.Strict
import Data.Either (isLeft, isRight)
import Data.List
import qualified Data.HashMap.Strict as HM
import qualified Data.Map.Strict as M
import Data.Maybe
import Data.Text (unpac... |
f8558f4bd406facce972fbc665b9a71fa3f1b228e4701f6396f1a812973dad68 | aws-beam/aws-erlang | aws_securitylake.erl | %% WARNING: DO NOT EDIT, AUTO-GENERATED CODE!
See -beam/aws-codegen for more details .
%% @doc Amazon Security Lake is in preview release.
%%
Your use of the Security Lake preview is subject to Section 2 of the
Amazon Web Services Service Terms("Betas and Previews" ;) .
%%
%% Amazon Security Lake is a f... | null | https://raw.githubusercontent.com/aws-beam/aws-erlang/699287cee7dfc9dc8c08ced5f090dcc192c9cba8/src/aws_securitylake.erl | erlang | WARNING: DO NOT EDIT, AUTO-GENERATED CODE!
@doc Amazon Security Lake is in preview release.
Amazon Security Lake is a fully managed security data lake service. You
cloud, on-premises, and custom sources into a data lake that's stored
manage. With Organizations, you can create member accounts and invite
existing... | See -beam/aws-codegen for more details .
Your use of the Security Lake preview is subject to Section 2 of the
Amazon Web Services Service Terms("Betas and Previews" ;) .
can use Security Lake to automatically centralize security data from
in your Amazon Web Servicesaccount . Amazon Web Services Orga... |
504e2f8f45fd48661dd29e9742ab3b3f71cfb72157f7d806d6aabf626a974a71 | yi-editor/yi | Layouts.hs | # LANGUAGE GeneralizedNewtypeDeriving #
# LANGUAGE ViewPatterns #
# LANGUAGE TupleSections #
{-# OPTIONS_HADDOCK show-extensions #-}
-- |
-- Module : Yi.Frontend.Pango.Layouts
-- License : GPL-2
-- Maintainer :
-- Stability : experimental
-- Portability : portable
--
-- Provides abstract controls whi... | null | https://raw.githubusercontent.com/yi-editor/yi/58c239e3a77cef8f4f77e94677bd6a295f585f5f/yi-frontend-pango/src/Yi/Frontend/Pango/Layouts.hs | haskell | # OPTIONS_HADDOCK show-extensions #
|
Module : Yi.Frontend.Pango.Layouts
License : GPL-2
Maintainer :
Stability : experimental
Portability : portable
Provides abstract controls which implement 'Yi.Layout.Layout's and
which manage the minibuffer.
@SlidingPair@ (implementing the 'Pair' constr... | # LANGUAGE GeneralizedNewtypeDeriving #
# LANGUAGE ViewPatterns #
# LANGUAGE TupleSections #
The implementation strategy is to first construct the layout
managers @WeightedStack@ ( implementing the ' Stack ' constructor ) and
module Yi.Frontend.Pango.Layouts (
WidgetLike(..),
LayoutDisplay,
layoutDisplayNew... |
b36a1769b3bc571bdf6e983821166a241a9cc0b6d1aeda7eb0e442139cc57064 | flavioc/cl-hurd | io-clear-some-openmodes.lisp |
(in-package :hurd-translator)
(def-io-interface :io-clear-some-openmodes ((port port)
(old-flags open-flags))
(with-lookup protid port
(setf (flags (open-node protid))
(disable-flags (flags (open-node protid))
(only-flags old-flags
... | null | https://raw.githubusercontent.com/flavioc/cl-hurd/982232f47d1a0ff4df5fde2edad03b9df871470a/translator/interfaces/io-clear-some-openmodes.lisp | lisp |
(in-package :hurd-translator)
(def-io-interface :io-clear-some-openmodes ((port port)
(old-flags open-flags))
(with-lookup protid port
(setf (flags (open-node protid))
(disable-flags (flags (open-node protid))
(only-flags old-flags
... | |
f2a87ae67cdaa31d0f53fae0e3e7e894089112516fb1206396e5bc6c0918de21 | CSVdB/pinky | CreateRandom.hs | # LANGUAGE FlexibleInstances #
# LANGUAGE DefaultSignatures #
# LANGUAGE UndecidableInstances #
module Pinky.CreateRandom where
import Import
import System.Random
import Control.Monad.Random.Class
class CreateRandom a where
createRandom :: RandomGen g => g -> (a, g)
default createRandom :: (Random a, Rando... | null | https://raw.githubusercontent.com/CSVdB/pinky/e77a4c0812ceb4b8548c41a7652fb247c2ab39e0/pinky/src/Pinky/CreateRandom.hs | haskell | # LANGUAGE FlexibleInstances #
# LANGUAGE DefaultSignatures #
# LANGUAGE UndecidableInstances #
module Pinky.CreateRandom where
import Import
import System.Random
import Control.Monad.Random.Class
class CreateRandom a where
createRandom :: RandomGen g => g -> (a, g)
default createRandom :: (Random a, Rando... | |
d16da1960d9fe5329aeaab429c7d9fed3bbe4cdde41656b7e35472c6d622d98a | mklinik/hmud | Main.hs | # LANGUAGE OverloadedStrings , TypeSynonymInstances , FlexibleInstances #
module Main where
import qualified Network.SimpleIRC as IRC
import qualified Data.ByteString.Char8 as B
import Data.Maybe (fromJust, isJust)
import Control.Concurrent.Chan
import Control.Concurrent (forkIO)
import q... | null | https://raw.githubusercontent.com/mklinik/hmud/5ba32f29170a098e007d50688df32cf8919b6bf1/Irc/Main.hs | haskell | Address
Channels to join on connect
Events to bind
only private messages to the oracle directly
ignore the join message from myself
ignore message from myself
connect failed | # LANGUAGE OverloadedStrings , TypeSynonymInstances , FlexibleInstances #
module Main where
import qualified Network.SimpleIRC as IRC
import qualified Data.ByteString.Char8 as B
import Data.Maybe (fromJust, isJust)
import Control.Concurrent.Chan
import Control.Concurrent (forkIO)
import q... |
45e87d3c9023ebf791326ff35850ffee93789d5bae1566553ec131e3446c9fdb | hercules-ci/hercules-ci-agent | Token.hs | module Hercules.Agent.Token where
import Control.Lens ((^?))
import qualified Data.Aeson as Aeson
import Data.Aeson.Lens (key, _String)
import qualified Data.ByteString.Base64.Lazy as B64L
import qualified Data.ByteString.Lazy as BL
import qualified Data.Text as T
import qualified Hercules.API.Agent.LifeCycle
import q... | null | https://raw.githubusercontent.com/hercules-ci/hercules-ci-agent/216a1d178d57471b05f60bf3e21ce46d3fdc5f94/hercules-ci-agent/hercules-ci-agent/Hercules/Agent/Token.hs | haskell | | Reads a token file, strips whitespace
Sanity check
TODO: Although this looks nice, the implicit limitation here is that we can
problematic at some point. Perhaps we should switch to a polymorphic | module Hercules.Agent.Token where
import Control.Lens ((^?))
import qualified Data.Aeson as Aeson
import Data.Aeson.Lens (key, _String)
import qualified Data.ByteString.Base64.Lazy as B64L
import qualified Data.ByteString.Lazy as BL
import qualified Data.Text as T
import qualified Hercules.API.Agent.LifeCycle
import q... |
07556cb222582e8a7fbb8862891ffcc527cc00a6008934d013d42fec86b279f2 | fredrikt/yxa | sipanswer.erl | -module(sipanswer).
-export([
start/5,
bounce/5,
control/3,
alaw_encode/1,
sine/1,
sine_gen/1,
testsine/0,
alaw_decode/1
]).
printlist([]) ->
true;
printlist([E | R]) ->
io:format("~p~n", [alaw_decode(E)]),
printlist(R).
testsine() ->
List = sine(160),
printlist(List).
alaw_deco... | null | https://raw.githubusercontent.com/fredrikt/yxa/85da46a999d083e6f00b5f156a634ca9be65645b/src/unused/sipanswer.erl | erlang | -module(sipanswer).
-export([
start/5,
bounce/5,
control/3,
alaw_encode/1,
sine/1,
sine_gen/1,
testsine/0,
alaw_decode/1
]).
printlist([]) ->
true;
printlist([E | R]) ->
io:format("~p~n", [alaw_decode(E)]),
printlist(R).
testsine() ->
List = sine(160),
printlist(List).
alaw_deco... | |
dfc8e0ec46722a71807a3a7d753db2c610efdde0b62b8026db7bfe6c82a9dbd0 | puppetlabs/puppetdb | jdbc_test.clj | (ns puppetlabs.puppetdb.jdbc-test
(:require [puppetlabs.puppetdb.jdbc :as subject]
[clojure.test :refer :all]
[puppetlabs.puppetdb.testutils.db
:refer [*db* antonym-data
insert-entries
defaulted-read-db-config
defaulte... | null | https://raw.githubusercontent.com/puppetlabs/puppetdb/b3d6d10555561657150fa70b6d1e609fba9c0eda/test/puppetlabs/puppetdb/jdbc_test.clj | clojure | (ns puppetlabs.puppetdb.jdbc-test
(:require [puppetlabs.puppetdb.jdbc :as subject]
[clojure.test :refer :all]
[puppetlabs.puppetdb.testutils.db
:refer [*db* antonym-data
insert-entries
defaulted-read-db-config
defaulte... | |
bb1dbc50211838cac863a55c445951b8da29d6df3fffac817b71d60712e5308b | haroldcarr/learn-haskell-coq-ml-etc | Z.hs | # LANGUAGE FlexibleContexts #
# LANGUAGE FlexibleInstances #
# LANGUAGE FunctionalDependencies #
# LANGUAGE GeneralizedNewtypeDeriving #
# LANGUAGE MonoLocalBinds #
# LANGUAGE MultiParamTypeClasses #
{-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE OverloadedStrings ... | null | https://raw.githubusercontent.com/haroldcarr/learn-haskell-coq-ml-etc/b4e83ec7c7af730de688b7376497b9f49dc24a0e/haskell/topic/lens/hc-usage/src/Z.hs | haskell | # LANGUAGE NoImplicitPrelude #
# LANGUAGE OverloadedStrings #
# LANGUAGE RankNTypes #
# LANGUAGE TemplateHaskell #
----------------------------------------------------------------------------
----------------------------------------------------------------------------
------... | # LANGUAGE FlexibleContexts #
# LANGUAGE FlexibleInstances #
# LANGUAGE FunctionalDependencies #
# LANGUAGE GeneralizedNewtypeDeriving #
# LANGUAGE MonoLocalBinds #
# LANGUAGE MultiParamTypeClasses #
# LANGUAGE TypeFamilies #
module Z where
import ... |
3751afc1593a9cdb0a0d80c32a06cdf43e7fe461fa57c8a1450a50033e108632 | Tritlo/spectacular | Dataset.hs | {-# LANGUAGE OverloadedStrings #-}
module Application.TermSearch.Dataset where
import Data.ECTA
import Data.Map ( Map )
import Data.Text ( Text )
import Application.TermSearch.Type
import Application.TermSearch.Utils
typeT... | null | https://raw.githubusercontent.com/Tritlo/spectacular/00621f4f0f03e5d0afea3c730434a8842e473546/src/Application/TermSearch/Dataset.hs | haskell | # LANGUAGE OverloadedStrings #
`($)` is hardcoded to only be in argument position
`id` is almost entirely useless, but clogs up the graph. Currently banned
switch to this when you run experiments on stackoverflow benchmarks
hoogleComponents :: Map TypeSkeleton Text
groupMapping :: Map Text Text |
module Application.TermSearch.Dataset where
import Data.ECTA
import Data.Map ( Map )
import Data.Text ( Text )
import Application.TermSearch.Type
import Application.TermSearch.Utils
typeToFta :: TypeSkeleton -> Node
typeTo... |
2a80e6b06fb5ef41a366e00cef1f15e1cd290c59217835cec6904346c208872b | utahstreetlabs/risingtide | utils.clj | (ns risingtide.utils
(:require [clojure.data.json :as json]
[clojure.java.io :as io]
[clojure.tools.logging :as log]
[risingtide
[core :refer [log-err]]
[config :as config]
[redis :as redis]
[active-users :refer [active-user-key]]... | null | https://raw.githubusercontent.com/utahstreetlabs/risingtide/bc5b798396679739469b1bd8ee1b03db76178cde/src/risingtide/utils.clj | clojure | migrate staging keys to development.
; ; ;
right now, this just creates a function name prefixed with run- and
ensures agents are shut down after the given forms are executed | (ns risingtide.utils
(:require [clojure.data.json :as json]
[clojure.java.io :as io]
[clojure.tools.logging :as log]
[risingtide
[core :refer [log-err]]
[config :as config]
[redis :as redis]
[active-users :refer [active-user-key]]... |
dbef373a8081e254ca062589a9f08dd39e45c2a6d209cdf781abe8f643fea0b3 | racket/redex | obj.rkt | #lang racket
;; a model of simple object programming (no updater, no prototype, no clone)
(require redex (only-in "common.rkt" in))
;; -----------------------------------------------------------------------------
;; syntax
(define-language Object
(e ::= n y (object (m (x) e) ...) (send e m e))
(y ::= x this)
... | null | https://raw.githubusercontent.com/racket/redex/4c2dc96d90cedeb08ec1850575079b952c5ad396/redex-doc/redex/scribblings/extended-exercises/obj.rkt | racket | a model of simple object programming (no updater, no prototype, no clone)
-----------------------------------------------------------------------------
syntax
-----------------------------------------------------------------------------
examples
--------------------------------------------------------------------... | #lang racket
(require redex (only-in "common.rkt" in))
(define-language Object
(e ::= n y (object (m (x) e) ...) (send e m e))
(y ::= x this)
(n ::= natural)
(m ::= variable-not-otherwise-mentioned)
(x ::= variable-not-otherwise-mentioned))
(define help
(term (object [help (x) x])))
(define p-good
... |
fd296c6448fe5f866b28ca5790acfc9538a7b3e9d159759bce50394055fd80e4 | gustavo-depaula/dpgurl | project.clj | (defproject dpgurl "0.2.0"
:description "An expirale url shortener written in Clojure"
:url ""
:min-lein-version "2.9.1"
:license {:name "MIT License"
:url ""}
:dependencies [[org.clojure/clojure "1.10.0"]
[compojure "1.6.1"]
[ring/ring-json "0.3.1"]
... | null | https://raw.githubusercontent.com/gustavo-depaula/dpgurl/9784d13eb029b4be09c95117a3100478abdb66a2/project.clj | clojure | (defproject dpgurl "0.2.0"
:description "An expirale url shortener written in Clojure"
:url ""
:min-lein-version "2.9.1"
:license {:name "MIT License"
:url ""}
:dependencies [[org.clojure/clojure "1.10.0"]
[compojure "1.6.1"]
[ring/ring-json "0.3.1"]
... | |
0f9e2deee74e362269c8aed3191c9f8f5848c0b3ca624afa24b7bd9a5a65a630 | vikram/lisplibraries | test-usocket.lisp | $ I d : test-usocket.lisp 173 2007 - 01 - 18 21:24:25Z ehuelsmann $
;;;; $URL: svn+ssh-usocket.lisp $
;;;; See LICENSE for licensing information.
(in-package :usocket-test)
(defmacro with-caught-conditions ((expect throw) &body body)
`(catch 'caught-error
(handler-case
(progn ,@body)
(usocket:un... | null | https://raw.githubusercontent.com/vikram/lisplibraries/105e3ef2d165275eb78f36f5090c9e2cdd0754dd/site/usocket-0.3.5/test/test-usocket.lisp | lisp | $URL: svn+ssh-usocket.lisp $
See LICENSE for licensing information.
common-lisp.net IP
80 = just a port
let's hope c-l.net doesn't move soon, or that people start to
test usocket like crazy..
let's hope c-l.net doesn't change its software any time soon | $ I d : test-usocket.lisp 173 2007 - 01 - 18 21:24:25Z ehuelsmann $
(in-package :usocket-test)
(defmacro with-caught-conditions ((expect throw) &body body)
`(catch 'caught-error
(handler-case
(progn ,@body)
(usocket:unknown-error (c) (if (typep c ,expect)
(th... |
13817af53e144e340d202a7c05162156ab40a52bde4fe0070f983a29b88cfc6e | RolfRolles/PandemicML | IRLocalOpt.ml | open IR
open PpIR
open IRUtil
(* Recursively extract every variable that is used in an expression; return a list *)
let rec extract_uses = function
| Cast(_,_,e)
| Unop(_,e) ->
extract_uses e
| Binop(e1,_,e2)
| Load(e1,e2,_) ->
let l1 = extract_uses e1 in
let l2 = extract_uses e2 in
l1@l2
... | null | https://raw.githubusercontent.com/RolfRolles/PandemicML/9c31ecaf9c782dbbeb6cf502bc2a6730316d681e/IR/IRLocalOpt.ml | ocaml | Recursively extract every variable that is used in an expression; return a list
b: replace assignment targets
Returns a pair: (Some(defined var) or None, {used vars})
'
Have to AND the shiftand
Reverse the list of instructions, as this analysis works backwards
Calculate a list of booleans which indicates... | open IR
open PpIR
open IRUtil
let rec extract_uses = function
| Cast(_,_,e)
| Unop(_,e) ->
extract_uses e
| Binop(e1,_,e2)
| Load(e1,e2,_) ->
let l1 = extract_uses e1 in
let l2 = extract_uses e2 in
l1@l2
| Store(e1,e2,e3,_) ->
let l1 = extract_uses e1 in
let l2 = extract_uses e2 in
... |
3d39ce1134183f66e67975605368672d9398f5f7f59ec7e28241cd5a6aba0848 | flipstone/haskell-for-beginners | 1_algebraic_data_types_intro.hs | Define a data type that represents a Complex number :
--
-- Use Floats simplicity
--
data Complex = Complex Float Float deriving (Show)
Define add , sub , mult , and divide for Complex numbers
add :: Complex -> Complex -> Complex
add (Complex a b) (Complex c d) = Complex (a + c) (b + d)
sub :: Complex -> C... | null | https://raw.githubusercontent.com/flipstone/haskell-for-beginners/e586a1f3ef08f21d5181171fe7a7b27057391f0b/answers/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 :
data Complex = Complex Float Float deriving (Show)
Define add , sub , mult , and divide for Complex numbers
add :: Complex -> Complex -> Complex
add (Complex a b) (Complex c d) = Complex (a + c) (b + d)
sub :: Complex -> Complex -> Complex
sub (Complex a b) ... |
730eb460348df61d789c701020457a253a6f7e0bc4b73fc9b4b6383c1e123945 | camllight/camllight | fastgrep.ml | #open "expr";;
#open "auto";;
#open "determ";;
let ligne_trouvée = ref false;;
let grep_sur_canal auto nom_fich canal =
try
while true do
let ligne = input_line canal in
if fastrec__reconnaît auto ligne then begin
ligne_trouvée := true;
print_string nom_fich;
print_string": "... | null | https://raw.githubusercontent.com/camllight/camllight/0cc537de0846393322058dbb26449427bfc76786/sources/examples/grep/fastgrep.ml | ocaml | #open "expr";;
#open "auto";;
#open "determ";;
let ligne_trouvée = ref false;;
let grep_sur_canal auto nom_fich canal =
try
while true do
let ligne = input_line canal in
if fastrec__reconnaît auto ligne then begin
ligne_trouvée := true;
print_string nom_fich;
print_string": "... | |
cca24021ce3f18018923a7a77127124c60e92d525610ff6d393e93f75b66f150 | kayhide/wakame | Nub.hs | # LANGUAGE UndecidableSuperClasses #
module Wakame.Nub where
import Prelude
import Wakame.Row (NP (..), Row, V)
-- $setup
> > > import
-- | Typeclass for reshaping fields
-- `nub` function eliminates duplicate fileds.
When duplication , the first element takes precedence .
-- It also reorders fields so to ma... | null | https://raw.githubusercontent.com/kayhide/wakame/4d16ecf2221655300b5db588c2775cfc0b8d92cd/src/Wakame/Nub.hs | haskell | $setup
| Typeclass for reshaping fields
`nub` function eliminates duplicate fileds.
It also reorders fields so to match the return type.
# OVERLAPS # | # LANGUAGE UndecidableSuperClasses #
module Wakame.Nub where
import Prelude
import Wakame.Row (NP (..), Row, V)
> > > import
When duplication , the first element takes precedence .
> > > toRow ( keyed " 42.0 , keyed " 56.4 )
( x : 42.0 ) :* ( x : 56.4 ) :* Nil
> > > nub $ toRow ( keyed " 42.0 , keye... |
e72a7824949e4d67c01a41fd25f4d35d1c9bb8252dbd64eee43cb0e3ce8347b1 | thiagozg/GitHubJobs-Clojure-Service | job.clj | (ns github-jobs.data.job
(:require [schema.core :as s]
[github-jobs.model.job :as model-job]
[datomic.api :as d]))
(defn get-jobs!
[conn
{:keys [title
category
github-id]}]
(let [query-base {:query '{:find [[(pull ?job [*]) ...]]
:in ... | null | https://raw.githubusercontent.com/thiagozg/GitHubJobs-Clojure-Service/9b17da56ebe773f6aed96337ac516307d91a1403/src/github_jobs/data/job.clj | clojure | (ns github-jobs.data.job
(:require [schema.core :as s]
[github-jobs.model.job :as model-job]
[datomic.api :as d]))
(defn get-jobs!
[conn
{:keys [title
category
github-id]}]
(let [query-base {:query '{:find [[(pull ?job [*]) ...]]
:in ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.