_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 |
|---|---|---|---|---|---|---|---|---|
eb07f2aab14db561415bf46739883dcb11a268adfa00594aef2d4317a33db84b | seckcoder/course-compiler | s1_21.rkt | (if (and (eq? (read) 0) (eq? (read) 1))
0
42) | null | https://raw.githubusercontent.com/seckcoder/course-compiler/4363e5b3e15eaa7553902c3850b6452de80b2ef6/tests/s1_21.rkt | racket | (if (and (eq? (read) 0) (eq? (read) 1))
0
42) | |
42ef1e58fc3fdb8493ec8f7ea8a2bc864207d2ff1d159dbf0b27de91540f2526 | metaocaml/ber-metaocaml | pr7115.ml | (* TEST
flags = " -w A -strict-sequence "
* expect
*)
type t = A : t;;
[%%expect {|
type t = A : t
|}]
module X1 : sig end = struct
let _f ~x (* x unused argument *) = function
| A -> let x = () in x
end;;
[%%expect {|
Line 2, characters 10-11:
2 | let _f ~x (* x unused argument *) = function
... | null | https://raw.githubusercontent.com/metaocaml/ber-metaocaml/4992d1f87fc08ccb958817926cf9d1d739caf3a2/testsuite/tests/typing-warnings/pr7115.ml | ocaml | TEST
flags = " -w A -strict-sequence "
* expect
x unused argument
x unused argument
unused value
unused value
unused
unused open
unused
unused open |
type t = A : t;;
[%%expect {|
type t = A : t
|}]
module X1 : sig end = struct
| A -> let x = () in x
end;;
[%%expect {|
Line 2, characters 10-11:
^
Warning 27: unused variable x.
module X1 : sig end
|}]
module X2 : sig end = struct
let _f = function
| A -> let x = () in x
end;;
[%%expect {|
L... |
c82a7baaaf97b7b0b3d0bf331a8e132fc54088b6f1da54c44b4bbea88ff6b62c | tezos/tezos-mirror | mempool_validation.ml | (*****************************************************************************)
(* *)
(* Open Source License *)
Copyright ( c ) 2022 Nomadic Labs < >
(* ... | null | https://raw.githubusercontent.com/tezos/tezos-mirror/5efba2a0abebcd740021f0360535cb64e02df758/src/proto_alpha/lib_protocol/mempool_validation.ml | ocaml | ***************************************************************************
Open Source License
Permission is h... | Copyright ( c ) 2022 Nomadic Labs < >
to deal in the Software without restriction , including without limitation
and/or sell copies of the Software , and to permit persons to whom the
THE SOFTWARE IS PROVIDED " AS IS " , WITHOUT WARRANTY OF ANY KIND , EXPRESS OR
LIABILITY , WHETHER IN AN... |
a81ed9926e8993d21f39c98bba3e45600d8486bb4800c7e23df337a26d19810b | etorreborre/registry | SimpleExamples.hs | # LANGUAGE DataKinds #
# OPTIONS_GHC -fno - warn - missing - signatures #
{-
These examples are simply provided to show what must compile
-}
module Test.Data.Registry.SimpleExamples where
import Data.Registry
import Data.Text as T (length)
import Protolude hiding (C1)
-- | No typeclass instance is necessary for a ... | null | https://raw.githubusercontent.com/etorreborre/registry/117e66b1bed3dda1901f406a5c8a7bd8a61e736e/test/Test/Data/Registry/SimpleExamples.hs | haskell |
These examples are simply provided to show what must compile
| No typeclass instance is necessary for a "record of functions" to be a Registry component
| Simple datatypes which can be used in a registry
| values and functions
| This does *not* compile because Double in not in the
| This does *not* compile be... | # LANGUAGE DataKinds #
# OPTIONS_GHC -fno - warn - missing - signatures #
module Test.Data.Registry.SimpleExamples where
import Data.Registry
import Data.Text as T (length)
import Protolude hiding (C1)
data Logging = Logging
{ info :: Text -> IO (),
debug :: Text -> IO ()
}
logging = make @Logging (fun Logg... |
6d56f234e16e4fb01a13310cead16b12f226c0289a365c4501c32ae9d516e579 | schwering/golog | Control.hs | # LANGUAGE TypeFamilies , MultiParamTypeClasses , GeneralizedNewtypeDeriving #
module TORCS.Golog.Control where
import qualified Control.Concurrent.SSem as Sem
import Data.IORef
import Data.Maybe (fromMaybe, fromJust, isNothing)
import Golog.Interpreter
import Golog.Macro
import Golog.Util
import TORCS.CarControl
imp... | null | https://raw.githubusercontent.com/schwering/golog/e5a0dba9598d616762271b5bef9fd51a53c1f829/torcs-agent/src/TORCS/Golog/Control.hs | haskell | putStrLn $ show a
putStrLn $ show a ++ " done"
( speedX ( currentState2 s ) ) > 1
if alreadyGear s then -1 else -0.01
lock' = if v > steerSensitivityOffset
else lock * abs lock
v = speedX cs
| ABS constants. | # LANGUAGE TypeFamilies , MultiParamTypeClasses , GeneralizedNewtypeDeriving #
module TORCS.Golog.Control where
import qualified Control.Concurrent.SSem as Sem
import Data.IORef
import Data.Maybe (fromMaybe, fromJust, isNothing)
import Golog.Interpreter
import Golog.Macro
import Golog.Util
import TORCS.CarControl
imp... |
7cda51d2cf34a9c057ef4201359bbcfbfe13ed87b8f21084177cac1a8f869569 | nd/sicp | 2.27.scm | (define (deep-reverse tree)
(define (iter things result)
(cond ((null? things) result)
((not (pair? things)) things)
(else (iter (cdr things)
(cons (iter (car things) (list)) result)))))
(iter tree (list))) | null | https://raw.githubusercontent.com/nd/sicp/d8587a0403d95af7c7bcf59b812f98c4f8550afd/ch02/2.27.scm | scheme | (define (deep-reverse tree)
(define (iter things result)
(cond ((null? things) result)
((not (pair? things)) things)
(else (iter (cdr things)
(cons (iter (car things) (list)) result)))))
(iter tree (list))) | |
dd1580fd326f4e59d09c54ecd8beaf162259d1d48857bd013fa7c9992939e4c9 | lojic/RacketCon2020 | axio-string.rkt | #lang racket/base
(require racket/contract
racket/string)
(provide elide-string)
;; Return an elided string no longer than total-length
;;
;; If #:honor-word-boundaries is #f
;; (elide-string "hello" 5) -> "hello"
( elide - string " hello there " 5 ) - > " he ... "
;;
;; If #:honor-word-boundaries i... | null | https://raw.githubusercontent.com/lojic/RacketCon2020/310e0ab01d8c3e1546029720f6bb66e6d1a5fb1e/TodoApp/axio/axio-string.rkt | racket | Return an elided string no longer than total-length
If #:honor-word-boundaries is #f
(elide-string "hello" 5) -> "hello"
If #:honor-word-boundaries is #t
(elide-string "hello there" 8) -> "hello..."
Leave room for "..."
Reduce total-length, if necessary, so that we don't break a word.
-------------... | #lang racket/base
(require racket/contract
racket/string)
(provide elide-string)
( elide - string " hello there " 5 ) - > " he ... "
( elide - string " hello there " 5 ) - > " he ... "
( elide - string " hello there " 11 ) - > " hello there "
( elide - string " hello there you " 13 ) - > ... |
5a8593c545d3b8913e920c281588a0701109d7f0e4cd83df04a1c4bf98505dff | bdaniels/reasoned-schemer | project.clj | (defproject reasoned-schemer "0.1.0-SNAPSHOT"
:description "Me working through the Reasonable Schemer Book."
:license {:name "Eclipse Public License"
:url "-v10.html"}
:dependencies [[org.clojure/clojure "1.4.0"]
[org.clojure/core.logic "0.7.5"]]
:plugins [[lein-swank "1.4.4"]
... | null | https://raw.githubusercontent.com/bdaniels/reasoned-schemer/efc735ed7723eee6b7dbc28c4e4969838dbff1e1/project.clj | clojure | (defproject reasoned-schemer "0.1.0-SNAPSHOT"
:description "Me working through the Reasonable Schemer Book."
:license {:name "Eclipse Public License"
:url "-v10.html"}
:dependencies [[org.clojure/clojure "1.4.0"]
[org.clojure/core.logic "0.7.5"]]
:plugins [[lein-swank "1.4.4"]
... | |
f4fd853aec41f9b14521e0f58fc8b9d22bedc012e5e3e32ed14b1835d18ac863 | kmicinski/cmsc330examples | cek-lambda.ml |
CMSC 330 , Summer 2015
Lectures on small step semantics and the CEK machine .
CMSC 330, Summer 2015
Lectures on small step semantics and the CEK machine.
*)
module L = List
module S = String
type var = string (* Variable names *)
type name = string (* Constructor names *)
In this ... | null | https://raw.githubusercontent.com/kmicinski/cmsc330examples/78f5acaaae25f11a39817673433efcf33271df6d/lambda-calculus/cek-lambda.ml | ocaml | Variable names
Constructor names
--------------------------------------------------------------------------
Review: lambda calculus, big step semantics
--------------------------------------------------------------------------
Variables
Lambda abstractions
Applications
An... |
CMSC 330 , Summer 2015
Lectures on small step semantics and the CEK machine .
CMSC 330, Summer 2015
Lectures on small step semantics and the CEK machine.
*)
module L = List
module S = String
In this week 's lectures , we 're going to explore another way to
define meaning to progra... |
7664f685328d8eb345fe0bda7e32971034f8bfa1727d20194d725ba4741f7c37 | mfp/ocaml-sqlexpr | sqlexpr_sqlite_lwt.mli | (** {!Sqlexpr_sqlite.S} implementation for the Lwt monad that uses thread
* pools to avoid blocking on sqlite3 API calls. *)
include Sqlexpr_sqlite.S with type 'a result = 'a Lwt.t
(** [set_max_threads n] sets the maximum number of threads to
* [max n current_thread_count] and returns the new limit *)
val set_max... | null | https://raw.githubusercontent.com/mfp/ocaml-sqlexpr/5b22129a837d43df189bb29aa1d594412075e4f6/src/sqlexpr_sqlite_lwt.mli | ocaml | * {!Sqlexpr_sqlite.S} implementation for the Lwt monad that uses thread
* pools to avoid blocking on sqlite3 API calls.
* [set_max_threads n] sets the maximum number of threads to
* [max n current_thread_count] and returns the new limit |
include Sqlexpr_sqlite.S with type 'a result = 'a Lwt.t
val set_max_threads : int -> int
|
c5e59027abe1d6f7f6c77f9ac89162d544fd0ab1989f49071fe8c9ac6a798c07 | mojombo/ernie | ernie_access_logger.erl | -module(ernie_access_logger).
-behaviour(gen_server).
%% api
-export([start_link/1, start/1, acc/1, err/3, reopen/0]).
%% gen_server callbacks
-export([init/1, handle_call/3, handle_cast/2, handle_info/2,
terminate/2, code_change/3]).
-include_lib("ernie.hrl").
-record(lstate, {access_file_name = undefined... | null | https://raw.githubusercontent.com/mojombo/ernie/a21664e668038291bdbe42684d46cb112242aa7b/elib/ernie_access_logger.erl | erlang | api
gen_server callbacks
====================================================================
API
====================================================================
====================================================================
gen_server callbacks
===========================================================... | -module(ernie_access_logger).
-behaviour(gen_server).
-export([start_link/1, start/1, acc/1, err/3, reopen/0]).
-export([init/1, handle_call/3, handle_cast/2, handle_info/2,
terminate/2, code_change/3]).
-include_lib("ernie.hrl").
-record(lstate, {access_file_name = undefined,
access_file ... |
ad3d3946946bf93b3a342220e67c318af75f495469be161843b123f0f98a0a42 | oxidizing/sihl-demo | repo.ml | let clean_pizzas_request =
Caqti_request.exec Caqti_type.unit "TRUNCATE TABLE pizzas CASCADE;"
;;
let clean_ingredients_request =
Caqti_request.exec Caqti_type.unit "TRUNCATE TABLE ingredients CASCADE;"
;;
let clean_pizzas_ingredients_request =
Caqti_request.exec
Caqti_type.unit
"TRUNCATE TABLE pizzas_i... | null | https://raw.githubusercontent.com/oxidizing/sihl-demo/e8fdba64ed628af003140242502149f16e958225/app/context/pizza/repo.ml | ocaml | We don't need to remove the pizzas_ingredients entry because of
CASCADING | let clean_pizzas_request =
Caqti_request.exec Caqti_type.unit "TRUNCATE TABLE pizzas CASCADE;"
;;
let clean_ingredients_request =
Caqti_request.exec Caqti_type.unit "TRUNCATE TABLE ingredients CASCADE;"
;;
let clean_pizzas_ingredients_request =
Caqti_request.exec
Caqti_type.unit
"TRUNCATE TABLE pizzas_i... |
c53d4f32c359d8bd81be92c1c0a1ddfa48a5293b6593ddb4acd735528feb795b | informatimago/lisp | author-signature.lisp | -*- mode : lisp ; coding : utf-8 -*-
;;;;****************************************************************************
FILE : author-signature.lisp
;;;;LANGUAGE: Common-Lisp
;;;;SYSTEM: Common-Lisp
USER - INTERFACE : Common - Lisp
;;;;DESCRIPTION
;;;;
;;;; This program comp... | null | https://raw.githubusercontent.com/informatimago/lisp/571af24c06ba466e01b4c9483f8bb7690bc46d03/small-cl-pgms/author-signature.lisp | lisp | coding : utf-8 -*-
****************************************************************************
LANGUAGE: Common-Lisp
SYSTEM: Common-Lisp
DESCRIPTION
This program compute an "author signature" from a text.
See: /~johnsone/comp.html
LEGAL
This program is free software: you can redi... | FILE : author-signature.lisp
USER - INTERFACE : Common - Lisp
< PJB >
MODIFICATIONS
2003 - 03 - 13 < PJB > Creation .
AGPL3
Copyright 2003 - 2016
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation , either ve... |
44e728a5c3f855bab2f82a7bd61a4c5b1e7c0553544fac05c11aac87b66da1fd | bitblaze-fuzzball/fuzzball | exec_fuzzloop.ml |
Copyright ( C ) BitBlaze , 2009 - 2013 . All rights reserved .
Copyright (C) BitBlaze, 2009-2013. All rights reserved.
*)
module V = Vine;;
open Exec_domain;;
open Exec_exceptions;;
open Exec_utils;;
open Exec_options;;
open Frag_simplify;;
open Fragment_machine;;
open Sym_path_frag_machine;;
open Sym_region_... | null | https://raw.githubusercontent.com/bitblaze-fuzzball/fuzzball/b9a617b45e68fa732f1357fedc08a2a10f87a62c/execution/exec_fuzzloop.ml | ocaml | for the benefit of leak checking
This used to be an uncaught exception
KnownPath currently shouldn't happen
shouldn't happen |
Copyright ( C ) BitBlaze , 2009 - 2013 . All rights reserved .
Copyright (C) BitBlaze, 2009-2013. All rights reserved.
*)
module V = Vine;;
open Exec_domain;;
open Exec_exceptions;;
open Exec_utils;;
open Exec_options;;
open Frag_simplify;;
open Fragment_machine;;
open Sym_path_frag_machine;;
open Sym_region_... |
65a265afcd65a557d36df58f7f6e22c00477fa11d1155040c28cf87dd0be7a26 | noinia/hgeometry | IO.hs | # OPTIONS_GHC -fno - warn - orphans #
--------------------------------------------------------------------------------
-- |
-- Module : Geometry.PlanarSubdivision.IO
Copyright : ( C )
-- License : see the LICENSE file
Maintainer :
--
--
Converting from / to Adjacency Representation of the ... | null | https://raw.githubusercontent.com/noinia/hgeometry/89cd3d3109ec68f877bf8e34dc34b6df337a4ec1/hgeometry/src/Geometry/PlanarSubdivision/IO.hs | haskell | ------------------------------------------------------------------------------
|
Module : Geometry.PlanarSubdivision.IO
License : see the LICENSE file
------------------------------------------------------------------------------
* Reading and Writing the Plane Graph to a file
-----------------------... | # OPTIONS_GHC -fno - warn - orphans #
Copyright : ( C )
Maintainer :
Converting from / to Adjacency Representation of the Planar subdivision
module Geometry.PlanarSubdivision.IO
(
readPlanarSubdivision
, writePlanarSubdivision
* Converting to and from Adjacency list representions
, toTre... |
1cbb46e365f342520ac5fb7b5bebfaed3d85699ab2e728d84ef65b590903436a | Enecuum/Node | Interpreters.hs | module Enecuum.Testing.Framework.Interpreters
( module X
) where
import Enecuum.Testing.Framework.Interpreters.Networking as X
import Enecuum.Testing.Framework.Interpreters.Node as X
import Enecuum.Testing.Framework.Interpreters.NodeDefinition as X
import Enecuum.Testing.Fra... | null | https://raw.githubusercontent.com/Enecuum/Node/3dfbc6a39c84bd45dd5f4b881e067044dde0153a/test/test-framework/Enecuum/Testing/Framework/Interpreters.hs | haskell | module Enecuum.Testing.Framework.Interpreters
( module X
) where
import Enecuum.Testing.Framework.Interpreters.Networking as X
import Enecuum.Testing.Framework.Interpreters.Node as X
import Enecuum.Testing.Framework.Interpreters.NodeDefinition as X
import Enecuum.Testing.Fra... | |
0143a8938e36c8fe524a1e1f33acd1c6681ff665ebb3821d226d149cfdaeb9c1 | TerrorJack/ghc-alter | Weak.hs | # LANGUAGE Trustworthy #
-----------------------------------------------------------------------------
-- |
-- Module : System.Mem.Weak
Copyright : ( c ) The University of Glasgow 2001
-- License : BSD-style (see the file libraries/base/LICENSE)
--
-- Maintainer :
-- Stability : experimental
--... | null | https://raw.githubusercontent.com/TerrorJack/ghc-alter/db736f34095eef416b7e077f9b26fc03aa78c311/ghc-alter/boot-lib/base/System/Mem/Weak.hs | haskell | ---------------------------------------------------------------------------
|
Module : System.Mem.Weak
License : BSD-style (see the file libraries/base/LICENSE)
Maintainer :
Stability : experimental
Portability : non-portable
In general terms, a weak pointer is a reference to an object that i... | # LANGUAGE Trustworthy #
Copyright : ( c ) The University of Glasgow 2001
value ) . When you apply the function to a new argument you first
alive for ever . One way to solve this is to purge the table
module System.Mem.Weak (
mkWeak,
deRefWeak,
finalize,
mkWeakPtr,
... |
fbdada34ad948ac0973d931f0baa059bbe09aefffa3166a2dcebdf2b09b244b2 | conscell/hugs-android | Package.hs | -----------------------------------------------------------------------------
-- |
-- Module : Distribution.Package
Copyright : 2003 - 2004
--
Maintainer : < >
-- Stability : alpha
-- Portability : portable
--
-- Packages.
All rights reserved .
Redistribution and use in source and bin... | null | https://raw.githubusercontent.com/conscell/hugs-android/31e5861bc1a1dd9931e6b2471a9f45c14e3c6c7e/hugs/lib/hugs/packages/Cabal/Distribution/Package.hs | haskell | ---------------------------------------------------------------------------
|
Module : Distribution.Package
Stability : alpha
Portability : portable
Packages.
if no version, don't show version.
each component must contain an alphabetic character, to avoid | Copyright : 2003 - 2004
Maintainer : < >
All rights reserved .
Redistribution and use in source and binary forms , with or without
modification , are permitted provided that the following conditions are
met :
* Redistributions of source code must retain the above copyright
not... |
b5c89e21a7f3f6e9064d015a0c47cf27ed6826903706df3c30b6d1c2cf5d0a15 | returntocorp/semgrep | lib_parsing_c.ml |
*
* Copyright ( C ) 2012 Facebook
*
* This library is free software ; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public License
* version 2.1 as published by the Free Software Foundation , with the
* special exception on linking described in file licens... | null | https://raw.githubusercontent.com/returntocorp/semgrep/00f1e67bbb80f00e29db3381288fc00398b6868a/languages/c/ast/lib_parsing_c.ml | ocaml | module V = Visitor_c
***************************************************************************
Filenames
***************************************************************************
***************************************************************************
ii_of_any
***********************************************... |
*
* Copyright ( C ) 2012 Facebook
*
* This library is free software ; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public License
* version 2.1 as published by the Free Software Foundation , with the
* special exception on linking described in file licens... |
497beb704de872fba4d35d82628c1d418bcf07d4f4b5df4a9855c85e924bdb73 | mrossini-ethz/parseq | package.lisp | (defpackage :parseq
(:use :common-lisp)
(:export defrule parseq with-local-rules with-saved-rules trace-rule untrace-rule))
| null | https://raw.githubusercontent.com/mrossini-ethz/parseq/c14dc4ce0b40e2c565694534dccc9af26c0a8a1c/package.lisp | lisp | (defpackage :parseq
(:use :common-lisp)
(:export defrule parseq with-local-rules with-saved-rules trace-rule untrace-rule))
| |
6ce6fd0dce8def08013a6a46eeef7e65a773aff1187ff07eed84fbfe27f7bdf3 | ds-wizard/engine-backend | DocumentTemplateService.hs | module Wizard.Service.DocumentTemplate.DocumentTemplateService where
import Control.Monad.Except (throwError)
import Control.Monad.Reader (asks)
import Data.Foldable (traverse_)
import qualified Data.List as L
import Data.Maybe (fromMaybe)
import Shared.Api.Resource.DocumentTemplate.DocumentTemplateSuggestionDTO
impo... | null | https://raw.githubusercontent.com/ds-wizard/engine-backend/d392b751192a646064305d3534c57becaa229f28/engine-wizard/src/Wizard/Service/DocumentTemplate/DocumentTemplateService.hs | haskell | --------------------------------
PRIVATE
-------------------------------- | module Wizard.Service.DocumentTemplate.DocumentTemplateService where
import Control.Monad.Except (throwError)
import Control.Monad.Reader (asks)
import Data.Foldable (traverse_)
import qualified Data.List as L
import Data.Maybe (fromMaybe)
import Shared.Api.Resource.DocumentTemplate.DocumentTemplateSuggestionDTO
impo... |
4e364fdfe89993dc6d0e6ac08b4b146c4bc57918cea3f4e27839fcaabe405d5f | rd--/hsc3 | envAsr.help.hs | -- envAsr ; random release time
let g = setResetFF 1 (dustId 'α' kr 1)
p = envAsr 0.01 1 1 (EnvNum (-4))
e = envGen kr g 0.1 0 1 RemoveSynth p
in sinOsc ar 440 0 * e
-- envAsr ; control
let g = control kr "env-gate" 1
p = envAsr 0.01 1 1 (EnvNum (-4))
e = envGen kr g 0.1 0 1 RemoveSynth p
in sinOsc ar ... | null | https://raw.githubusercontent.com/rd--/hsc3/bb12d02f09481e7cb59ae2e9e5119d1f7c4c98c9/Help/Ugen/envAsr.help.hs | haskell | envAsr ; random release time
envAsr ; control
-- ; close gate message
-- ; help
-- ; drawings
hsc3-plot
-- ; drawings ; an envelope with a long release time that mostly sustains and then decays quickly | let g = setResetFF 1 (dustId 'α' kr 1)
p = envAsr 0.01 1 1 (EnvNum (-4))
e = envGen kr g 0.1 0 1 RemoveSynth p
in sinOsc ar 440 0 * e
let g = control kr "env-gate" 1
p = envAsr 0.01 1 1 (EnvNum (-4))
e = envGen kr g 0.1 0 1 RemoveSynth p
in sinOsc ar 440 0 * e
withSc3 (Sound.OSC.sendMessage (n_set1 (-... |
007c917929ffa283492a7ddf077fc40e6327816b3dc409454ef3dfbe2e15bd62 | tlrobinson/metabase-http-driver | query_processor.clj | (ns metabase.driver.http.query-processor
(:refer-clojure :exclude [==])
(:require [cheshire.core :as json]
[clojure.walk :as walk]
[clj-http.client :as client])
(:import [com.jayway.jsonpath JsonPath Predicate]))
(declare compile-expression compile-function)
(defn json-path
[query bod... | null | https://raw.githubusercontent.com/tlrobinson/metabase-http-driver/83c5402fe7864192db4a9efeb5b2afcaab28ffab/src/metabase/driver/http/query_processor.clj | clojure | (ns metabase.driver.http.query-processor
(:refer-clojure :exclude [==])
(:require [cheshire.core :as json]
[clojure.walk :as walk]
[clj-http.client :as client])
(:import [com.jayway.jsonpath JsonPath Predicate]))
(declare compile-expression compile-function)
(defn json-path
[query bod... | |
3d4c3a43465872baabd188a061963a1c7dbc7fdff74c5986979fdfd91e04e682 | ijvcms/chuanqi_dev | spec_dragon_mod.erl | %%%-------------------------------------------------------------------
%%% @author qhb
( C ) 2016 , < COMPANY >
%%% @doc
%%% 火龙神殿玩法,杀怪计数
%%% @end
Created : 07 . 九月 2016 上午10:55
%%%-------------------------------------------------------------------
-module(spec_dragon_mod).
-behaviour(gen_server).
-include("commo... | null | https://raw.githubusercontent.com/ijvcms/chuanqi_dev/7742184bded15f25be761c4f2d78834249d78097/server/trunk/server/src/business/scene/special/spec_dragon_mod.erl | erlang | -------------------------------------------------------------------
@author qhb
@doc
火龙神殿玩法,杀怪计数
@end
-------------------------------------------------------------------
gen_server callbacks
杀怪数
进度,跟火龙的配置id一致
API
===================================================================
API
============================... | ( C ) 2016 , < COMPANY >
Created : 07 . 九月 2016 上午10:55
-module(spec_dragon_mod).
-behaviour(gen_server).
-include("common.hrl").
-include("record.hrl").
-export([init/1, handle_call/3, handle_cast/2, handle_info/2, terminate/2, code_change/3]).
-define(SERVER, ?MODULE).
-record(state, {
}).
-export([
start... |
fb554df9cc0743b39a8d06e1cb0a5de3f0e7db349ecaf2730716e90143c73e59 | haskell/aeson | Options.hs | module Twitter.Options (module Twitter.Options) where
import Data.Aeson
twitterOptions :: Options
twitterOptions = defaultOptions
{ fieldLabelModifier = \x -> case x of
"id_" -> "id"
_ -> x
}
| null | https://raw.githubusercontent.com/haskell/aeson/d711df76b826942f4a9e791712512c6b19b8c1c8/examples/src/Twitter/Options.hs | haskell | module Twitter.Options (module Twitter.Options) where
import Data.Aeson
twitterOptions :: Options
twitterOptions = defaultOptions
{ fieldLabelModifier = \x -> case x of
"id_" -> "id"
_ -> x
}
| |
e995a0bbfe0b2ccb9a58b8f4a232d32457decce0e9eac77c424308d50838e046 | Frama-C/Frama-C-snapshot | domain_product.mli | (**************************************************************************)
(* *)
This file is part of Frama - C.
(* *)
Copyright ... | null | https://raw.githubusercontent.com/Frama-C/Frama-C-snapshot/639a3647736bf8ac127d00ebe4c4c259f75f9b87/src/plugins/value/domains/domain_product.mli | ocaml | ************************************************************************
alternatives)
... | This file is part of Frama - C.
Copyright ( C ) 2007 - 2019
CEA ( Commissariat à l'énergie atomique et aux énergies
Lesser General Public License as published by the Free Software
Foundation , v... |
1201c62d6a99209f65e919532d5e02face4bd86e4f16f3d1320f3acfde5ca50b | pilosus/pip-license-checker | file_test.clj | Copyright © 2020 - 2023
;;
;; This program and the accompanying materials are made available under the
terms of the Eclipse Public License 2.0 which is available at
;; -2.0.
;;
This Source Code may also be made available under the following Secondary
Licenses when the conditions for such availability set fort... | null | https://raw.githubusercontent.com/pilosus/pip-license-checker/48bb57a59124333b0d28a6432ef9359c9ef07ee1/test/pip_license_checker/file_test.clj | clojure |
This program and the accompanying materials are made available under the
-2.0.
Public License, v. 2.0 are satisfied: GNU General Public License as published by
file/exists?
file/get-requirement-lines
file/csv->lines
file/take-csv-columns
file/csv->data
file/edn->data
Cocoapods
Gradle JSON | Copyright © 2020 - 2023
terms of the Eclipse Public License 2.0 which is available at
This Source Code may also be made available under the following Secondary
Licenses when the conditions for such availability set forth in the Eclipse
the Free Software Foundation , either version 2 of the License , or ( at... |
baebb7aa2d9a41a9b0a49d75572f0c2a4f637e60d03600023bb10323c1d3483e | futurice/haskell-mega-repo | Internal.hs | {-# LANGUAGE DeriveLift #-}
{-# LANGUAGE OverloadedStrings #-}
module Futurice.Tribe.Internal (module Futurice.Tribe.Internal) where
import Data.Aeson.Compat
(FromJSON (..), withObject, (.!=), (.:), (.:?))
import Futurice.CostCenter (CostCenter)
import Futurice.Office (Office)
import Fu... | null | https://raw.githubusercontent.com/futurice/haskell-mega-repo/95fe8e33ad6426eb6e52a9c23db4aeffd443b3e5/futurice-tribes/src/Futurice/Tribe/Internal.hs | haskell | # LANGUAGE DeriveLift #
# LANGUAGE OverloadedStrings #
tiSubsidiary :: !Bool -- TODO: ? | module Futurice.Tribe.Internal (module Futurice.Tribe.Internal) where
import Data.Aeson.Compat
(FromJSON (..), withObject, (.!=), (.:), (.:?))
import Futurice.CostCenter (CostCenter)
import Futurice.Office (Office)
import Futurice.Prelude
import Prelude ()
data TribeInfo = TribeInfo
{ tiN... |
edeaa3cbb418ba217763f3d0b98636636c85a2a8c6942c431d0656ca42eb6987 | ChrisPenner/eve | Run.hs | module Eve.Internal.Run
( eve
, eve_
) where
import Eve.Internal.Actions
import Eve.Internal.Listeners
import Eve.Internal.Events
import Eve.Internal.States()
import Eve.Internal.AppState
import Control.Concurrent.Chan
import Control.Monad
import Control.Monad.State
import Control.Lens
import Data.Default
impor... | null | https://raw.githubusercontent.com/ChrisPenner/eve/6081b1ff13229b93e5e5a4505fd23aa0a25c96b1/src/Eve/Internal/Run.hs | haskell | | This runs your application like 'eve_',
custom base monad which implements 'MonadIO'. Upon termination of the app it
| This runs your application. It accepts an initialization block (which
is the same as any other 'App' or 'Action' block, which
registers event listeners and event providers. Note that nothing in ... | module Eve.Internal.Run
( eve
, eve_
) where
import Eve.Internal.Actions
import Eve.Internal.Listeners
import Eve.Internal.Events
import Eve.Internal.States()
import Eve.Internal.AppState
import Control.Concurrent.Chan
import Control.Monad
import Control.Monad.State
import Control.Lens
import Data.Default
impor... |
cab142fb606e651a6e654ef8002ce39730385c0a31ef9a18df39f4ed0e69cf78 | scheme-live/live | output.scm | #("
") | null | https://raw.githubusercontent.com/scheme-live/live/4c7c9d80f2fcf80692614e10935fa66be69e3708/live/json/data/y-string-u%2B2029-par-sep/output.scm | scheme | #("
") | |
499e1adf3a5e12499bccb5ae3210fe015edfd7edab07276b36e98a45ff183d4b | circuithub/rel8 | Window.hs | module Rel8.Query.Window
( window
)
where
-- base
import Prelude ()
-- opaleye
import qualified Opaleye.Window as Opaleye
-- rel8
import Rel8.Query ( Query )
import Rel8.Query.Opaleye ( mapOpaleye )
import Rel8.Window ( Window( Window ) )
-- | 'window' runs a query composed of expressions containing
-- [window... | null | https://raw.githubusercontent.com/circuithub/rel8/2e82fccb02470198297f4a71b9da8f535d8029b1/src/Rel8/Query/Window.hs | haskell | base
opaleye
rel8
| 'window' runs a query composed of expressions containing
[window functions](-window.html).
'window' is similar to 'Rel8.aggregate', with the main difference being
whereas aggregation queries fold the entire input query down into a single | module Rel8.Query.Window
( window
)
where
import Prelude ()
import qualified Opaleye.Window as Opaleye
import Rel8.Query ( Query )
import Rel8.Query.Opaleye ( mapOpaleye )
import Rel8.Window ( Window( Window ) )
that in a window query , each input row corresponds to one output row ,
row . To put this into ... |
fe1bb67a143bcdd6b032d5a32ed97ab0ddaadffa6182b467354daa1831328805 | dcuddeback/clj-pail | structure.clj | (ns clj-pail.fakes.structure
(:require [clj-pail.structure :as structure]
[clj-pail.serializer :as s]
[clj-pail.partitioner :as p])
(:use midje.open-protocols))
(defrecord-openly FakeSerializer []
s/Serializer
(s/serialize [this object] :fake)
(s/deserialize [this buffer] :fake))
(... | null | https://raw.githubusercontent.com/dcuddeback/clj-pail/94cda578d6dec4210037f9a2bfa8f274333e27cb/src/test/clj_pail/fakes/structure.clj | clojure | (ns clj-pail.fakes.structure
(:require [clj-pail.structure :as structure]
[clj-pail.serializer :as s]
[clj-pail.partitioner :as p])
(:use midje.open-protocols))
(defrecord-openly FakeSerializer []
s/Serializer
(s/serialize [this object] :fake)
(s/deserialize [this buffer] :fake))
(... | |
b090630a770bc29d367da5d5aa514def9a9a40c17c716e5dd2055bfbe470c76d | footprintanalytics/footprint-web | postgres.clj | (ns metabase.test.data.postgres
"Postgres driver test extensions."
(:require [metabase.test.data.interface :as tx]
[metabase.test.data.sql :as sql.tx]
[metabase.test.data.sql-jdbc :as sql-jdbc.tx]
[metabase.test.data.sql-jdbc.load-data :as load-data]
[metabase.test.da... | null | https://raw.githubusercontent.com/footprintanalytics/footprint-web/d3090d943dd9fcea493c236f79e7ef8a36ae17fc/test/metabase/test/data/postgres.clj | clojure | TODO - What?
add an additional statement to the front to kill open connections to the DB before dropping | (ns metabase.test.data.postgres
"Postgres driver test extensions."
(:require [metabase.test.data.interface :as tx]
[metabase.test.data.sql :as sql.tx]
[metabase.test.data.sql-jdbc :as sql-jdbc.tx]
[metabase.test.data.sql-jdbc.load-data :as load-data]
[metabase.test.da... |
c26a828d7cdbb7f2ae912e355a8e89a6fec828304719206ed566babddcc2b05d | adetokunbo/tmp-proc | SimpleServer.hs | # LANGUAGE DataKinds #
{-# LANGUAGE OverloadedStrings #-}
module Test.SimpleServer
( -- * functions
statusOfGet
, statusOfGet'
-- * test constants
, defaultTLSSettings
)
where
import Data.List (foldl')
import Data.Text (Text)
import qua... | null | https://raw.githubusercontent.com/adetokunbo/tmp-proc/9933efd6e6f046da019ff0dbf3332b13cbfe034e/tmp-proc/test/Test/SimpleServer.hs | haskell | # LANGUAGE OverloadedStrings #
* functions
* test constants
| The settings used in the integration tests
| Determine the status from a Get on localhost. | # LANGUAGE DataKinds #
module Test.SimpleServer
statusOfGet
, statusOfGet'
, defaultTLSSettings
)
where
import Data.List (foldl')
import Data.Text (Text)
import qualified Data.Text as Text
import qualified Network.Connectio... |
24fbdd4b3172d0832110e90f5c5bdcef27ed8729b5b00e049cea79bf8fa24f0d | wargrey/graphics | composite.rkt | #lang typed/racket
;;;
(require "../../constructor.rkt")
(require "../../composite.rkt")
(require "../../digitama/composite.rkt")
(require "../../digitama/base.rkt")
(require "../../digitama/unsafe/convert.rkt")
(define src : Bitmap (bitmap-rectangle 120 90 #:border #false #:fill (rgba 0.0 0.0 0.9 0.4)))
(define de... | null | https://raw.githubusercontent.com/wargrey/graphics/50751297f244a01ac734099b9a1e9be97cd36f3f/bitmap/tamer/composite/composite.rkt | racket | #lang typed/racket
(require "../../constructor.rkt")
(require "../../composite.rkt")
(require "../../digitama/composite.rkt")
(require "../../digitama/base.rkt")
(require "../../digitama/unsafe/convert.rkt")
(define src : Bitmap (bitmap-rectangle 120 90 #:border #false #:fill (rgba 0.0 0.0 0.9 0.4)))
(define dest : ... | |
7061ba746421e4025f9b4e6a70bc1bb9f44fbf4f7d65128bc0a7ac145b26d9f2 | aryx/fork-efuns | compil.ml | (*s: features/compil.ml *)
(*s: copyright header2 *)
(***********************************************************************)
(* *)
xlib for
(* *)
... | null | https://raw.githubusercontent.com/aryx/fork-efuns/8f2f8f66879d45e26ecdca0033f9c92aec2b783d/features/compil.ml | ocaml | s: features/compil.ml
s: copyright header2
*********************************************************************
... | xlib for
Fabrice Le Fessant , projet Para / SOR , INRIA Rocquencourt
Copyright 1998 Institut National de Recherche en Informatique et
Automatique . Distributed only by permission .
open Common
open Options
open Efuns
* todo :
* - han... |
d23a00e2a0af1cba96bec8f75a4493db4bcc52519ac32acd71c15c632e1acee1 | darkleaf/publicator | storage.clj | (ns publicator.persistence.storage
(:require
[jdbc.core :as jdbc]
[publicator.use-cases.abstractions.storage :as storage]
[publicator.domain.abstractions.aggregate :as aggregate]
[publicator.domain.abstractions.id-generator :as id-generator]
[publicator.domain.identity :as identity]
[publicator.util... | null | https://raw.githubusercontent.com/darkleaf/publicator/e07eee93d8f3d9c07a15d574619d5ea59c00f87d/persistence/src/publicator/persistence/storage.clj | clojure | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | (ns publicator.persistence.storage
(:require
[jdbc.core :as jdbc]
[publicator.use-cases.abstractions.storage :as storage]
[publicator.domain.abstractions.aggregate :as aggregate]
[publicator.domain.abstractions.id-generator :as id-generator]
[publicator.domain.identity :as identity]
[publicator.util... |
a6c6537169003e719c2ca4f114e4b9844b02ce6a68d81cd8f39c9b6a84f02077 | karimarttila/clojure | data.cljs | (ns worldstat.frontend.data
(:require [kixi.stats.core :as kixi]
[worldstat.frontend.log :as ws-log]
[worldstat.common.data.filter :as ws-filter]))
;; An alternative way to make the map.
;; But missing values must be handled some way.
#_(defn world-schema [points year]
{:schema "-lite/v4.... | null | https://raw.githubusercontent.com/karimarttila/clojure/ee1261b9a8e6be92cb47aeb325f82a278f2c1ed3/statistics/worldstat/src/cljs/worldstat/frontend/data.cljs | clojure | An alternative way to make the map.
But missing values must be handled some way.
:domain {:data "world" :field "value"}
If missing data show as grey. | (ns worldstat.frontend.data
(:require [kixi.stats.core :as kixi]
[worldstat.frontend.log :as ws-log]
[worldstat.common.data.filter :as ws-filter]))
#_(defn world-schema [points year]
{:schema "-lite/v4.json",
:width 800
:height 500
:data {:url "data/world-110m.json"
... |
7465447d121d0a4bf7ef0d78cae302423d34ca85dcfe3a4bc873383df762f1b8 | elaforge/karya | Util_test.hs | Copyright 2020
-- This program is distributed under the terms of the GNU General Public
-- License 3.0, see COPYING or -3.0.txt
module Synth.Sampler.Patch.Lib.Util_test where
import qualified Synth.Sampler.Patch.Lib.Util as Util
import qualified Synth.Shared.Control as Control
import qualified Synth.Shared.Note as... | null | https://raw.githubusercontent.com/elaforge/karya/471a2131f5a68b3b10b1a138e6f9ed1282980a18/Synth/Sampler/Patch/Lib/Util_test.hs | haskell | This program is distributed under the terms of the GNU General Public
License 3.0, see COPYING or -3.0.txt | Copyright 2020
module Synth.Sampler.Patch.Lib.Util_test where
import qualified Synth.Sampler.Patch.Lib.Util as Util
import qualified Synth.Shared.Control as Control
import qualified Synth.Shared.Note as Note
import qualified Synth.Shared.Signal as Signal
import Util.Test
test_dynEnvelope :: Test
test_... |
046026171f13e0393e23b3cf0ed01b274a7d33b3aeea3034aa7e17320f3d9e15 | sneerteam/sneer | router_connector.clj | (ns sneer.server.router-connector
(:require
[clojure.core.async :as async :refer [to-chan chan close! go <!! >!! thread alts!!]]
[clojure.core.async.impl.protocols :as impl]
[clojure.core.match :refer [match]]
[sneer.async :refer :all]
[sneer.commons :refer [empty-queue loop-state]]
[sneer.ser... | null | https://raw.githubusercontent.com/sneerteam/sneer/b093c46321a5a42ae9418df427dbb237489b7bcb/server/src/sneer/server/router_connector.clj | clojure | (ns sneer.server.router-connector
(:require
[clojure.core.async :as async :refer [to-chan chan close! go <!! >!! thread alts!!]]
[clojure.core.async.impl.protocols :as impl]
[clojure.core.match :refer [match]]
[sneer.async :refer :all]
[sneer.commons :refer [empty-queue loop-state]]
[sneer.ser... | |
442f2a198d7ec433a7486be99d0465cf9fc8b5db163c83cb1a855235184041df | karimarttila/clojure | users_single_node.clj | (ns simpleserver.userdb.users-single-node
(:require
[clojure.tools.logging :as log]
[simpleserver.userdb.users-service-interface :as ss-users-service-interface]
[simpleserver.userdb.initial-users :as ss-users-initial-users]))
(defn uuid
[]
(.toString (java.util.UUID/randomUUID)))
(defn -get-test-us... | null | https://raw.githubusercontent.com/karimarttila/clojure/ee1261b9a8e6be92cb47aeb325f82a278f2c1ed3/clj-ring-cljs-reagent-demo/simple-server/src/simpleserver/userdb/users_single_node.clj | clojure | (ns simpleserver.userdb.users-single-node
(:require
[clojure.tools.logging :as log]
[simpleserver.userdb.users-service-interface :as ss-users-service-interface]
[simpleserver.userdb.initial-users :as ss-users-initial-users]))
(defn uuid
[]
(.toString (java.util.UUID/randomUUID)))
(defn -get-test-us... | |
6674830cd58c7d97d34a1aee2e5920f7de3a342132b7d862765fcb583691215f | HaskellEmbedded/data-stm32 | X.hs | {-# LANGUAGE Rank2Types #-}
module {{ modns }}
( module Ivory.BSP.STM32.Peripheral.{{ type }}.Peripheral
) where
import Ivory.BSP.STM32.Peripheral.{{ type }}.Peripheral
| null | https://raw.githubusercontent.com/HaskellEmbedded/data-stm32/204aff53eaae422d30516039719a6ec7522a6ab7/templates/STM32/Driver/X.hs | haskell | # LANGUAGE Rank2Types # |
module {{ modns }}
( module Ivory.BSP.STM32.Peripheral.{{ type }}.Peripheral
) where
import Ivory.BSP.STM32.Peripheral.{{ type }}.Peripheral
|
9df5216af6d4fed3ef739ec3f30a3e0bae1b184b364318bb0c959c044313b2fa | onyx-platform/learn-onyx | challenge_5_1_test.clj | (ns workshop.jobs.challenge-5-1-test
(:require [clojure.test :refer [deftest is]]
[onyx.test-helper :refer [with-test-env feedback-exception!]]
[workshop.challenge-5-1 :as c]
[workshop.workshop-utils :as u]
[onyx.api]))
;; Try your hand at flow conditions by routing
;;... | null | https://raw.githubusercontent.com/onyx-platform/learn-onyx/6bf1936f35d26e3c8cf171b5971e1bc95e82b3c8/test/workshop/jobs/challenge_5_1_test.clj | clojure | Try your hand at flow conditions by routing
user segments to different tasks based on their :role key
from the :identity task. Check the expected outputs to create
the correct flow conditions data structure and predicates.
Try it with:
| (ns workshop.jobs.challenge-5-1-test
(:require [clojure.test :refer [deftest is]]
[onyx.test-helper :refer [with-test-env feedback-exception!]]
[workshop.challenge-5-1 :as c]
[workshop.workshop-utils :as u]
[onyx.api]))
` lein test workshop.jobs.challenge-5 - 1 - tes... |
3aec431a4ce7986d9117095176ad20f33e7c98b9cb97744ff9605e6804650f12 | mflatt/shrubbery-rhombus-0 | expression+binding.rkt | #lang racket/base
(require (for-syntax racket/base)
"expression.rkt"
"binding.rkt")
(provide (for-syntax make-expression+binding-prefix-operator
make-expression+binding-infix-operator))
(begin-for-syntax
(struct expression+binding-prefix-operator (exp-op bind-op)
#:propert... | null | https://raw.githubusercontent.com/mflatt/shrubbery-rhombus-0/7fd47ef002d6b7c2f43de6563b0df34a0bc1e1f7/rhombus/private/expression%2Bbinding.rkt | racket | #lang racket/base
(require (for-syntax racket/base)
"expression.rkt"
"binding.rkt")
(provide (for-syntax make-expression+binding-prefix-operator
make-expression+binding-infix-operator))
(begin-for-syntax
(struct expression+binding-prefix-operator (exp-op bind-op)
#:propert... | |
a9c11e7e8579ec8abe82c04ccd517a61721d20a2e7b4663b26131547a5209c68 | objectionary/try-phi | Graph.hs | # OPTIONS_GHC -Wall -fno - warn - orphans #
# LANGUAGE LambdaCase #
module Phi.Minimal.Graph where
import Phi.Minimal.Model
import Phi.Utils.GraphBuilder
import Control.Monad (forM_)
import Data.Graph.Inductive.Graph (DynGraph)
import qualified Data.Graph.Inductiv... | null | https://raw.githubusercontent.com/objectionary/try-phi/4adae4bf7b9c9604d61a00cd9e5ef228a9b188db/back/language-utils/phi-utils/src/Phi/Minimal/Graph.hs | haskell | TO-DO put locators, data, not strings on edges | # OPTIONS_GHC -Wall -fno - warn - orphans #
# LANGUAGE LambdaCase #
module Phi.Minimal.Graph where
import Phi.Minimal.Model
import Phi.Utils.GraphBuilder
import Control.Monad (forM_)
import Data.Graph.Inductive.Graph (DynGraph)
import qualified Data.Graph.Inductiv... |
d04b1c340a30a85913b3953efac8ce0e5f3578f2be728f7822498a6c85868001 | PrincetonUniversity/lucid | TyperUtil.ml | open Syntax
open SyntaxUtils
open Collections
open Batteries
(* Region-like levels for efficient implementation of type generalization
code following #levels
*)
Since we currently only generalize at DFuns , the whole level setup is
overkill , but it 'll be handy if we get more functional later on .
overki... | null | https://raw.githubusercontent.com/PrincetonUniversity/lucid/7dc2963bf42717bf939ca924d18a16d660cb00f8/src/lib/frontend/typing/TyperUtil.ml | ocaml | Region-like levels for efficient implementation of type generalization
code following #levels
** Global information **
Maps labels to the gty with that label
** Information we use while typechecking function/handler bodies **
Maps vector index vars to their max size and an alpha-renamed cid
Some iff we're in ... | open Syntax
open SyntaxUtils
open Collections
open Batteries
Since we currently only generalize at DFuns , the whole level setup is
overkill , but it 'll be handy if we get more functional later on .
overkill, but it'll be handy if we get more functional later on. *)
let current_level = ref 0
let enter_level... |
f49a5917f9dbf391a95af14da7cc12d695a1e89d33f168bfc68044f9c4a7a830 | jacekschae/learn-pedestal-course-files | api_server.clj | (ns cheffy.components.api-server
(:require [com.stuartsierra.component :as component]
[io.pedestal.http :as http]
[cheffy.routes :as routes]
[io.pedestal.interceptor :as interceptor]))
(defn inject-system
[system]
(interceptor/interceptor
{:name ::inject-system
:ente... | null | https://raw.githubusercontent.com/jacekschae/learn-pedestal-course-files/929629d83e5f08f239b689dc15f1d84844029b22/increments/18-dev-interceptors/src/main/cheffy/components/api_server.clj | clojure | (ns cheffy.components.api-server
(:require [com.stuartsierra.component :as component]
[io.pedestal.http :as http]
[cheffy.routes :as routes]
[io.pedestal.interceptor :as interceptor]))
(defn inject-system
[system]
(interceptor/interceptor
{:name ::inject-system
:ente... | |
7d7a226f4ab3b08f165705a10bf35acb4d61f67aeec5410f8d03811c932cd6b5 | ghcjs/ghcjs | stm007.hs | # LANGUAGE ScopedTypeVariables #
testcase by
import Control.Concurrent
import Control.Concurrent.STM
import qualified Control.Exception as E
test x = x `E.catch` \(e::E.SomeException) -> print e
main = do
(a,b) <- atomically $
do a <- newTVar True
b <- newTVar True
always (writ... | null | https://raw.githubusercontent.com/ghcjs/ghcjs/e4cd4232a31f6371c761acd93853702f4c7ca74c/test/conc/stm007.hs | haskell | Should not fail
Should fail
expected output:
Testing b
Testing a
*** Exception: Transactional invariant violation
| # LANGUAGE ScopedTypeVariables #
testcase by
import Control.Concurrent
import Control.Concurrent.STM
import qualified Control.Exception as E
test x = x `E.catch` \(e::E.SomeException) -> print e
main = do
(a,b) <- atomically $
do a <- newTVar True
b <- newTVar True
always (writ... |
8530f40851ad89580c20c762be53e1551667ee69c62d084c8ca6c817eb1ff075 | r0man/grafeo | transform.cljc | (ns grafeo.transform
(:require [grafeo.util :as util]))
(def ^:dynamic *naming-strategies*
"The default naming strategies."
{:alumbra/argument-name util/underscore
:alumbra/directive-name util/underscore
:alumbra/enum util/underscore
:alumbra/field-alias util/underscore
:alumbra/field-name util/under... | null | https://raw.githubusercontent.com/r0man/grafeo/087449efe0dda93eb3aca3ec733d392550cd3562/src/grafeo/transform.cljc | clojure | Transformation | (ns grafeo.transform
(:require [grafeo.util :as util]))
(def ^:dynamic *naming-strategies*
"The default naming strategies."
{:alumbra/argument-name util/underscore
:alumbra/directive-name util/underscore
:alumbra/enum util/underscore
:alumbra/field-alias util/underscore
:alumbra/field-name util/under... |
14dfcf8107741b9302a2221e40c494d1cd2271454f3949fe12cef81220a2d850 | backtracking/ocamlgraph | dGraphViewer.ml | (**************************************************************************)
(* *)
(* This file is part of OcamlGraph. *)
(* *)
Copyright... | null | https://raw.githubusercontent.com/backtracking/ocamlgraph/1c028af097339ca8bc379436f7bd9477fa3a49cd/dgraph/dGraphViewer.ml | ocaml | ************************************************************************
This file is part of OcamlGraph.
... | Copyright ( C ) 2009 - 2010
CEA ( Commissariat � l' � )
Lesser General Public License as published by the Free Software
Foundation , version 2.1 , with a linking exception .
( ) ... |
163cc28612fb5290918e1af54b003ffea8d6e63daeb05113b9d1a6980dac2b35 | sondresl/AdventOfCode | Day01.hs | module Day01 where
import Lib (linedNums)
import Data.Maybe (listToMaybe)
part1 :: [Int] -> Maybe Int
part1 input =
listToMaybe
[ x * y
| x <- input
, y <- input
, x + y == 2020
]
part2 :: [Int] -> Maybe Int
part2 input =
listToMaybe
[ x * y * z
| x <- input
, y <- input
, z <... | null | https://raw.githubusercontent.com/sondresl/AdventOfCode/51525441795417f31b3eb67a690aa5534d1e699b/2020/Haskell/src/Day01.hs | haskell | module Day01 where
import Lib (linedNums)
import Data.Maybe (listToMaybe)
part1 :: [Int] -> Maybe Int
part1 input =
listToMaybe
[ x * y
| x <- input
, y <- input
, x + y == 2020
]
part2 :: [Int] -> Maybe Int
part2 input =
listToMaybe
[ x * y * z
| x <- input
, y <- input
, z <... | |
5213e87e0251d1f2d653b7000f304805d56662ff4eb3c008adc1df4aa3c87b3f | manuel-serrano/bigloo | music.scm | ;*=====================================================================*/
;* .../prgm/project/bigloo/api/pulseaudio/src/Llib/music.scm */
;* ------------------------------------------------------------- */
* Author : * /
* Creation : Sat Jun 25... | null | https://raw.githubusercontent.com/manuel-serrano/bigloo/eb650ed4429155f795a32465e009706bbf1b8d74/api/pulseaudio/src/Llib/music.scm | scheme | *=====================================================================*/
* .../prgm/project/bigloo/api/pulseaudio/src/Llib/music.scm */
* ------------------------------------------------------------- */
* ------------------------------------------------------------- */
* A (multimedia) music pl... | * Author : * /
* Creation : Sat Jun 25 06:55:51 2011 * /
* Last change : Thu Jan 28 14:48:53 2016 ( serrano ) * /
* Copyright : 2011 - 16 * /
(module __pulseaudio_music
... |
b76385f22b0be951f0d03e7a084c72e4ecb69a7e0648d692b4dcdd5f4ecff1b2 | Incubaid/arakoon | arakoon_remote_client.ml |
Copyright ( 2010 - 2014 ) INCUBAID BVBA
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
distribut... | null | https://raw.githubusercontent.com/Incubaid/arakoon/43a8d0b26e4876ef91d9657149f105c7e57e0cb0/src/client/arakoon_remote_client.ml | ocaml |
Copyright ( 2010 - 2014 ) INCUBAID BVBA
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
distribut... | |
ca4ffa19b21c91ecf81d437701d368ec56141b6190f422a9372e1bfce9f2c841 | patrickt/possession | Resource.hs | module UI.Resource
( Resource (..),
Widget,
Event,
EventM,
)
where
import qualified Brick
import Game.Action (UIAction)
-- | Names visible widgets in the UI.
data Resource
= Modeline
| Canvas
| MainMenu
| Look
| Readout
| Unspecified
deriving (Eq, Show, Ord)
type Widget = Brick.Widget R... | null | https://raw.githubusercontent.com/patrickt/possession/81db7d016c70c968c7d36210f8bcc9a21224d600/src/UI/Resource.hs | haskell | | Names visible widgets in the UI. | module UI.Resource
( Resource (..),
Widget,
Event,
EventM,
)
where
import qualified Brick
import Game.Action (UIAction)
data Resource
= Modeline
| Canvas
| MainMenu
| Look
| Readout
| Unspecified
deriving (Eq, Show, Ord)
type Widget = Brick.Widget Resource
type Event = Brick.BrickEvent ... |
d76e8e3069064024a74c50b11a4b4d6ff9a097947e131a494e469c504a2d83e6 | Convex-Dev/convex-web | encoding.clj | (ns convex-web.encoding
(:require [cognitect.transit :as t]
[clojure.java.io :as io]
[clojure.tools.logging :as log])
(:import (java.io ByteArrayOutputStream InputStream)))
(defn transit-decode-string
"Decode a Transit-JSON encoded string `s`."
[^String s]
(t/read (t/reader (io/input-... | null | https://raw.githubusercontent.com/Convex-Dev/convex-web/565a40da62b24a0caa8b26d0490edfd91c542d55/src/main/clojure/convex_web/encoding.clj | clojure | or as `(str x)` if the encoding fails. | (ns convex-web.encoding
(:require [cognitect.transit :as t]
[clojure.java.io :as io]
[clojure.tools.logging :as log])
(:import (java.io ByteArrayOutputStream InputStream)))
(defn transit-decode-string
"Decode a Transit-JSON encoded string `s`."
[^String s]
(t/read (t/reader (io/input-... |
7ecc0db5afd08ac220958c19ced69132cde7af43b226c837f154c0fbb9b434d6 | vbedegi/re-alm | core.cljs | (ns svg.core
(:require-macros [cljs.core.match :refer [match]])
(:require [clojure.string :as str]
[cljs.core.match :as m]
[re-alm.core :as ra]
[re-alm.boot :as boot]
[re-alm.io.time :as time]))
(enable-console-print!)
(defn- make-path [cx cy w c]
(let [right (* c... | null | https://raw.githubusercontent.com/vbedegi/re-alm/73fdb86b2cb92bec16865be44b101361e7e84115/examples/svg/src/svg/core.cljs | clojure | (ns svg.core
(:require-macros [cljs.core.match :refer [match]])
(:require [clojure.string :as str]
[cljs.core.match :as m]
[re-alm.core :as ra]
[re-alm.boot :as boot]
[re-alm.io.time :as time]))
(enable-console-print!)
(defn- make-path [cx cy w c]
(let [right (* c... | |
1129242410748a30e13d9c44e92c981da4aae5aa3eb013c1f5d879160d4a31cf | ocaml-multicore/tezos | test_tez_repr.ml | (*****************************************************************************)
(* *)
(* Open Source License *)
Copyright ( c ) 2021 Nomadic Labs < >
(* ... | null | https://raw.githubusercontent.com/ocaml-multicore/tezos/e4fd21a1cb02d194b3162ab42d512b7c985ee8a9/src/proto_alpha/lib_protocol/test/pbt/test_tez_repr.ml | ocaml | ***************************************************************************
Open Source License
Permission is h... | Copyright ( c ) 2021 Nomadic Labs < >
to deal in the Software without restriction , including without limitation
and/or sell copies of the Software , and to permit persons to whom the
THE SOFTWARE IS PROVIDED " AS IS " , WITHOUT WARRANTY OF ANY KIND , EXPRESS OR
LIABILITY , WHETHER IN AN... |
f926b6baaad0d7c78de71a2f02a5aa149a53a26dcc00843f1356bc82d6734ef9 | adityaathalye/clojure-by-example | ex05_immutability_and_fp.clj | (ns clojure-by-example.ex05-immutability-and-fp)
;; Ex05: Lesson Goals
;; - This section is more conceptual, than exercise-oriented.
;;
;; - Set you up with some important ideas, which we will use heavily
in the final section ( and in all our Clojure programs )
;; - All values are immutable by default (and we li... | null | https://raw.githubusercontent.com/adityaathalye/clojure-by-example/6390163ffb7f887f107c007168499cba259bd90a/src/clojure_by_example/ex05_immutability_and_fp.clj | clojure | Ex05: Lesson Goals
- This section is more conceptual, than exercise-oriented.
- Set you up with some important ideas, which we will use heavily
- All values are immutable by default (and we like it this way)
- What `def` is
- Why you should avoid global defs
- What are "pure functions"?
- Don't forget... | (ns clojure-by-example.ex05-immutability-and-fp)
in the final section ( and in all our Clojure programs )
Previously , in Clojure by Example :
- We either only queried one or more planets ,
(def pi 3.141)
add one to pi
(assoc {:a 1}
:b 2
:c 3)
(assoc {:a 1 :b 2}
:b 99)
(disso... |
33e74197fcaf94cc0ec92a5f04f63677c391c5fc5d0e001f9b3d167b95201331 | flora-pm/flora-server | User.hs | # LANGUAGE UndecidableInstances #
# OPTIONS_GHC -fno - warn - orphans -Wno - redundant - constraints #
module Flora.Model.User
( UserId (..)
, User (..)
, UserFlags (..)
, UserCreationForm (..)
, AdminCreationForm (..)
, mkUser
, mkAdmin
, hashPassword
, validatePassword
)
where
import Control.Dee... | null | https://raw.githubusercontent.com/flora-pm/flora-server/c214c0b5d5db71a8330eb69326284be5a4d5e858/src/core/Flora/Model/User.hs | haskell | | Type error! Do not use 'display' on a 'Password'! | # LANGUAGE UndecidableInstances #
# OPTIONS_GHC -fno - warn - orphans -Wno - redundant - constraints #
module Flora.Model.User
( UserId (..)
, User (..)
, UserFlags (..)
, UserCreationForm (..)
, AdminCreationForm (..)
, mkUser
, mkAdmin
, hashPassword
, validatePassword
)
where
import Control.Dee... |
c9e0a016eec5a33c60df68b2874e1ad327731bda1908ffcbac63a25273879f9f | ds-wizard/engine-backend | Detail_PUT.hs | module Wizard.Api.Handler.DocumentTemplateDraft.Detail_PUT where
import Servant
import Shared.Api.Handler.Common
import Shared.Model.Context.TransactionState
import Wizard.Api.Handler.Common
import Wizard.Api.Resource.DocumentTemplate.Draft.DocumentTemplateDraftChangeDTO
import Wizard.Api.Resource.DocumentTemplate.Dr... | null | https://raw.githubusercontent.com/ds-wizard/engine-backend/d392b751192a646064305d3534c57becaa229f28/engine-wizard/src/Wizard/Api/Handler/DocumentTemplateDraft/Detail_PUT.hs | haskell | module Wizard.Api.Handler.DocumentTemplateDraft.Detail_PUT where
import Servant
import Shared.Api.Handler.Common
import Shared.Model.Context.TransactionState
import Wizard.Api.Handler.Common
import Wizard.Api.Resource.DocumentTemplate.Draft.DocumentTemplateDraftChangeDTO
import Wizard.Api.Resource.DocumentTemplate.Dr... | |
bdbf67be2162b8c9752e9086331261d70ed1b19d5005b1612532cccbdaaa3920 | immoh/swagger-spec | spec_test.cljc | (ns swagger.spec-test
(:require [clojure.spec.alpha :as s]
[clojure.spec.gen.alpha :as gen]
[clojure.test :refer [deftest is]]
[swagger.spec]
[clojure.test.check.generators]
#?@(:cljs [[cljs-node-io.core :as io :refer [slurp file-seq]]
[cljsjs.js-yaml... | null | https://raw.githubusercontent.com/immoh/swagger-spec/1fef8c106b07e7d7ad12fbda87ccd7d32b9f08d8/test/swagger/spec_test.cljc | clojure | (ns swagger.spec-test
(:require [clojure.spec.alpha :as s]
[clojure.spec.gen.alpha :as gen]
[clojure.test :refer [deftest is]]
[swagger.spec]
[clojure.test.check.generators]
#?@(:cljs [[cljs-node-io.core :as io :refer [slurp file-seq]]
[cljsjs.js-yaml... | |
cbd43bb3e40ef5e3319fb5801d624947c6ed77e583be535a775319b1d980c58c | EFanZh/EOPL-Exercises | exercise-2.25-test.rkt | #lang racket/base
(require rackunit)
(require "../solutions/exercise-2.25.rkt")
(define tree-1
(interior-node 'foo (leaf-node 2) (leaf-node 3)))
(define tree-2
(interior-node 'bar (leaf-node -1) tree-1))
(define tree-3
(interior-node 'baz tree-2 (leaf-node 1)))
(check-eqv? (max-interior tree-2) 'foo)
(check-... | null | https://raw.githubusercontent.com/EFanZh/EOPL-Exercises/11667f1e84a1a3e300c2182630b56db3e3d9246a/tests/exercise-2.25-test.rkt | racket | #lang racket/base
(require rackunit)
(require "../solutions/exercise-2.25.rkt")
(define tree-1
(interior-node 'foo (leaf-node 2) (leaf-node 3)))
(define tree-2
(interior-node 'bar (leaf-node -1) tree-1))
(define tree-3
(interior-node 'baz tree-2 (leaf-node 1)))
(check-eqv? (max-interior tree-2) 'foo)
(check-... | |
78476ba17ff59618ae8bfac2cc02f538413b7429edd33e64d36dc5d1a605b0a6 | jlesquembre/clj-nix | tasks.clj | (ns cljnix.tasks
(:require
[clojure.spec.alpha :as s]
[clojure.core.specs.alpha :as specs]
[edamame.core :refer [parse-string-all]]
[charred.api :as charred])
(:gen-class))
(defn parse-src
[file]
(let [src (-> file
slurp
(parse-string-all {:syntax-quote true}))]
... | null | https://raw.githubusercontent.com/jlesquembre/clj-nix/1e4fb5b0104fed4575be2b4a215edb1c30a749f0/extra-pkgs/bbTasks/src/cljnix/tasks.clj | clojure | (ns cljnix.tasks
(:require
[clojure.spec.alpha :as s]
[clojure.core.specs.alpha :as specs]
[edamame.core :refer [parse-string-all]]
[charred.api :as charred])
(:gen-class))
(defn parse-src
[file]
(let [src (-> file
slurp
(parse-string-all {:syntax-quote true}))]
... | |
598933b794e9c3d37c20b88376f652ba6caf06dc17047a1b6f0a49e6149df8a5 | riaqn/china-dns | ZhinaDNS.hs | module ZhinaDNS where
import qualified Resolve.Types as R
import Resolve.DNS.Types hiding (Query, Response)
import Resolve.DNS.Lookup hiding (Config)
import qualified IPSet
import qualified NameSet
import Control.Monad
import Control.Monad.Trans.Except
import Control.Concurrent
import Control.Exception
import Contro... | null | https://raw.githubusercontent.com/riaqn/china-dns/14e2fbfc1f88cae346c381b402889f7a182ddf31/src/ZhinaDNS.hs | haskell | module ZhinaDNS where
import qualified Resolve.Types as R
import Resolve.DNS.Types hiding (Query, Response)
import Resolve.DNS.Lookup hiding (Config)
import qualified IPSet
import qualified NameSet
import Control.Monad
import Control.Monad.Trans.Except
import Control.Concurrent
import Control.Exception
import Contro... | |
23fb920848c1b7ce662889b27aa66131e3e314ed4ca5224042a0f7e069ee2965 | yav/hobbit | Pass.hs | module Pass (Pass, runPass, msg, err, warn, io) where
import UI.ANSI
import System.Exit
import MonadLib
newtype Pass a = P { unP :: ExceptionT [String] (WriterT [String] IO) a }
instance Monad Pass where
return = P . return
m >>= f = P (unP m >>= (unP . f))
instance Functor Pass where... | null | https://raw.githubusercontent.com/yav/hobbit/31414ba1188f4b39620c2553b45b9e4d4aa40169/src/Pass.hs | haskell | module Pass (Pass, runPass, msg, err, warn, io) where
import UI.ANSI
import System.Exit
import MonadLib
newtype Pass a = P { unP :: ExceptionT [String] (WriterT [String] IO) a }
instance Monad Pass where
return = P . return
m >>= f = P (unP m >>= (unP . f))
instance Functor Pass where... | |
b92f8ae9cdc261d33aa38f02d532a3e5ad2fc07f7ae9c670882d92d520b5c823 | facebookarchive/lex-pass | ArgList.hs | module Lang.Php.Ast.ArgList where
import Data.Either.Utils
import qualified Data.List.NonEmpty as NE
import Lang.Php.Ast.Common
import Lang.Php.Ast.Lex
type ArgList a = Either WS [WSCap a]
type ReqArgList a = NE.NonEmpty (WSCap a)
argListUnparser :: Unparse a => Unparser (ArgList a)
argListUnparser x =
tokLParen... | null | https://raw.githubusercontent.com/facebookarchive/lex-pass/dcfa9560a95f2c1344e15493dabcc1645b1ca5e8/src/Lang/Php/Ast/ArgList.hs | haskell | e.g. ($a, $b, $c) in isset($a, $b, $c)
todo: this can just be separate right?
e.g. ($a) in exit($a) or () in exit() | module Lang.Php.Ast.ArgList where
import Data.Either.Utils
import qualified Data.List.NonEmpty as NE
import Lang.Php.Ast.Common
import Lang.Php.Ast.Lex
type ArgList a = Either WS [WSCap a]
type ReqArgList a = NE.NonEmpty (WSCap a)
argListUnparser :: Unparse a => Unparser (ArgList a)
argListUnparser x =
tokLParen... |
cc40b41b73c51122fcbac97025f1a2517fdf29dbda129efd5023fd39e463f49f | opennars/Narjure | repl.clj | (ns narjure.repl
(:require [clojure.string :as s]
[narjure.narsese :refer [parse]]
[instaparse.core :as i]
[nal.core :as c]
[clojure.core.logic :as l]
[clojure.string :refer [trim]]
[clojure.pprint :as p]
[clojure.tools.nrepl.middlewa... | null | https://raw.githubusercontent.com/opennars/Narjure/cd5a72e6777fc47271d721fef8362aa2dad664ca/src/narjure/repl.clj | clojure | (ns narjure.repl
(:require [clojure.string :as s]
[narjure.narsese :refer [parse]]
[instaparse.core :as i]
[nal.core :as c]
[clojure.core.logic :as l]
[clojure.string :refer [trim]]
[clojure.pprint :as p]
[clojure.tools.nrepl.middlewa... | |
8e571a6f9dbf3280be1795e346b47e55f04046f128a52877cbdaa71139e2a359 | jwaldmann/haskell-obdd | Data.hs | # language GeneralizedNewtypeDeriving #
# language RecursiveDo #
{-# language FlexibleContexts #-}
{-# language TupleSections #-}
-- | implementation of reduced ordered binary decision diagrams.
module OBDD.Data
(
-- * the data type
OBDD -- abstract
, size
-- * for external use
, null, satisfiable
, number_of_mode... | null | https://raw.githubusercontent.com/jwaldmann/haskell-obdd/537f710bc3eb6d06370659fd8c79f4da94554aeb/src/OBDD/Data.hs | haskell | # language FlexibleContexts #
# language TupleSections #
| implementation of reduced ordered binary decision diagrams.
* the data type
abstract
* for external use
* for internal use
newtype Index = Index { unIndex :: Int }
| assumes total ordering on variables
, icore :: !(Map ( Node v Index ) Index)
| Apply f... | # language GeneralizedNewtypeDeriving #
# language RecursiveDo #
module OBDD.Data
(
, size
, null, satisfiable
, number_of_models
, variables, paths, models
, some_model
, fold, foldM
, full_fold, full_foldM
, Node (..)
, make
, register, checked_register
, top
, access
, not_
, assocs
)
where
import Data.IntMap.... |
ebccf036b48a9f1e16fa963a26d149253d516130d12f5617b929e904fa01e1f8 | serokell/avl-plus | Algorithm.hs | module Algorithm (tests) where
import Common
import qualified Data.Tree.AVL as AVL
tests :: Spec
tests = describe "Algorithms" $ do
describe "WithBounds" $ do
it "forall a . Bottom < Plain a < Top" $ \a ->
AVL.Bottom < AVL.Plain a && AVL.Plain a < AVL.Top
| null | https://raw.githubusercontent.com/serokell/avl-plus/3fb3933f4f11f282e8c498d128c3e5c79518ea9b/test/Algorithm.hs | haskell | module Algorithm (tests) where
import Common
import qualified Data.Tree.AVL as AVL
tests :: Spec
tests = describe "Algorithms" $ do
describe "WithBounds" $ do
it "forall a . Bottom < Plain a < Top" $ \a ->
AVL.Bottom < AVL.Plain a && AVL.Plain a < AVL.Top
| |
682bb3375bcacfd677d15dc1a9b50b7a02c8035b3de60a6b832542d90952d2ad | dvcrn/markright | markdown.cljs | (ns markright.components.markdown
(:require [om.next :as om :refer-macros [defui]]
[om.dom :as dom :include-macros true]
[goog.dom :as gdom]))
(def current-path (atom ""))
(defn fill-markdown [_]
(let [md (. js/document (getElementById "parsed-markdown"))
h (.-innerHeight js/window... | null | https://raw.githubusercontent.com/dvcrn/markright/531a47524474d5c2945148e33d397d0c70171cb5/src/cljs/markright/components/markdown.cljs | clojure | To make sure we always use the real path for transforming | (ns markright.components.markdown
(:require [om.next :as om :refer-macros [defui]]
[om.dom :as dom :include-macros true]
[goog.dom :as gdom]))
(def current-path (atom ""))
(defn fill-markdown [_]
(let [md (. js/document (getElementById "parsed-markdown"))
h (.-innerHeight js/window... |
f1632580bb02c161fa99c14221b1c4beb63fb75d939440c49bbed2dede1bd184 | MLstate/opalang | opa_ResolveJsIdent.ml |
Copyright © 2011 , 2012 MLstate
This file is part of .
is free software : you can redistribute it and/or modify it under the
terms of the GNU Affero General Public License , version 3 , as published by
the Free Software Foundation .
is distributed in the hope that it will be us... | null | https://raw.githubusercontent.com/MLstate/opalang/424b369160ce693406cece6ac033d75d85f5df4f/compiler/opa/opa_ResolveJsIdent.ml | ocaml | alias
shorthands |
Copyright © 2011 , 2012 MLstate
This file is part of .
is free software : you can redistribute it and/or modify it under the
terms of the GNU Affero General Public License , version 3 , as published by
the Free Software Foundation .
is distributed in the hope that it will be us... |
e306338c3958320c7b8dbd3e1789dd1b6c63e56f17a90675e2f667038bc746ef | composewell/streamly | Instances.hs | ------------------------------------------------------------------------------
CPP macros for common instances
------------------------------------------------------------------------------
XXX use template haskell instead and include Monoid and IsStream instances
-- as well.
#define MONADPARALLEL , MonadAsync m
... | null | https://raw.githubusercontent.com/composewell/streamly/449d48d379310d1b2a1b22be0c49a9ae29925dff/src/Streamly/Internal/Data/Stream/Instances.hs | haskell | ----------------------------------------------------------------------------
----------------------------------------------------------------------------
as well.
# INLINE (<$) #
# INLINE get #
# INLINE state #
----------------------------------------------------------------------------
Lists
------------------------... | CPP macros for common instances
XXX use template haskell instead and include Monoid and IsStream instances
#define MONADPARALLEL , MonadAsync m
#define MONAD_COMMON_INSTANCES(STREAM,CONSTRAINT) \
instance Monad m => Functor (STREAM m) where { \
# INLINE ... |
3f6f6d6e092366b9f88135d38084be6b75ba6aac04b9fd286cd8775338c8dcf1 | scrintal/heroicons-reagent | check.cljs | (ns com.scrintal.heroicons.mini.check)
(defn render []
[:svg {:xmlns ""
:viewBox "0 0 20 20"
:fill "currentColor"
:aria-hidden "true"}
[:path {:fillRule "evenodd"
:d "M16.704 4.153a.75.75 0 01.143 1.052l-8 10.5a.75.75 0 01-1.127.075l-4.5-4.5a.75.75 0 0... | null | https://raw.githubusercontent.com/scrintal/heroicons-reagent/572f51d2466697ec4d38813663ee2588960365b6/src/com/scrintal/heroicons/mini/check.cljs | clojure | (ns com.scrintal.heroicons.mini.check)
(defn render []
[:svg {:xmlns ""
:viewBox "0 0 20 20"
:fill "currentColor"
:aria-hidden "true"}
[:path {:fillRule "evenodd"
:d "M16.704 4.153a.75.75 0 01.143 1.052l-8 10.5a.75.75 0 01-1.127.075l-4.5-4.5a.75.75 0 0... | |
e7c119513fd6ad7158a9bed73132d16fa772bf3409fd4097d56d9c8a500573e8 | j-cr/speck | utils.clj | (ns speck.v1.utils
(:require [clojure.spec.alpha :as s]))
(defn maybe-conform [spec x]
(let [res (s/conform spec x)]
(if (= res ::s/invalid)
(throw (ex-info (s/explain-str spec x)
(s/explain-data spec x)))
res)))
| null | https://raw.githubusercontent.com/j-cr/speck/dfa4068fd06a31471223feefd88e82afe4d61ceb/src/speck/v1/utils.clj | clojure | (ns speck.v1.utils
(:require [clojure.spec.alpha :as s]))
(defn maybe-conform [spec x]
(let [res (s/conform spec x)]
(if (= res ::s/invalid)
(throw (ex-info (s/explain-str spec x)
(s/explain-data spec x)))
res)))
| |
44d0a65b4a7eba9f686356c02cdc51cb7c5ae19d073b5a84b48876dc3957d452 | GaloisInc/macaw | Memory.hs | |
Copyright : ( c ) Galois Inc , 2015 - 2018
Maintainer :
Declares ' Memory ' , a type for representing segmented memory with permissions .
Copyright : (c) Galois Inc, 2015-2018
Maintainer :
Declares 'Memory', a type for representing segmented memory with permissions.
-}
# LANGUAGE DataKinds #
{-# L... | null | https://raw.githubusercontent.com/GaloisInc/macaw/9d2e1d4b9f163c8947a284c2031000c54a3a9330/base/src/Data/Macaw/Memory.hs | haskell | # LANGUAGE DeriveLift #
# LANGUAGE GADTs #
# LANGUAGE OverloadedStrings #
# LANGUAGE RankNTypes #
* Inspecting memory
* Constructing memory
* Load values
* Memory segments
* MemInt
* Addresses
* Segment offsets
** Queries
** Construction segment offsets.
** Modifying
* Reading
* AddrWidthRepr
* Endianness
... | |
Copyright : ( c ) Galois Inc , 2015 - 2018
Maintainer :
Declares ' Memory ' , a type for representing segmented memory with permissions .
Copyright : (c) Galois Inc, 2015-2018
Maintainer :
Declares 'Memory', a type for representing segmented memory with permissions.
-}
# LANGUAGE DataKinds #
# LAN... |
f0f620e164b5caef1fb61a9a4f831afcdd41d0e51c54df032f731bfe32d2b656 | fossas/fossa-cli | Filters.hs | # LANGUAGE RecordWildCards #
# LANGUAGE RoleAnnotations #
module Discovery.Filters (
AllFilters (..),
targetFilterParser,
applyFilters,
FilterCombination,
FilterMatch (..),
FilterResult (..),
apply,
filterIsVSIOnly,
comboInclude,
comboExclude,
combinedPaths,
combinedTargets,
Include,
Exclud... | null | https://raw.githubusercontent.com/fossas/fossa-cli/62c25adda99bab2c80ef78ee78206a14ad0ab0fa/src/Discovery/Filters.hs | haskell | | filterIsVSIOnly is a very naive check for whether the user provided a filter for the VSI target *only*, at the root of the project with no path specified.
This decision was made because predicating VSI only scans is a stopgap until we have more broad support for *preemptive* analysis filtering.
VSI supports very l... | # LANGUAGE RecordWildCards #
# LANGUAGE RoleAnnotations #
module Discovery.Filters (
AllFilters (..),
targetFilterParser,
applyFilters,
FilterCombination,
FilterMatch (..),
FilterResult (..),
apply,
filterIsVSIOnly,
comboInclude,
comboExclude,
combinedPaths,
combinedTargets,
Include,
Exclud... |
725f4926cad0d7a49b3dd230530ca2e442b9a362fae3025ce13a08a196e06dbe | jtdaugherty/tracy | NodeMain.hs | module Main where
import Control.Concurrent
import Control.Monad
import System.Console.GetOpt
import System.Environment
import System.Exit
import GHC.Conc
import System.ZMQ4
import Data.Serialize (encode, decode)
import Tracy.Types
import Tracy.RenderManagers.Local
data Arg = Help
| CPUs String
| L... | null | https://raw.githubusercontent.com/jtdaugherty/tracy/ad36ea16a3b9cda5071ca72374d6e1c1b415d520/programs/NodeMain.hs | haskell | Start the local renderer in a loop, since each time a render is finished,
it terminates | module Main where
import Control.Concurrent
import Control.Monad
import System.Console.GetOpt
import System.Environment
import System.Exit
import GHC.Conc
import System.ZMQ4
import Data.Serialize (encode, decode)
import Tracy.Types
import Tracy.RenderManagers.Local
data Arg = Help
| CPUs String
| L... |
50ac3447fe0c87940ac838c181d3096340f1bb1bdfd02e190ce6c115fd39f4bc | ocaml-gospel/vocal | UnionFind_impl__Mem.ml | type rank = int
type address
| null | https://raw.githubusercontent.com/ocaml-gospel/vocal/0fcae7078963c78c8c7222b4b94b15feeae479b9/src/UnionFind_impl__Mem.ml | ocaml | type rank = int
type address
| |
028be372a299cad569c0975e032a954cee85e48823877e99e93acc2e63bff0db | NorfairKing/smos | FilterSpec.hs | # LANGUAGE AllowAmbiguousTypes #
# LANGUAGE FlexibleContexts #
# LANGUAGE LambdaCase #
# LANGUAGE OverloadedLists #
{-# LANGUAGE OverloadedStrings #-}
# LANGUAGE QuasiQuotes #
# LANGUAGE ScopedTypeVariables #
# LANGUAGE TypeApplications #
module Smos.Report.FilterSpec
( spec,
)
where
import Control.Arrow (left)
i... | null | https://raw.githubusercontent.com/NorfairKing/smos/3b7021c22915ae16ae721c7da60d715e24f4e6bb/smos-report-gen/test/Smos/Report/FilterSpec.hs | haskell | # LANGUAGE OverloadedStrings #
This is fine in practice (we have the same test below), but the property doesn't hold in general.
pee "snd:cursor:state:maybe:DONE" stateDoneFilter | # LANGUAGE AllowAmbiguousTypes #
# LANGUAGE FlexibleContexts #
# LANGUAGE LambdaCase #
# LANGUAGE OverloadedLists #
# LANGUAGE QuasiQuotes #
# LANGUAGE ScopedTypeVariables #
# LANGUAGE TypeApplications #
module Smos.Report.FilterSpec
( spec,
)
where
import Control.Arrow (left)
import Control.Monad
import Cursor.F... |
0afdf960c2c175527fc1213300bb68bcdb46a267b3d98a3b882a782cba717b01 | byorgey/diagrams-play | FatLine.hs | # LANGUAGE NoMonomorphismRestriction #
import Diagrams.Prelude
import Diagrams.Backend.Cairo.CmdLine
main = defaultMain (unitCircle # lw 2) | null | https://raw.githubusercontent.com/byorgey/diagrams-play/5362c715db394be6848ff5de1bbe71178e5f173f/FatLine.hs | haskell | # LANGUAGE NoMonomorphismRestriction #
import Diagrams.Prelude
import Diagrams.Backend.Cairo.CmdLine
main = defaultMain (unitCircle # lw 2) | |
a39bcdc515afd6cc76a227d1b3c7875fbd58a3158f1a6d980d1f3fc465f71863 | ocaml/Zarith | z.mli | *
Integers .
This modules provides arbitrary - precision integers .
Small integers internally use a regular OCaml [ int ] .
When numbers grow too large , we switch transparently to GMP numbers
( [ mpn ] numbers fully allocated on the OCaml heap ) .
This interface is rather similar to tha... | null | https://raw.githubusercontent.com/ocaml/Zarith/7d0ee5585b08ded7ca166865a0e122385db886bb/z.mli | ocaml | * For an optimal experience with the [ocaml] interactive toplevel,
the magic commands are:
{[
#load "zarith.cma";;
#install_printer Z.pp_print;;
]}
Alternatively, using the new [Zarith_top] toplevel module, simply:
{[
#require "zarith.top";;
]}
* {1 Types}
* Type of integers of a... | *
Integers .
This modules provides arbitrary - precision integers .
Small integers internally use a regular OCaml [ int ] .
When numbers grow too large , we switch transparently to GMP numbers
( [ mpn ] numbers fully allocated on the OCaml heap ) .
This interface is rather similar to tha... |
d26fee1a2baeb2782f3a73b80a08baab7b820f927af55aeeeff6a93ba4cdf9f3 | mfoemmel/erlang-otp | ex_pickers.erl | %%
%% %CopyrightBegin%
%%
Copyright Ericsson AB 2009 . All Rights Reserved .
%%
The contents of this file are subject to the Erlang Public License ,
Version 1.1 , ( the " License " ) ; you may not use this file except in
%% compliance with the License. You should have received a copy of the
%% Erlang Public Lic... | null | https://raw.githubusercontent.com/mfoemmel/erlang-otp/9c6fdd21e4e6573ca6f567053ff3ac454d742bc2/lib/wx/examples/demo/ex_pickers.erl | erlang |
%CopyrightBegin%
compliance with the License. You should have received a copy of the
Erlang Public License along with this software. If not, it can be
retrieved online at /.
basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
the License for the specific language governing rights and limita... | Copyright Ericsson AB 2009 . All Rights Reserved .
The contents of this file are subject to the Erlang Public License ,
Version 1.1 , ( the " License " ) ; you may not use this file except in
Software distributed under the License is distributed on an " AS IS "
-module(ex_pickers).
-behaviour(wx_object).
-ex... |
9457945c46e8ad35ad3dd2560b9e56d3c316b9be15e7084c956b30afc0c3cfc1 | Quviq/quickcheck-contractmodel | Spec.hs | module Test.QuickCheck.ContractModel.Internal.Spec where
import Control.Monad.Morph
import Control.Monad.State as State
import Control.Monad.Reader
import Control.Monad.Writer as Writer
import Test.QuickCheck.StateModel
import Data.Map (Map)
import Data.Set (Set)
import Data.Set qualified as Set
import Cardano.Api
imp... | null | https://raw.githubusercontent.com/Quviq/quickcheck-contractmodel/071628000ad391ba6849b4d8407b5375228d235d/quickcheck-contractmodel/src/Test/QuickCheck/ContractModel/Internal/Spec.hs | haskell |
* the contract-specific state (`contractState`)
* the current slot (`currentSlot`)
* the wallet balances (`balances`)
* the amount that has been minted (`minted`)
of newly created symbolic tokens. It is used exclusively by the `nextState` function to model the effects
of an action on the blockchain.
... | module Test.QuickCheck.ContractModel.Internal.Spec where
import Control.Monad.Morph
import Control.Monad.State as State
import Control.Monad.Reader
import Control.Monad.Writer as Writer
import Test.QuickCheck.StateModel
import Data.Map (Map)
import Data.Set (Set)
import Data.Set qualified as Set
import Cardano.Api
imp... |
19590dcfffaa3e722da2f1205d1ad72efd24dcc1a4a64a7d6d9cc01abcb17e6e | elaforge/fast-tags | Emacs.hs | {-# LANGUAGE OverloadedStrings #-}
-- | Functions specific to emacs tags.
module FastTags.Emacs (format, formatTag) where
import Data.Monoid ((<>))
import qualified Data.Text as Text
import Data.Text (Text)
import qualified FastTags.Tag as Tag
import qualified FastTags.Token as Token
import qualified FastTags.Util as ... | null | https://raw.githubusercontent.com/elaforge/fast-tags/085f7ffdd93d7152c9544ac8c8e4e3b0226b0d93/src/FastTags/Emacs.hs | haskell | # LANGUAGE OverloadedStrings #
| Functions specific to emacs tags.
| Like 'Vim.dropAdjacent', but since emacs isn't incremental it deals with
TagVals, not tag file lines. Also the tags are already grouped by file.
#Etags_2 | module FastTags.Emacs (format, formatTag) where
import Data.Monoid ((<>))
import qualified Data.Text as Text
import Data.Text (Text)
import qualified FastTags.Tag as Tag
import qualified FastTags.Token as Token
import qualified FastTags.Util as Util
import qualified FastTags.Vim as Vim
format :: Int -> [Token.Pos Ta... |
7eaba7c9cb2b97b05edbbc49f433c3919afbc75ce4830a98d99a303c4fa4a936 | VisionsGlobalEmpowerment/webchange | component.cljs | (ns webchange.interpreter.renderer.scene.components.image.component
(:require
[webchange.interpreter.pixi :refer [Container Graphics Sprite Texture]]
[webchange.interpreter.renderer.scene.components.utils :as utils]
[webchange.interpreter.renderer.scene.filters.filters :refer [apply-filters]]
[webchan... | null | https://raw.githubusercontent.com/VisionsGlobalEmpowerment/webchange/a9010b046126d20d5ee3bd8a16bb6c07cb7230d6/src/cljs/webchange/interpreter/renderer/scene/components/image/component.cljs | clojure | top
top-right
right
bottom-right
bottom
bottom-left
left
top-left
| (ns webchange.interpreter.renderer.scene.components.image.component
(:require
[webchange.interpreter.pixi :refer [Container Graphics Sprite Texture]]
[webchange.interpreter.renderer.scene.components.utils :as utils]
[webchange.interpreter.renderer.scene.filters.filters :refer [apply-filters]]
[webchan... |
20a025cbfafcdc2ad669598d787bac633eb85c55561a7b366423749c39c6f3e3 | janestreet/universe | test_coverage.ml | open! Import
open Parsexp_symbolic_automaton.Automaton
(* For the coverage tests, we write as input a list of string and expected s-expression.
Each s-expression is parsed with both parsexp and sexplib and compared to the expected
s-expression. We assert that both parsers agree with the expected result.
Whi... | null | https://raw.githubusercontent.com/janestreet/universe/b6cb56fdae83f5d55f9c809f1c2a2b50ea213126/parsexp/test/test_coverage.ml | ocaml | For the coverage tests, we write as input a list of string and expected s-expression.
Each s-expression is parsed with both parsexp and sexplib and compared to the expected
s-expression. We assert that both parsers agree with the expected result.
While parsing, we record visited transition. At the end of al... | open! Import
open Parsexp_symbolic_automaton.Automaton
module Char_class = struct
open Parsexp_symbolic_automaton.Table
module T = struct
type t = Transition.t Or_parse_error_reason.t list
[@@deriving compare, sexp_of, hash]
end
let compute (table : t) =
let transitions_to_class = Hashtbl.create... |
8048370bbb259bb8eb9658bf4cb6303381613e8d2418e8cf6b14fd2f71821e5b | Cantido/horizons | parser_test.clj | (ns horizons.parsing.parser-test
(:require
[clj-time.core :as t]
[clojure.java.io :as io]
[clojure.test :refer :all]
[instaparse.core :as insta]
[horizons.core :as h]
[horizons.parsing.parser :as parser]
[instaparse.transform :as transform]
[com.stuartsierra.component :as component]
... | null | https://raw.githubusercontent.com/Cantido/horizons/989e0964d5eebb82c3968049ffd05649625bc25d/test/horizons/parsing/parser_test.clj | clojure | (ns horizons.parsing.parser-test
(:require
[clj-time.core :as t]
[clojure.java.io :as io]
[clojure.test :refer :all]
[instaparse.core :as insta]
[horizons.core :as h]
[horizons.parsing.parser :as parser]
[instaparse.transform :as transform]
[com.stuartsierra.component :as component]
... | |
62b08136faca08121524ed07f567be4a46b3fe369a100bfbe8cf5863e07e3a5e | ml4tp/tcoq | typeclasses_errors.mli | (************************************************************************)
v * The Coq Proof Assistant / The Coq Development Team
< O _ _ _ , , * INRIA - CNRS - LIX - LRI - PPS - Copyright 1999 - 2017
\VV/ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *... | null | https://raw.githubusercontent.com/ml4tp/tcoq/7a78c31df480fba721648f277ab0783229c8bece/pretyping/typeclasses_errors.mli | ocaml | **********************************************************************
// * This file is distributed under the terms of the
* GNU Lesser General Public License Version 2.1
**********************************************************************
* Class name, method
* found, expec... | v * The Coq Proof Assistant / The Coq Development Team
< O _ _ _ , , * INRIA - CNRS - LIX - LRI - PPS - Copyright 1999 - 2017
\VV/ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
open Loc
open Names
open Term... |
25dd499b6293270da2a0846023a2e49968e4b7e6f45a390029580e6c074b54c3 | keithfancher/kept | Main.hs | module Main (main) where
import Args (CLIOpts (..), cliOptParser)
import Kept (exportNotes)
import Options.Applicative (execParser)
main :: IO ()
main = do
(CLIOpts keptOpts inFiles) <- execParser cliOptParser
exportNotes keptOpts inFiles
| null | https://raw.githubusercontent.com/keithfancher/kept/9481faf1b4dcbf060e993ef2227cf9f9d732429f/app/Main.hs | haskell | module Main (main) where
import Args (CLIOpts (..), cliOptParser)
import Kept (exportNotes)
import Options.Applicative (execParser)
main :: IO ()
main = do
(CLIOpts keptOpts inFiles) <- execParser cliOptParser
exportNotes keptOpts inFiles
| |
114f378aa32eedb74c369f624b5971af7a1f72581a7a0b93b8dcbe4388ab5ef7 | kumarshantanu/cambium | mdc_test.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)
; 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 ... | null | https://raw.githubusercontent.com/kumarshantanu/cambium/8e0bce44f6bc9a37adb4182f1a9e65ef9ddf4152/cambium.core/test/cambium/mdc_test.clj | clojure | The use and distribution terms for this software are covered by the
Eclipse Public License 1.0 (-1.0.php)
which can be found in the file 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 remove this ... | Copyright ( c ) . All rights reserved .
(ns cambium.mdc-test
(:require
[clojure.test :refer :all]
[cambium.core :as c]
[cambium.mdc :as m]
[cambium.test-util :as tu]))
(deftest test-mdc
(let [context-old {"foo" "bar"
"baz" "quux"}
context-new {... |
c63431e2c7da50b8ccd1caf53e2d15d5733d70b87c67173eb9b20c2dac131969 | AlfrescoLabs/technical-validation | sec.clj | ;
Copyright © 2013,2014 ( )
;
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... | null | https://raw.githubusercontent.com/AlfrescoLabs/technical-validation/bd1b4b83f6a5e9dd150eedbeebecd30970d3b4aa/src/clojure/alfresco_technical_validation/impl/validations/sec.clj | clojure |
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
-2.0
Unless required by applicable law or agreed to in writing, software
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing pe... | Copyright © 2013,2014 ( )
distributed under the License is distributed on an " AS IS " BASIS ,
This file is part of an unsupported extension to Alfresco .
(ns alfresco-technical-validation.impl.validations.sec
(:require [clojure.string :as s]
[clojure.tools.logging ... |
6cdd8aada29febdaa1ed9d834967672593d08b96828b6cab8862281e2b0ebf45 | j-mie6/ParsleyHaskell | RewindQueue.hs | # LANGUAGE TypeApplications #
module CommonTest.RewindQueue where
import Test.Tasty (testGroup, TestTree)
import Test.Tasty.QuickCheck
( listOf,
(===),
(==>),
conjoin,
testProperty,
forAll,
elements,
resize,
Arbitrary(arbitrary),
Property )
import CommonTest.Queue as QueueTest (ge... | null | https://raw.githubusercontent.com/j-mie6/ParsleyHaskell/ad35a6ae230c953669ef63b43d94bf77a2374ccc/parsley-core/test/CommonTest/RewindQueue.hs | haskell | # LANGUAGE TypeApplications #
module CommonTest.RewindQueue where
import Test.Tasty (testGroup, TestTree)
import Test.Tasty.QuickCheck
( listOf,
(===),
(==>),
conjoin,
testProperty,
forAll,
elements,
resize,
Arbitrary(arbitrary),
Property )
import CommonTest.Queue as QueueTest (ge... | |
bb99a4c7ebf777beb44d6c1253dff26eef9bbcb5680ef7c7933da8c3e064d3b1 | CIFASIS/QuickFuzz | Decoding.hs | # LANGUAGE ViewPatterns #
{-# LANGUAGE BangPatterns #-}
module Utils.Decoding where
import Data.Maybe
import Data.ByteString.Lazy
import Control.DeepSeq
import Control.Monad
import System.Random (randomIO)
import Test.QuickCheck.Random (mkQCGen)
import Test.QuickCheck.Gen
import Test.QuickFuzz.Gen.FormatInfo
impo... | null | https://raw.githubusercontent.com/CIFASIS/QuickFuzz/a1c69f028b0960c002cb83e8145f039ecc0e0a23/app/Utils/Decoding.hs | haskell | # LANGUAGE BangPatterns #
^ Directory to execute in
^ Action to be executed
Decode the files inside a directory
xs <- withCurrentDirectory (inDir cmd) (mapM (Data.ByteString.Lazy.readFile) xs)
Decode a single file
(error $ "Impossible to load " ++ (inDir cmd)) | # LANGUAGE ViewPatterns #
module Utils.Decoding where
import Data.Maybe
import Data.ByteString.Lazy
import Control.DeepSeq
import Control.Monad
import System.Random (randomIO)
import Test.QuickCheck.Random (mkQCGen)
import Test.QuickCheck.Gen
import Test.QuickFuzz.Gen.FormatInfo
import Args
import Debug
import Ex... |
3e31b4a74e6faae83ae24e4efc1fc1fd72350013b6c131263747412ec2df7921 | dustin/mqtt-hs | Arbitrary.hs | |
Module : Network . MQTT.Arbitrary
Description : Arbitrary instances for QuickCheck .
Copyright : ( c ) , 2019
License : :
Stability : experimental
Arbitrary instances for QuickCheck .
Module : Network.MQTT.Arbitrary
Description : Arbitrary instances for QuickCheck... | null | https://raw.githubusercontent.com/dustin/mqtt-hs/aeee5e8a896666edb7f54024718acae942ba1e99/src/Network/MQTT/Arbitrary.hs | haskell | # LANGUAGE OverloadedStrings #
# LANGUAGE ViewPatterns #
| Arbitrary type fitting variable integers.
| v311mask strips all the v5 specific bits from an MQTTPkt.
| An arbitrary Topic and an arbitrary Filter that should match it.
| Generate an arbitrary topic segment (e.g. the 'X' in 'a\/X\/b') of a
given lengt... | |
Module : Network . MQTT.Arbitrary
Description : Arbitrary instances for QuickCheck .
Copyright : ( c ) , 2019
License : :
Stability : experimental
Arbitrary instances for QuickCheck .
Module : Network.MQTT.Arbitrary
Description : Arbitrary instances for QuickCheck... |
31e9fb594bb679aace6d1c57df9b5f423908d6dfed9635fe0a5e829868d93993 | unclebob/spacewar | scan_panel.cljc | (ns spacewar.ui.control-panels.scan-panel
(:require [spacewar.ui.protocols :as p]
[spacewar.ui.config :as uic]
[spacewar.ui.widgets.button :refer [->button]]
[spacewar.ui.widgets.slider :refer [->slider]]
[spacewar.ui.widgets.lcars :as lcars]))
(defn- button-color [sel... | null | https://raw.githubusercontent.com/unclebob/spacewar/71c3195b050c4fdb7e643f53556ab580d70f27ba/src/spacewar/ui/control_panels/scan_panel.cljc | clojure | (ns spacewar.ui.control-panels.scan-panel
(:require [spacewar.ui.protocols :as p]
[spacewar.ui.config :as uic]
[spacewar.ui.widgets.button :refer [->button]]
[spacewar.ui.widgets.slider :refer [->slider]]
[spacewar.ui.widgets.lcars :as lcars]))
(defn- button-color [sel... | |
ea2b8571856eeaf014a55edd5c210cf12fd5ad09ecd7c7f2d370585aa43bd492 | SonarQubeCommunity/sonar-erlang | nospacearoundbrackets.erl | -module(linelength).
hello(A) ->
B = ( A+1),
B = (A+1 ),
C = [ B-2],
D = [C-2 ],
C = { B-2},
D = {C-2 },
E = (a+2),
F = ((a+2)*3)-(5-(6*(2+9)-3)-(2+4)*4),
G = ((a+2 )*3)-(5-(6*(2+9)-3)-(2+4)*4),
T = ((a+2)*3)-(5-(6*( 2+9)-3)-(2+4)*4),
T = (
(a+2)*3)-(5-(6*(2+... | null | https://raw.githubusercontent.com/SonarQubeCommunity/sonar-erlang/279eb7ccd84787c1c0cfd34b9a07981eb20183e3/erlang-checks/src/test/resources/checks/nospacearoundbrackets.erl | erlang | -module(linelength).
hello(A) ->
B = ( A+1),
B = (A+1 ),
C = [ B-2],
D = [C-2 ],
C = { B-2},
D = {C-2 },
E = (a+2),
F = ((a+2)*3)-(5-(6*(2+9)-3)-(2+4)*4),
G = ((a+2 )*3)-(5-(6*(2+9)-3)-(2+4)*4),
T = ((a+2)*3)-(5-(6*( 2+9)-3)-(2+4)*4),
T = (
(a+2)*3)-(5-(6*(2+... | |
8a5f25a7076de74ca8b8dcb2966f151b6320683f1867b099f22e8e2dd6b796b8 | clj-commons/seesaw | custom_dialog.clj | Copyright ( c ) , 2011 . All rights reserved .
; The use and distribution terms for this software are covered by the
; Eclipse Public License 1.0 (-1.0.php)
; which can be found in the file epl-v10.html at the root of this
; distribution.
; By using this software in any fashion, you are agreeing to be ... | null | https://raw.githubusercontent.com/clj-commons/seesaw/4ca89d0dcdf0557d99d5fa84202b7cc6e2e92263/test/seesaw/test/examples/custom_dialog.clj | clojure | The use and distribution terms for this software are covered by the
Eclipse Public License 1.0 (-1.0.php)
which can be found in the file epl-v10.html at the root of this
distribution.
By using this software in any fashion, you are agreeing to be bound by
the terms of this license.
You must not rem... | Copyright ( c ) , 2011 . All rights reserved .
(ns seesaw.test.examples.custom-dialog
(:use [seesaw core font border mig]
seesaw.test.examples.example))
(defn open-more-options-dlg
[]
(let [ok-act (action :name "Ok" :handler (fn [e] (return-from-dialog e "OK")))
cancel-act (action :nam... |
4f28116f5c45a1ae44d29507b7a81e67c15061ceb69224643e7ad7d0396e4dc9 | shriram/mystery-languages | semantics.rkt | #lang racket
(require [for-syntax syntax/parse] mystery-languages/utils mystery-languages/common)
(require [for-syntax racket])
(define (process-numbers d)
(if (number? d)
(if (exact-integer? d)
d
(exact->inexact d))
d))
(define-syntax-rule (my-#%app fun arg ...)
(#%app (#%app pro... | null | https://raw.githubusercontent.com/shriram/mystery-languages/8c8d6065a6e34f484f1a6f509ebb31a5b9ff0cc1/arithmetic/L3/semantics.rkt | racket | #lang racket
(require [for-syntax syntax/parse] mystery-languages/utils mystery-languages/common)
(require [for-syntax racket])
(define (process-numbers d)
(if (number? d)
(if (exact-integer? d)
d
(exact->inexact d))
d))
(define-syntax-rule (my-#%app fun arg ...)
(#%app (#%app pro... | |
41b0694b816697ecf21be6347c631e029565f9e4e073dac25921b1374caeb11d | sjl/advent | day-07.lisp | (advent:defpackage* :advent/2018/07)
(in-package :advent/2018/07)
(named-readtables:in-readtable :interpol-syntax)
(defun parse-line (line)
(ppcre:register-groups-bind
(((rcurry #'aref 0) requirement target))
(#?r"Step (\w) must be finished before step (\w) can begin." line)
(list target requirement... | null | https://raw.githubusercontent.com/sjl/advent/dc3debda9bd1a0570a6ab06919b1af7b285413dc/src/2018/days/day-07.lisp | lisp | (digraph.dot:draw graph) | (advent:defpackage* :advent/2018/07)
(in-package :advent/2018/07)
(named-readtables:in-readtable :interpol-syntax)
(defun parse-line (line)
(ppcre:register-groups-bind
(((rcurry #'aref 0) requirement target))
(#?r"Step (\w) must be finished before step (\w) can begin." line)
(list target requirement... |
a9b997124d40f1e9c344a9d5e690dfbc5636791d0216f4ce15cd18ddde702216 | tommay/pokemon-go | Util.hs | # LANGUAGE TupleSections #
module Util (
Util.groupBy,
matchesAbbrevInsensitive,
toByteString,
augment,
augmentM,
toLower,
toUpper,
lastWhere,
commaSeparated,
) where
import Control.Monad (forM)
import qualified Data.ByteString as ByteString
import Data.ByteString (ByteString)
im... | null | https://raw.githubusercontent.com/tommay/pokemon-go/b73ba46bc558255055f1e291e1350724bb86624f/src/Util.hs | haskell | There are a number of ways to implement something like this on
Seems like there should be in a library somewhere. It sure took a lot
of extraneous bookkeeping to get this little function building.
Useful for creating a list augmented with a sort key.
| # LANGUAGE TupleSections #
module Util (
Util.groupBy,
matchesAbbrevInsensitive,
toByteString,
augment,
augmentM,
toLower,
toUpper,
lastWhere,
commaSeparated,
) where
import Control.Monad (forM)
import qualified Data.ByteString as ByteString
import Data.ByteString (ByteString)
im... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.