_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 |
|---|---|---|---|---|---|---|---|---|
97348dececc0eb496c6f97f1961bcb43f0ba5bf5b5f5208fe3a802c481b82c8e | grin-compiler/ghc-grin | ida.hs | $ I d : ida.hs , v 1.6 1999/02/14 23:49:30 Exp $
module Main (main) -- ida
where {
partain : import Fast2haskell ;
-- #include "../Fast2haskell.hs"
hbcc prelude :
#ifdef __HBCC__
#include "prel.hs"
#endif
#ifdef __HBC__
import Char;
#endif
#ifdef __GLASGOW_HASKELL__
import Data.Char;
#endif
strict_show_i::... | null | https://raw.githubusercontent.com/grin-compiler/ghc-grin/ebc4dca2e1f5b3581d4b84726730564ce909d786/ghc-grin-benchmark/boq-custom/todo/ida.hs | haskell | ida
#include "../Fast2haskell.hs" | $ I d : ida.hs , v 1.6 1999/02/14 23:49:30 Exp $
where {
partain : import Fast2haskell ;
hbcc prelude :
#ifdef __HBCC__
#include "prel.hs"
#endif
#ifdef __HBC__
import Char;
#endif
#ifdef __GLASGOW_HASKELL__
import Data.Char;
#endif
strict_show_i::Int -> [Char];
( show x ) ;
let {
x... |
7e15f2036176bf7b584e81e6195e84402783740ded3fbf7001174fd2c852c4bb | jessitron/qconsf-22 | hipstershop_ad_service_client.erl | %%%-------------------------------------------------------------------
@doc Client module for grpc service hipstershop . AdService .
%% @end
%%%-------------------------------------------------------------------
%% this module was generated and should not be modified manually
-module(hipstershop_ad_service_client).... | null | https://raw.githubusercontent.com/jessitron/qconsf-22/53df65c9c33ebaee33b7bf67304a89882709aee9/src/featureflagservice/src/hipstershop_ad_service_client.erl | erlang | -------------------------------------------------------------------
@end
-------------------------------------------------------------------
this module was generated and should not be modified manually
@doc Unary RPC | @doc Client module for grpc service hipstershop . AdService .
-module(hipstershop_ad_service_client).
-compile(export_all).
-compile(nowarn_export_all).
-include_lib("grpcbox/include/grpcbox.hrl").
-define(is_ctx(Ctx), is_tuple(Ctx) andalso element(1, Ctx) =:= ctx).
-define(SERVICE, 'hipstershop.AdService').
-d... |
adad35a4db5c7834a7145a8056afaf92a6e39ef315b153502a9813bda99ab8ed | kevinlynx/ext-blog | defmodule.lisp | defmodule.lisp
;;;;
;;;; This file is a part of ext-blog, a common lisp blog engine.
;;;; See file doc/LICENSE for license details.
;;;;
Author : ( kevinlynx at gmail dot com )
(restas:define-module #:ext-blog
(:use common-lisp)
(:import-from :ext-blog-asd :*ext-blog-version*)
(:render-method (make-instance... | null | https://raw.githubusercontent.com/kevinlynx/ext-blog/4f6a6f0ab64f9384d53d41d1208ebaa7b9575534/src/defmodule.lisp | lisp |
This file is a part of ext-blog, a common lisp blog engine.
See file doc/LICENSE for license details.
| defmodule.lisp
Author : ( kevinlynx at gmail dot com )
(restas:define-module #:ext-blog
(:use common-lisp)
(:import-from :ext-blog-asd :*ext-blog-version*)
(:render-method (make-instance (find-symbol "DRAWER-DISPATCHER" '#:ext-blog)))
(:export-route-symbols t)
)
(defpackage #:xml-rpc-methods
(:use
... |
5cc5c4b498ea3c1ace7719c16581f17018ff7c5d34160be6bd863c304a1551c6 | thoughtbot/FOMObot | HistoryItem.hs | module FOMObot.Types.HistoryItem where
import Control.Lens (makeLenses)
import qualified Web.Slack as Slack
data HistoryItem = HistoryItem
{ _historyTimeStamp :: Slack.SlackTimeStamp
, _historyUserId :: Slack.UserId
} deriving (Show)
makeLenses ''HistoryItem
| null | https://raw.githubusercontent.com/thoughtbot/FOMObot/ee90c582e30fcc485de1033f2fbbfa6465ed2ab9/src/FOMObot/Types/HistoryItem.hs | haskell | module FOMObot.Types.HistoryItem where
import Control.Lens (makeLenses)
import qualified Web.Slack as Slack
data HistoryItem = HistoryItem
{ _historyTimeStamp :: Slack.SlackTimeStamp
, _historyUserId :: Slack.UserId
} deriving (Show)
makeLenses ''HistoryItem
| |
2df867047c89d0f03d2f9532564932d345350b9e41a23f458323a59da68b4854 | racket/plot | 46.rkt | #lang racket
(require rackunit
plot
plot/utils
racket/draw
racket/runtime-path
"../helpers.rkt")
;; Tests for
(define r3d (surface3d (lambda (x y) (- (sqr x) (sqr y))) -1 1 -1 1))
(define r2d (function sin (- pi) pi))
;; Case 1: far ticks are the same as near ticks, labe... | null | https://raw.githubusercontent.com/racket/plot/c4126001f2c609e36c3aa12f300e9c673ab1a806/plot-test/plot/tests/PRs/46.rkt | racket | Tests for
Case 1: far ticks are the same as near ticks, labels are
drawn on the near axis only.
plot-{x,y,z}-ticks - (linear-ticks)
plot-{x,y,z}-far-ticks - (linear-ticks)
plot-{x,y,z}-tick-labels? - NOT SET
plot-{x,y,z}-far-tick-labels? - NOT SET
Case 2: far ticks are th... | #lang racket
(require rackunit
plot
plot/utils
racket/draw
racket/runtime-path
"../helpers.rkt")
(define r3d (surface3d (lambda (x y) (- (sqr x) (sqr y))) -1 1 -1 1))
(define r2d (function sin (- pi) pi))
(define (do-plot-case1 output-fn)
(parameterize ([plot-x-ticks (... |
7ba12b7f0d69fe981b51d405514e06c31f780f7608a575c67e4c85f43cded651 | ekmett/unboxed | NilReps.hs | {-# Language DataKinds #-}
{-# Language StandaloneKindSignatures #-}
module NilReps where
import GHC.Types
type Reps :: [RuntimeRep]
type Reps = '[]
| null | https://raw.githubusercontent.com/ekmett/unboxed/e4c6ca80fb8946b1abfe595ba1c36587a33931db/internal/NilReps.hs | haskell | # Language DataKinds #
# Language StandaloneKindSignatures # | module NilReps where
import GHC.Types
type Reps :: [RuntimeRep]
type Reps = '[]
|
1ac61a3feb00417825e35d44f349f7c5afb261778229e9d445333d6a001c65fd | WorksHub/client | subs.cljs | (ns wh.components.error.subs
(:require
[re-frame.core :refer [reg-sub]]
[wh.components.error.db :as error]))
(reg-sub ::sub-db (fn [db _] (::error/sub-db db)))
(reg-sub
::message
:<- [::sub-db]
(fn [db _]
(::error/message db)))
(reg-sub
::type
:<- [::sub-db]
(fn [db _]
(name (::error/ty... | null | https://raw.githubusercontent.com/WorksHub/client/a51729585c2b9d7692e57b3edcd5217c228cf47c/client/src/wh/components/error/subs.cljs | clojure | (ns wh.components.error.subs
(:require
[re-frame.core :refer [reg-sub]]
[wh.components.error.db :as error]))
(reg-sub ::sub-db (fn [db _] (::error/sub-db db)))
(reg-sub
::message
:<- [::sub-db]
(fn [db _]
(::error/message db)))
(reg-sub
::type
:<- [::sub-db]
(fn [db _]
(name (::error/ty... | |
0192bc541dd6d882021a34469018788e201a799901c6cb3aa2905651f849119b | jonasseglare/geex | Seed_test.clj | (ns geex.Seed-test
(:import [geex ISeed DynamicSeed
SeedParameters Mode TypedSeed
SeedUtils])
(:require [clojure.test :refer :all]
[bluebell.utils.wip.java :as java :refer [set-field]]))
(defn params-with-type [t]
(doto (SeedParameters.)
(set-field type t)
(set-field d... | null | https://raw.githubusercontent.com/jonasseglare/geex/f1a48c14c983c054c91fb221b91f42de5fa8eee0/test/geex/Seed_test.clj | clojure | (ns geex.Seed-test
(:import [geex ISeed DynamicSeed
SeedParameters Mode TypedSeed
SeedUtils])
(:require [clojure.test :refer :all]
[bluebell.utils.wip.java :as java :refer [set-field]]))
(defn params-with-type [t]
(doto (SeedParameters.)
(set-field type t)
(set-field d... | |
69c4d9cae1d2107d26660631ef54fb4e29300a3b5b66638df096dc78934b1da5 | music-suite/music-suite | Offsets.hs | module Data.AffineSpace.Point.Offsets
( offsetPoints,
offsetPointsS,
pointOffsets,
offsetVs,
distanceVs,
AffinePair,
)
where
import Data.AffineSpace
import qualified Data.List
import Data.Stream.Infinite (Stream)
import qualified Data.Stream.Infinite as Stream
import Data.VectorSpace
-- |
An... | null | https://raw.githubusercontent.com/music-suite/music-suite/7f01fd62334c66418043b7a2d662af127f98685d/src/Data/AffineSpace/Point/Offsets.hs | haskell | |
Vectors represent distances between points, for example the
| Lay out a series of vectors from a given point. Return all intermediate points.
> lenght xs + 1 == length (offsetPoints p xs)
[0,1,2,3]
| Same as 'offsetPoints' but for infinite streams.
| Calculate the relative difference between vectors.
> le... | module Data.AffineSpace.Point.Offsets
( offsetPoints,
offsetPointsS,
pointOffsets,
offsetVs,
distanceVs,
AffinePair,
)
where
import Data.AffineSpace
import qualified Data.List
import Data.Stream.Infinite (Stream)
import qualified Data.Stream.Infinite as Stream
import Data.VectorSpace
An affi... |
854ce4620afc5d9f0c639b1c8e687c90dea0f8270656397a7b42bed99595be9b | charlieg/Sparser | treetops.lisp | ;;; -*- Mode:LISP; Syntax:Common-Lisp; Package:(SPARSER LISP) -*-
copyright ( c ) 1990 Content Technologies Inc.
copyright ( c ) 1992 -- all rights reserved
;;;
;;; File: "treetops"
;;; Module: "objects;traces:"
Version : 1.0 October 1990 ( v1.5 )
(in-package :sparser)
(defpara... | null | https://raw.githubusercontent.com/charlieg/Sparser/b9bb7d01d2e40f783f3214fc104062db3d15e608/Sparser/code/s/objects/traces/treetops.lisp | lisp | -*- Mode:LISP; Syntax:Common-Lisp; Package:(SPARSER LISP) -*-
File: "treetops"
Module: "objects;traces:" | copyright ( c ) 1990 Content Technologies Inc.
copyright ( c ) 1992 -- all rights reserved
Version : 1.0 October 1990 ( v1.5 )
(in-package :sparser)
(defparameter *trace-treetops* nil
"Flag read in Do-treetops.")
(defparameter *trace-treetop-hits* nil
"Signals there being a treetop... |
9db5c2f6a02fa50f2cc99a6d614584fee8da58500f0a7dff919bc3d7aa62f56d | vim-scripts/slimv.vim | swank-package-fu.lisp |
(in-package :swank)
(defslimefun package= (string1 string2)
(let* ((pkg1 (guess-package string1))
(pkg2 (guess-package string2)))
(and pkg1 pkg2 (eq pkg1 pkg2))))
(defslimefun export-symbol-for-emacs (symbol-str package-str)
(let ((package (guess-package package-str)))
(when package
(let ((*buffe... | null | https://raw.githubusercontent.com/vim-scripts/slimv.vim/61ce81ff6b1a05314a6d750a32a1c7379f35a5dc/slime/contrib/swank-package-fu.lisp | lisp |
(in-package :swank)
(defslimefun package= (string1 string2)
(let* ((pkg1 (guess-package string1))
(pkg2 (guess-package string2)))
(and pkg1 pkg2 (eq pkg1 pkg2))))
(defslimefun export-symbol-for-emacs (symbol-str package-str)
(let ((package (guess-package package-str)))
(when package
(let ((*buffe... | |
169f683af8c5ac355a823737690e5559d352458852d37ba32050df5f052de2cb | bugczw/Introduction-to-Functional-Programming-in-OCaml | intListLen.ml | (* hide *)
type int_list =
| EmptyList
| SomeElement of int * int_list;;
(* show *)
let rec length = function
| EmptyList -> 0
| SomeElement (x, l) -> 1 + length l;;
| null | https://raw.githubusercontent.com/bugczw/Introduction-to-Functional-Programming-in-OCaml/13c4d1f92e7479f8eb10ea5d4c43a598b6676d0f/OCaml_MOOC_W3_ALL/intListLen.ml | ocaml | hide
show | type int_list =
| EmptyList
| SomeElement of int * int_list;;
let rec length = function
| EmptyList -> 0
| SomeElement (x, l) -> 1 + length l;;
|
855d8fe3ecf565d6e6a1be981104324e3d3d4ca4e5d95adfcad4493a5e628f4b | databrary/databrary | TypesTest.hs | # LANGUAGE OverloadedStrings , ScopedTypeVariables #
module Model.Stats.TypesTest where
import qualified Data.Map as Map
import qualified Data.Array.Unboxed as ArrayU
import Test.Tasty
import Model.Stats.Types
import Model.Id.Types
siteStats1 :: SiteStats
siteStats1 =
SiteStats {
statsAuthorizedSite = ... | null | https://raw.githubusercontent.com/databrary/databrary/685f3c625b960268f5d9b04e3d7c6146bea5afda/test/Model/Stats/TypesTest.hs | haskell | should be list of category to count of records | # LANGUAGE OverloadedStrings , ScopedTypeVariables #
module Model.Stats.TypesTest where
import qualified Data.Map as Map
import qualified Data.Array.Unboxed as ArrayU
import Test.Tasty
import Model.Stats.Types
import Model.Id.Types
siteStats1 :: SiteStats
siteStats1 =
SiteStats {
statsAuthorizedSite = ... |
fa48e93234a48f47a49239ac51a024efa1d0e40523a64b7c317d7a1ddc608933 | rizo/streams-bench | Pull_cursor_safe.ml | let pass () = ()
let bracket init (stop : 'a -> unit) f =
let x = init () in
try
let r = f x in
stop x;
r
with exn ->
stop x;
raise exn
type 'a t =
| Iter : {
init : unit -> 's;
next : 'r. ('a -> 's -> 'r) -> (unit -> 'r) -> 's -> 'r;
stop : 's -> unit;
}
-> 'a ... | null | https://raw.githubusercontent.com/rizo/streams-bench/87baf838971c84613b801ab32b6473d397bcc23f/src/Pull_cursor_safe.ml | ocaml | let pass () = ()
let bracket init (stop : 'a -> unit) f =
let x = init () in
try
let r = f x in
stop x;
r
with exn ->
stop x;
raise exn
type 'a t =
| Iter : {
init : unit -> 's;
next : 'r. ('a -> 's -> 'r) -> (unit -> 'r) -> 's -> 'r;
stop : 's -> unit;
}
-> 'a ... | |
fc2bf5a65144844f5e9d5587624c1ddd9f531f2974ca958cc85c25451b0631f0 | quil-lang/quilc | swap-representation.lisp | ;;;; src/clifford/swap-representation.lisp
;;;;
Author :
(in-package #:cl-quil.clifford)
This file contains functions to explore the group mod the swap group .
(defun clifford-as-vectors (clifford-element)
"Given a CLIFFORD-ELEMENT return the basis vectors and the images of those basis vectors associated wi... | null | https://raw.githubusercontent.com/quil-lang/quilc/3f3260aaa65cdde25a4f9c0027959e37ceef9d64/src/clifford/swap-representation.lisp | lisp | src/clifford/swap-representation.lisp
Prepare for the next iteration
Now that the total permutation has been computed, apply it to all images of the basis map | Author :
(in-package #:cl-quil.clifford)
This file contains functions to explore the group mod the swap group .
(defun clifford-as-vectors (clifford-element)
"Given a CLIFFORD-ELEMENT return the basis vectors and the images of those basis vectors associated with the basis map it represents. Returns a VECTOR... |
08f52b62f7a3da9371c8fc3db19f5fb52fbe3f04e819bdb77165f8185f3d9d74 | rbonichon/smtpp | config.ml | (*********************************************************************************)
Copyright ( c ) 2015 , INRIA , Universite de Nancy 2 and Universidade Federal
do Rio Grande do Norte .
(* ... | null | https://raw.githubusercontent.com/rbonichon/smtpp/57eb74bccbb0f30293ee058ded4b01baa1067756/src/config.ml | ocaml | *******************************************************************************
Permission to use, copy, modify, and distribute this software for any
purpose with or without fee is hereby granted, provided that the above
... | Copyright ( c ) 2015 , INRIA , Universite de Nancy 2 and Universidade Federal
do Rio Grande do Norte .
THE SOFTWARE IS PROVIDED " AS IS " AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WHATSOEVER RESULTING FROM LOSS OF USE , DATA OR PROFITS , WHETHER I... |
6362fb1b65cf78c8b026f1e82a3771b013aad73b09f90959dc64dec617084ff8 | cark/cark.behavior-tree | register_nodes.cljc | (ns ^:no-doc cark.behavior-tree.register-nodes
(:require [cark.behavior-tree.node-defs.success-leaf :as success-leaf]
[cark.behavior-tree.node-defs.failure-leaf :as failure-leaf]
[cark.behavior-tree.node-defs.inverter :as inverter]
[cark.behavior-tree.node-defs.sequence :as seq... | null | https://raw.githubusercontent.com/cark/cark.behavior-tree/4e229fcc2ed3af3c66e74d2c51dda6684927d254/src/main/cark/behavior_tree/register_nodes.cljc | clojure | (consume-event/register)
| (ns ^:no-doc cark.behavior-tree.register-nodes
(:require [cark.behavior-tree.node-defs.success-leaf :as success-leaf]
[cark.behavior-tree.node-defs.failure-leaf :as failure-leaf]
[cark.behavior-tree.node-defs.inverter :as inverter]
[cark.behavior-tree.node-defs.sequence :as seq... |
dc893efb7d3dea4bc1925d73af02bab09db00a105548b0bf1cd4e5001868ca0c | sneeuwballen/zipperposition | Multiset.mli |
This file is free software , part of Logtk . See file " license " for more details .
* { 1 Generic multisets }
module type S = Multiset_intf.S
module Make(X : Map.OrderedType) : S with type elt = X.t
| null | https://raw.githubusercontent.com/sneeuwballen/zipperposition/7f1455fbe2e7509907f927649c288141b1a3a247/src/core/Multiset.mli | ocaml |
This file is free software , part of Logtk . See file " license " for more details .
* { 1 Generic multisets }
module type S = Multiset_intf.S
module Make(X : Map.OrderedType) : S with type elt = X.t
| |
ac2abc207773aafc4c98ac9956e022f71850570edebbc15b570da6401aa5d79a | hasktorch/hasktorch | Main.hs | # LANGUAGE BlockArguments #
# LANGUAGE FunctionalDependencies #
# LANGUAGE RecordWildCards #
-- In matrix factorization, we aim to write a given matrix R (of size n x m) as
-- a product U * V where U is n x k and R is k x m for some k. This is done in
-- this example by minimizing a loss function which is the mean squ... | null | https://raw.githubusercontent.com/hasktorch/hasktorch/4e846fdcd89df5c7c6991cb9d6142007a6bb0a58/examples/matrix-factorization/Main.hs | haskell | In matrix factorization, we aim to write a given matrix R (of size n x m) as
a product U * V where U is n x k and R is k x m for some k. This is done in
this example by minimizing a loss function which is the mean square of the
difference between U * V and R. | # LANGUAGE BlockArguments #
# LANGUAGE FunctionalDependencies #
# LANGUAGE RecordWildCards #
module Main where
import Control.Monad (foldM, when)
import MF
import Torch.Autograd (grad, makeIndependent, toDependent)
import Torch.Functional (matmul, mse_loss)
import Torch.Internal.Managed.Type.Context (manual_seed_L)
... |
2b1b72553e14e92731368face99c13f6b0a00bfd342ad1351e68ffc4b1cef46f | lisp/de.setf.xml | sax-construction-context.lisp | (in-package "XML-SAX")
Modified 18 - sep-01 for KTI by
;; an xmlp-based sax parser drives the event-based counterpart based on
;; inline parser construction operations.
;; note that the bridge class implementation does not specify the
;; instantiation and invocation structure.
;;; Convenience function
(defun par... | null | https://raw.githubusercontent.com/lisp/de.setf.xml/827681c969342096c3b95735d84b447befa69fa6/demos/saxandsoap/sax-construction-context.lisp | lisp | an xmlp-based sax parser drives the event-based counterpart based on
inline parser construction operations.
note that the bridge class implementation does not specify the
instantiation and invocation structure.
Convenience function
source can be a string, pathname or uri
since we specialize the document-location... | (in-package "XML-SAX")
Modified 18 - sep-01 for KTI by
(defun parse-object (source &key (consumer 'empty-consumer)
(document-location source))
(check-type source (or xutils:uri string pathname))
(let* ((consumer (if (symbolp consumer)
(make-instance consumer)
consumer))
(producer (make... |
36f79295dbf7502d375bd982388eb02fd04261de04781d4f6a52bcf6a3bca814 | sjl/cl-nrepl | quickutils-package.lisp | (eval-when (:compile-toplevel :load-toplevel :execute)
(unless (find-package "NREPL.QUICKUTILS")
(defpackage "NREPL.QUICKUTILS"
(:documentation "Package that contains Quickutil utility functions.")
(:use :cl))))
(in-package "NREPL.QUICKUTILS")
need to define this here so will shut the hell up abo... | null | https://raw.githubusercontent.com/sjl/cl-nrepl/20a71458344a721d605c349b92268879bdfc98a1/vendor/quickutils-package.lisp | lisp | (eval-when (:compile-toplevel :load-toplevel :execute)
(unless (find-package "NREPL.QUICKUTILS")
(defpackage "NREPL.QUICKUTILS"
(:documentation "Package that contains Quickutil utility functions.")
(:use :cl))))
(in-package "NREPL.QUICKUTILS")
need to define this here so will shut the hell up abo... | |
235d29ee81b1f93122793145736cd99fa7d7974a8ad4dd2204b3c5eefdc8bc13 | wesen/ruinwesen | md-convert.lisp | (in-package :md)
(defparameter *all-mapping*
'(
(C2 . C2) (CS2 . CS2) (D2 . D2) (EF2 . EF2) (E2 . E2) (F2 . F2) (FS2 . FS2)
(G2 . G2) (AF2 . AF2) (A2 . A2) (BF2 . BF2) (B2 . B2)
(C3 . C3) (CS3 . CS3) (D3 . D3) (EF3 . EF3) (E3 . E3) (F3 . F3) (FS3 . FS3)
(G3 . G3) (AF3 . AF3) (A3 . A3) (BF3 . BF3)... | null | https://raw.githubusercontent.com/wesen/ruinwesen/9f3ccea85425cf46b57e76144b3114ca342bad0f/md-uw/src/one-offs/md-convert.lisp | lisp | acid test | (in-package :md)
(defparameter *all-mapping*
'(
(C2 . C2) (CS2 . CS2) (D2 . D2) (EF2 . EF2) (E2 . E2) (F2 . F2) (FS2 . FS2)
(G2 . G2) (AF2 . AF2) (A2 . A2) (BF2 . BF2) (B2 . B2)
(C3 . C3) (CS3 . CS3) (D3 . D3) (EF3 . EF3) (E3 . E3) (F3 . F3) (FS3 . FS3)
(G3 . G3) (AF3 . AF3) (A3 . A3) (BF3 . BF3)... |
0b8da0d791e90f4f8f4da60f2ce4f06d14db926abb9b01d2c2d062a8e8478ba2 | tweag/ormolu | default-signatures-out.hs | # LANGUAGE DefaultSignatures #
module Main where
-- | Something else.
class Bar a where
-- | Bar
bar ::
String ->
String ->
a
Pointless comment
default bar ::
( Read a,
Semigroup a
) =>
a ->
a ->
a
-- Even more pointless comment
bar
a
b =
read a <> read ... | null | https://raw.githubusercontent.com/tweag/ormolu/34bdf62429768f24b70d0f8ba7730fc4d8ae73ba/data/examples/declaration/class/default-signatures-out.hs | haskell | | Something else.
| Bar
Even more pointless comment | # LANGUAGE DefaultSignatures #
module Main where
class Bar a where
bar ::
String ->
String ->
a
Pointless comment
default bar ::
( Read a,
Semigroup a
) =>
a ->
a ->
a
bar
a
b =
read a <> read b
|
0a6d04a3dce1f5c04dfa1f17e37f3dd7242469e700796c6b510d34264c65f0ab | heidegger/JSConTest | depend.ml | type t =
{ scope: int;
parameter: int;
}
let create s p = { scope = s; parameter = p }
let string_of { scope = s; parameter = p } =
(String.make s '$') ^ (string_of_int p)
let get_scope { scope = s } = s
let get_param { parameter = p } = p
let raise_up t = {t with scope = t.scope - 1 }
| null | https://raw.githubusercontent.com/heidegger/JSConTest/7c807a76af998da25775fba1f5cbe1cf8031d121/ocaml/contracts/depend.ml | ocaml | type t =
{ scope: int;
parameter: int;
}
let create s p = { scope = s; parameter = p }
let string_of { scope = s; parameter = p } =
(String.make s '$') ^ (string_of_int p)
let get_scope { scope = s } = s
let get_param { parameter = p } = p
let raise_up t = {t with scope = t.scope - 1 }
| |
602d6d1837b7e37301a9834d690002b4c67c3cba086d17ffe5a7df260927925d | fumieval/word-compat | Compat.hs | # LANGUAGE PatternSynonyms #
# LANGUAGE MagicHash #
# LANGUAGE ViewPatterns #
# LANGUAGE CPP #
module GHC.Word.Compat (W.Word8,
W.Word16,
W.Word32,
W.Word64,
W.Word(..),
#if MIN_VERSION_ghc_prim(0,8,0)
pattern GHC.Word.Compat.W8#,
pattern GHC.Word.Compat.W16#,
pattern GHC.Word.Compat.W32#,
#... | null | https://raw.githubusercontent.com/fumieval/word-compat/abfaf8fb580535ba4e65f2027fa2a9e5da9cb948/src/GHC/Word/Compat.hs | haskell | * Shifts
* Bit reversal
* Equality operators
| See GHC.Classes#matching_overloaded_methods_in_rules
# COMPLETE W8# #
# COMPLETE W16# #
# COMPLETE W64# # | # LANGUAGE PatternSynonyms #
# LANGUAGE MagicHash #
# LANGUAGE ViewPatterns #
# LANGUAGE CPP #
module GHC.Word.Compat (W.Word8,
W.Word16,
W.Word32,
W.Word64,
W.Word(..),
#if MIN_VERSION_ghc_prim(0,8,0)
pattern GHC.Word.Compat.W8#,
pattern GHC.Word.Compat.W16#,
pattern GHC.Word.Compat.W32#,
#... |
11cf489314546d5f6ce22dac91a842abfafb75b53da2c4a3140211d6fe76e539 | clojure/tools.namespace | track.cljc | Copyright ( c ) , 2012 . All rights reserved . The use and
distribution terms for this software are covered by the Eclipse
;; Public License 1.0 (-1.0.php)
;; which can be found in the file epl-v10.html at the root of this
;; distribution. By using this software in any fashion, you are
;; agreeing to be bound by ... | null | https://raw.githubusercontent.com/clojure/tools.namespace/55b9537185926c5afde100278a5af39425793f40/src/main/clojure/clojure/tools/namespace/track.cljc | clojure | Public License 1.0 (-1.0.php)
which can be found in the file epl-v10.html at the root of this
distribution. By using this software in any fashion, you are
agreeing to be bound by the terms of this license. You must not
remove this notice, or any other, from this software.
With a new tracker, old dependencies are ... | Copyright ( c ) , 2012 . All rights reserved . The use and
distribution terms for this software are covered by the Eclipse
(ns ^{:author "Stuart Sierra"
:doc "Dependency tracker which can compute which namespaces need to be
reloaded after files have changed. This is the low-level
implementation that re... |
9d230f34ab0de2dd79d12a1a6882c5e6affa0e8e1530830963448be7d6a0e8a7 | gregwebs/Shelly.hs | drain.hs | {-# Language OverloadedStrings, ExtendedDefaultRules #-}
import Shelly
import Control.Monad (void)
import Data.Text (Text)
default (Text)
main :: IO ()
main = do
let exDir = "./test/examples"
void $ shelly $ do
let strs = ["a", "b"] :: [String]
let texts = ["a", "b"] :: [Text]
let inferred = ["a", "b... | null | https://raw.githubusercontent.com/gregwebs/Shelly.hs/25a7884aa5a227707968b45b1336af71c1e627f6/test/examples/drain.hs | haskell | # Language OverloadedStrings, ExtendedDefaultRules # |
import Shelly
import Control.Monad (void)
import Data.Text (Text)
default (Text)
main :: IO ()
main = do
let exDir = "./test/examples"
void $ shelly $ do
let strs = ["a", "b"] :: [String]
let texts = ["a", "b"] :: [Text]
let inferred = ["a", "b"]
res <- cmd (exDir </> "drain.sh") strs texts infer... |
3e73edf9c0f9c9548bff32a6910980e0fef3e221f78ae5afa205b6ee1a05a971 | ghc/packages-Cabal | cabal.test.hs | import Test.Cabal.Prelude
main = cabalTest $ do
res <- cabal' "v2-build" ["--only-configure"]
assertOutputContains "Configuring library for" res
assertOutputContains "Configuring executable 'foo' for" res
assertOutputDoesNotContain "Configuring test suite 'bar' for" res
assertOutputDoes... | null | https://raw.githubusercontent.com/ghc/packages-Cabal/6f22f2a789fa23edb210a2591d74ea6a5f767872/cabal-testsuite/PackageTests/NewBuild/CmdBuild/OnlyConfigure/cabal.test.hs | haskell | import Test.Cabal.Prelude
main = cabalTest $ do
res <- cabal' "v2-build" ["--only-configure"]
assertOutputContains "Configuring library for" res
assertOutputContains "Configuring executable 'foo' for" res
assertOutputDoesNotContain "Configuring test suite 'bar' for" res
assertOutputDoes... | |
3b8fa241d9fad5711fe504ec3f0bc724d5dc9a6e8619521adb4764181d07e44c | modular-macros/ocaml-macros | fileio.ml | (* Test a file copy function *)
let test msg producer consumer src dst =
print_string msg; print_newline();
let ic = open_in_bin src in
let oc = open_out_bin dst in
let (in_fd, out_fd) = Unix.pipe() in
let ipipe = Unix.in_channel_of_descr in_fd in
let opipe = Unix.out_channel_of_descr out_fd in
let prod ... | null | https://raw.githubusercontent.com/modular-macros/ocaml-macros/05372c7248b5a7b1aa507b3c581f710380f17fcd/testsuite/tests/lib-threads/fileio.ml | ocaml | Test a file copy function
File copy with constant-sized chunks
File copy with random-sized chunks
File copy line per line
Create long lines of text
Test input_line on truncated lines
The test |
let test msg producer consumer src dst =
print_string msg; print_newline();
let ic = open_in_bin src in
let oc = open_out_bin dst in
let (in_fd, out_fd) = Unix.pipe() in
let ipipe = Unix.in_channel_of_descr in_fd in
let opipe = Unix.out_channel_of_descr out_fd in
let prod = Thread.create producer (ic, op... |
830908821090f91baf58867e1415045b52953d6de08c34efe3718187e3744445 | JacquesCarette/Drasil | Print.hs | -- | Defines printers for generating Makefiles.
module Build.Drasil.Make.Print where
import Prelude hiding ((<>))
import Text.PrettyPrint (Doc, empty, text, (<>), (<+>), ($+$), ($$), hsep, vcat)
import Build.Drasil.Make.AST (Command(C), CommandOpts(IgnoreReturnCode),
Dependencies, Makefile(M), Rule(R), Target, Type... | null | https://raw.githubusercontent.com/JacquesCarette/Drasil/92dddf7a545ba5029f99ad5c5eddcd8dad56a2d8/code/drasil-build/lib/Build/Drasil/Make/Print.hs | haskell | | Defines printers for generating Makefiles.
| Generates the makefile by calling 'build' after 'toMake'.
| Renders the makefile rules.
| Renders specific makefile rules. Called by 'build'.
| Gathers all rules to abstract targets and tags them as phony.
| Renders targets with their dependencies.
| Renders a makef... | module Build.Drasil.Make.Print where
import Prelude hiding ((<>))
import Text.PrettyPrint (Doc, empty, text, (<>), (<+>), ($+$), ($$), hsep, vcat)
import Build.Drasil.Make.AST (Command(C), CommandOpts(IgnoreReturnCode),
Dependencies, Makefile(M), Rule(R), Target, Type(Abstract))
import Build.Drasil.Make.Helpers (ad... |
13a5e2b08a1e28c05dd6b6f9944329fd270488dcaf8e2d9049896ba1bc0260c0 | racket/racket7 | check.rkt | #lang racket/base
(require net/url
racket/tcp
"utils.rkt")
(define version-url "-lang.org/version.txt")
(define timeout 30)
(define (url->port url)
(get-pure-port (string->url url)))
(define error-value
(case-lambda
[(what) `(error ,what)]
[(what more)
`(error ,what ,(cond [(list?... | null | https://raw.githubusercontent.com/racket/racket7/5dbb62c6bbec198b4a790f1dc08fef0c45c2e32b/racket/collects/version/check.rkt | racket | Get server information, carefully
Make a decision
we have the newest version (can be > if we have a build from git)
we're stable, but there's a newer version
new version out -- no alphas or we have an alpha => show recent
but if we have an alpha that is older then the current
stable then go to the next case
new... | #lang racket/base
(require net/url
racket/tcp
"utils.rkt")
(define version-url "-lang.org/version.txt")
(define timeout 30)
(define (url->port url)
(get-pure-port (string->url url)))
(define error-value
(case-lambda
[(what) `(error ,what)]
[(what more)
`(error ,what ,(cond [(list?... |
ea212bdbbd6b05642e244dc3f2d58dff5102a1be004f10acbe38f853a1bec316 | diagrams/statestack | StateStack.hs | # LANGUAGE CPP #
# LANGUAGE FlexibleInstances #
# LANGUAGE GeneralizedNewtypeDeriving #
# LANGUAGE MultiParamTypeClasses #
-----------------------------------------------------------------------------
-- |
Module : Control . . StateStack
Copyright : ( c ) 2011 ... | null | https://raw.githubusercontent.com/diagrams/statestack/2b3e63c24ded6e50b465fa066b698d07e63ef69c/Control/Monad/StateStack.hs | haskell | ---------------------------------------------------------------------------
|
License : BSD-style (see LICENSE)
Maintainer :
A state monad which allows the state to be saved and restored on a
stack.
[Computation type:] Computations with implicit access to a
read/write state, with additional operations ... | # LANGUAGE CPP #
# LANGUAGE FlexibleInstances #
# LANGUAGE GeneralizedNewtypeDeriving #
# LANGUAGE MultiParamTypeClasses #
Module : Control . . StateStack
Copyright : ( c ) 2011
system which itself has saveable / restorable state , such as OpenGL
or Cairo... |
d90335b954879530e2a5c7651afba5334aff843189d37666cdd47036538ddb02 | dzen-dhall/dzen-dhall | StartingUp.hs | module DzenDhall.App.StartingUp where
import DzenDhall.AST
import DzenDhall.App as App
import DzenDhall.Arguments
import DzenDhall.Config
import DzenDhall.Data
import DzenDhall.Extra
import DzenDhall.Runtime.Data
import qualified DzenDhall.Animation... | null | https://raw.githubusercontent.com/dzen-dhall/dzen-dhall/ee43b74272d6776ce57adfd7b7d85650580a6cbb/src/DzenDhall/App/StartingUp.hs | haskell | we never close it
Also, new threads for each unique source is created. These threads then
update the outputs.
We don't want to spawn separate threads for identical `Source`s within
the same scope.
duplication when possible.
Note that identical sources from distinct scopes are intentionally allowed:
we don't wan... | module DzenDhall.App.StartingUp where
import DzenDhall.AST
import DzenDhall.App as App
import DzenDhall.Arguments
import DzenDhall.Config
import DzenDhall.Data
import DzenDhall.Extra
import DzenDhall.Runtime.Data
import qualified DzenDhall.Animation... |
2152c8899fd0dbdb77557c6524cea593970271745efe6a0512ab1eafa5f8c107 | gvolpe/musikell | Params.hs | # LANGUAGE DeriveGeneric , OverloadedStrings #
module Http.Client.Params where
import Data.Aeson
import Data.Text ( Text )
import GHC.Generics ( Generic )
newtype AccessToken = AccessToken { unAccessToken :: Text } deriving (Generic, Show)
newtype ... | null | https://raw.githubusercontent.com/gvolpe/musikell/2ec837b605b87b268e460cd6e13b82e7eea8169b/src/Http/Client/Params.hs | haskell | # LANGUAGE DeriveGeneric , OverloadedStrings #
module Http.Client.Params where
import Data.Aeson
import Data.Text ( Text )
import GHC.Generics ( Generic )
newtype AccessToken = AccessToken { unAccessToken :: Text } deriving (Generic, Show)
newtype ... | |
d5278fab38a33a512ba09a616304cc6bcc991f50cc2aef4759416cfca9f85b1a | wwezhuimeng/kazoo | sup.erl | %%%-------------------------------------------------------------------
( C ) 2012 - 2013 , 2600Hz INC
%%% @doc
A really simple escript to accept RPC request and push them
%%% into a running whistle virtual machine.
%%% @end
%%% @contributors
%%%----------------------------------------------------------------... | null | https://raw.githubusercontent.com/wwezhuimeng/kazoo/06a15811dbf123ae1601dc7a4ced956a7e04f58a/utils/sup/src/sup.erl | erlang | -------------------------------------------------------------------
@doc
into a running whistle virtual machine.
@end
@contributors
------------------------------------------------------------------ | ( C ) 2012 - 2013 , 2600Hz INC
A really simple escript to accept RPC request and push them
-module(sup).
-export([main/1]).
-include_lib("whistle/include/wh_types.hrl").
-include_lib("whistle/include/wh_log.hrl").
-define(WHAPPS_VM_ARGS, ["/etc/kazoo/vm.args"
,"/opt/kazoo/whistle_... |
87605b099192c95173e98a07f2b41272c2f05eb0ecbe8162adddf76579e79e35 | aryx/xix | a_out.ml | Copyright 2016 , see copyright.txt
open Common
type header = {
magic: int;
text_size: int;
data_size: int;
bss_size: int;
symbol_size: int;
pc_size: int;
entry: int;
}
(* a.out uses big-endian integers even on low-endian architectures *)
let lput chan word =
if word < 0
then raise (Impossibl... | null | https://raw.githubusercontent.com/aryx/xix/60ce1bd9a3f923e0e8bb2192f8938a9aa49c739c/formats/executables/a_out.ml | ocaml | a.out uses big-endian integers even on low-endian architectures
entry point | Copyright 2016 , see copyright.txt
open Common
type header = {
magic: int;
text_size: int;
data_size: int;
bss_size: int;
symbol_size: int;
pc_size: int;
entry: int;
}
let lput chan word =
if word < 0
then raise (Impossible (spf "should call lput with a uint not %d" word));
could also use... |
87f94c7438346a0c406ebddacce0e17d5881a20d0b81a4cb612b06ff363e02ca | reagent-project/reagent | news051.cljs | (ns reagentdemo.news.news051
(:require [reagent.core :as r]
[reagentdemo.syntax :as s]
[sitetools.core :as tools :refer [link]]
[reagentdemo.common :as common :refer [demo-component]]
[clojure.string :as string]))
(def url "/news/news051.html")
(def title "News in 0.5.... | null | https://raw.githubusercontent.com/reagent-project/reagent/c214466bbcf099eafdfe28ff7cb91f99670a8433/demo/reagentdemo/news/news051.cljs | clojure | (ns reagentdemo.news.news051
(:require [reagent.core :as r]
[reagentdemo.syntax :as s]
[sitetools.core :as tools :refer [link]]
[reagentdemo.common :as common :refer [demo-component]]
[clojure.string :as string]))
(def url "/news/news051.html")
(def title "News in 0.5.... | |
90df4f0d9564db6b5f01a65aeefcfe4e5a3cc689c162f4463ce4003df19f1a94 | SKA-ScienceDataProcessor/RC | File.hs | -- |DNA.Channel.OSKAR2.File.hs
--
-- Reads OSKAR2 Binary files.
--
Copyright ( C ) 2014 Braam Research , LLC
# LANGUAGE DeriveDataTypeable , DeriveGeneric , BangPatterns #
module DNA.Channel.OSKAR2.File (
readOSKAR2BinFileUVWVisibilities
) where
import qualified Control.DeepSeq as CD
import Cont... | null | https://raw.githubusercontent.com/SKA-ScienceDataProcessor/RC/1b5e25baf9204a9f7ef40ed8ee94a86cc6c674af/MS2/lib/DNA/Channel/OSKAR2/File.hs | haskell | |DNA.Channel.OSKAR2.File.hs
Reads OSKAR2 Binary files.
| Copyright ( C ) 2014 Braam Research , LLC
# LANGUAGE DeriveDataTypeable , DeriveGeneric , BangPatterns #
module DNA.Channel.OSKAR2.File (
readOSKAR2BinFileUVWVisibilities
) where
import qualified Control.DeepSeq as CD
import Control.Distributed.Process
import qualified Control.Distributed.Proces... |
6e3e933067205a2187dd2c4f8a03343f21f3fd69cf7da0e267a89cd7347eff94 | screenshotbot/screenshotbot-oss | util.lisp | ;;;; Copyright 2018-Present Modern Interpreters Inc.
;;;;
This Source Code Form is subject to the terms of the Mozilla Public
License , v. 2.0 . If a copy of the MPL was not distributed with this
file , You can obtain one at /.
(uiop:define-package :quick-patch/util
(:use #:cl))
(in-package :quick-patch/util... | null | https://raw.githubusercontent.com/screenshotbot/screenshotbot-oss/24f2673e80a88f8021d1ee5f7d0584379c30ebd5/src/quick-patch/util.lisp | lisp | Copyright 2018-Present Modern Interpreters Inc.
from cl-fad (with slight modifications)
end: from cl-fad | This Source Code Form is subject to the terms of the Mozilla Public
License , v. 2.0 . If a copy of the MPL was not distributed with this
file , You can obtain one at /.
(uiop:define-package :quick-patch/util
(:use #:cl))
(in-package :quick-patch/util)
from cl - str
(defvar *whitespaces* '(#\Space #\Newl... |
9cd1ba9d20502f00117fe9a547bd143ccd698023fb9931551dfbea5ffa5a1f98 | Perry961002/SICP | exe2.49-painter.scm | (load "Chap2\\example\\exa2.2.4-painter.scm")
(load "Chap2\\exercise\\exe2.48-segment.scm")
(load "Chap2\\exercise\\exe2.46-vector.scm")
; a)
(define (painter-a frame)
((segment->painter (list (make-segment (make-vect 0 0) (make-vect 0 1))
(make-segment (make-vect 0 1) (make-vect 1 1))... | null | https://raw.githubusercontent.com/Perry961002/SICP/89d539e600a73bec42d350592f0ac626e041bf16/Chap2/exercise/exe2.49-painter.scm | scheme | a)
b)
c) | (load "Chap2\\example\\exa2.2.4-painter.scm")
(load "Chap2\\exercise\\exe2.48-segment.scm")
(load "Chap2\\exercise\\exe2.46-vector.scm")
(define (painter-a frame)
((segment->painter (list (make-segment (make-vect 0 0) (make-vect 0 1))
(make-segment (make-vect 0 1) (make-vect 1 1))
... |
99eacd6e48cb49336e63b58c3ac6458981351675a4c6aefe68ecaf23cfa07abc | jdreaver/amy | ANF.hs | module Amy.ANF
( module X
) where
import Amy.ANF.AST as X
import Amy.ANF.Convert as X
import Amy.ANF.TypeRep as X
import Amy.ANF.Pretty as X
| null | https://raw.githubusercontent.com/jdreaver/amy/a0c73f6c02e7d923f1d85c0de89f78dc204dae2f/library/Amy/ANF.hs | haskell | module Amy.ANF
( module X
) where
import Amy.ANF.AST as X
import Amy.ANF.Convert as X
import Amy.ANF.TypeRep as X
import Amy.ANF.Pretty as X
| |
f24899d609445524bac1fcf025be7157279887f859dacb60ae75fdb76efbdc36 | HunterYIboHu/htdp2-solution | ex470-gauss.rkt | The first three lines of this file were inserted by . They record metadata
;; about the language level of this file in a form that our tools can easily process.
#reader(lib "htdp-intermediate-lambda-reader.ss" "lang")((modname ex470-gauss) (read-case-sensitive #t) (teachpacks ()) (htdp-settings #(#t constructor repe... | null | https://raw.githubusercontent.com/HunterYIboHu/htdp2-solution/6182b4c2ef650ac7059f3c143f639d09cd708516/Chapter5/Section28-mathematical-examples/ex470-gauss.rkt | racket | about the language level of this file in a form that our tools can easily process.
definitions
intepretation represents a system of linear equations
An Equation is a [List-of Number]
interpretation if (list a1 ... an b) is an Equation,
a1, ..., an are the left-hand side variable coefficients
and b is the right-h... | The first three lines of this file were inserted by . They record metadata
#reader(lib "htdp-intermediate-lambda-reader.ss" "lang")((modname ex470-gauss) (read-case-sensitive #t) (teachpacks ()) (htdp-settings #(#t constructor repeating-decimal #f #t none #f () #f)))
An SOE is an non - empty Matrix
constraint fo... |
b83e434ca2475591cf2598f3918af2b32e67892252f86435b55fb09eebb625c1 | zclj/test.check.insights | coverage_test.cljc | (ns test.check.insights.coverage-test
(:require [clojure.test :refer [deftest testing is]]
[test.check.insights.coverage :as sut]))
(deftest filter-in-sufficient
(testing "Filter sufficiently coverad values from evaluation result"
(is (= [[:negative {::sut/sufficiently-covered? true}]]
(... | null | https://raw.githubusercontent.com/zclj/test.check.insights/8a91b1c4094f74768ff79ee938b98f13f07f1c9a/test/test/check/insights/coverage_test.cljc | clojure | Make sure constants are not changed by mistake | (ns test.check.insights.coverage-test
(:require [clojure.test :refer [deftest testing is]]
[test.check.insights.coverage :as sut]))
(deftest filter-in-sufficient
(testing "Filter sufficiently coverad values from evaluation result"
(is (= [[:negative {::sut/sufficiently-covered? true}]]
(... |
25a834ffb4141601821f92d03af7e3bd208c1986b6fe15c735271f03513390e6 | omarkj/erollbar | erollbar.erl | -module(erollbar).
-type access_token() :: binary().
-type ms() :: non_neg_integer().
-type opt() :: {environment, binary()}|
{platform, binary()}|
{batch_max, pos_integer()}|
{time_max, ms()}|
{endpoint, binary()}|
{host, binary()}|
... | null | https://raw.githubusercontent.com/omarkj/erollbar/23e5930be5156ba40adc86f0d117d056ad2c13e6/src/erollbar.erl | erlang | -module(erollbar).
-type access_token() :: binary().
-type ms() :: non_neg_integer().
-type opt() :: {environment, binary()}|
{platform, binary()}|
{batch_max, pos_integer()}|
{time_max, ms()}|
{endpoint, binary()}|
{host, binary()}|
... | |
26f56a735cd09738c357d7702d32352c11814b4eb07bec9bb3ab8b2bfc918459 | andgate/type-theory-compiler | Monad.hs | # LANGUAGE FlexibleContexts #
module Check.Monad where
import Syntax
import Control.Monad.Reader
import Data.Map (Map)
import qualified Data.Map.Strict as Map
import Data.Text (Text, pack, unpack)
import Unbound.Generics.LocallyNameless
type Tc = FreshMT (Reader Env)
data Env = Env { envDefs :: Map Text Term
... | null | https://raw.githubusercontent.com/andgate/type-theory-compiler/a404f085d19a19b16ae8c26616707dc46707ea10/qtt/src/Check/Monad.hs | haskell | # LANGUAGE FlexibleContexts #
module Check.Monad where
import Syntax
import Control.Monad.Reader
import Data.Map (Map)
import qualified Data.Map.Strict as Map
import Data.Text (Text, pack, unpack)
import Unbound.Generics.LocallyNameless
type Tc = FreshMT (Reader Env)
data Env = Env { envDefs :: Map Text Term
... | |
793541dda126a8445319f15ab8bf2d85f348e3a9d360ab6daa144cd2e9b41a69 | ocsigen/tyxml | svg_f.mli | TyXML
*
* Copyright ( C ) 2011 ,
*
* This program is free software ; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation , with linking exception ;
* either version 2.1 of the License , or ( at you... | null | https://raw.githubusercontent.com/ocsigen/tyxml/8551b673857fdc1defebe7c502ffcb920f04009e/lib/svg_f.mli | ocaml |
open Svg_types
module Unit : sig
open Unit
val rel: float -> 'a quantity
(** Do not specify the unit
* Create a new implementation of [Svg], using the given underlying [Xml]
implementation. Will output a module of type {!Svg_sigs.T} with
the various type equalities.
If your [Xml] implementati... | TyXML
*
* Copyright ( C ) 2011 ,
*
* This program is free software ; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation , with linking exception ;
* either version 2.1 of the License , or ( at you... |
ba52d8dd8ccd9c4e555e219b48d7239502b7da73ce7714f8e39bf73f0dceb2e1 | mauricioabreu/lang-studies | custom-types.hs | # OPTIONS_GHC -Wno - incomplete - patterns #
import qualified Data.Map as Map
data Point = Point Float Float deriving (Show)
data Shape = Circle Point Float | Rectangle Point Point
deriving (Show)
surface :: Shape -> Float
surface (Circle _ r) = pi * r ^ 2
surface (Rectangle (Point x1 y1) (Point x2 y2)) = abs (x2... | null | https://raw.githubusercontent.com/mauricioabreu/lang-studies/2ce0cacdf887fa80e2613869356a6bbd1765eb21/learn-you-a-haskell-exercises/custom-types.hs | haskell | -
-
-
-
-
-
- | # OPTIONS_GHC -Wno - incomplete - patterns #
import qualified Data.Map as Map
data Point = Point Float Float deriving (Show)
data Shape = Circle Point Float | Rectangle Point Point
deriving (Show)
surface :: Shape -> Float
surface (Circle _ r) = pi * r ^ 2
surface (Rectangle (Point x1 y1) (Point x2 y2)) = abs (x2... |
36e2c1fb5badfa76da9d549441314169f435f7cee97a7ce51fca865409307fbe | charlieg/Sparser | context.lisp | ;;; -*- Mode:LISP; Syntax:Common-Lisp; Package:(SPARSER LISP) -*-
copyright ( c ) 1992 -- all rights reserved
;;;
;;; File: "context"
;;; Module: "objects;doc:"
Version : June 1992
initiated 6/18/92
(in-package :sparser)
#| Data structures that maintain contextual information that is
ger... | null | https://raw.githubusercontent.com/charlieg/Sparser/b9bb7d01d2e40f783f3214fc104062db3d15e608/Sparser/code/s/objects/doc/context.lisp | lisp | -*- Mode:LISP; Syntax:Common-Lisp; Package:(SPARSER LISP) -*-
File: "context"
Module: "objects;doc:"
Data structures that maintain contextual information that is
germain to the article as a whole, e.g. for the article's date,
source, topic-company, etc.
----------
indexing
----------
-----------... | copyright ( c ) 1992 -- all rights reserved
Version : June 1992
initiated 6/18/92
(in-package :sparser)
(defvar *context-variables-and-init-values* nil
"accumulates all the symbols. Used as a table -- sorted alphabetically
for display off a menu.")
(defun define-context-variable/expr (symbo... |
5c1e68ba24b9020d3301ae43001586683f30978c404ad0315f3998bc27808687 | ocsigen/obrowser | map.ml | (***********************************************************************)
(* *)
(* Objective Caml *)
(* *)
, projet ... | null | https://raw.githubusercontent.com/ocsigen/obrowser/977c09029ea1e4fde4fb0bf92b4d893835bd9504/rt/caml/map.ml | ocaml | *********************************************************************
Objective Caml
... | , projet Cristal , INRIA Rocquencourt
Copyright 1996 Institut National de Recherche en Informatique et
en Automatique . All rights reserved . This file is distributed
under the terms of the GNU Library General Public License , with
$ I d : map.ml 10468 2010 - 05 - 25 1... |
9dfb6a9db137df964cfaff8704738a79f8457c47184df3955f2b8d215caaa5e6 | G-Corp/kafe | kafe_protocol_group_coordinator.erl | % @hidden
-module(kafe_protocol_group_coordinator).
-compile([{parse_transform, lager_transform}]).
-include("../include/kafe.hrl").
-define(MAX_VERSION, 0).
-export([
run/2,
run/1,
request/2,
response/2
]).
run(ConsumerGroup, force) ->
case kafe_protocol:run(
?... | null | https://raw.githubusercontent.com/G-Corp/kafe/78e014ae5b6d7e1077aa5cabf4adc21ed7abe203/src/kafe_protocol_group_coordinator.erl | erlang | @hidden
GroupCoordinator Request (Version: 0) => group_id
group_id => STRING
GroupCoordinator Response (Version: 0) => error_code coordinator
error_code => INT16
coordinator => node_id host port
node_id => INT32
host => STRING
port => INT32 | -module(kafe_protocol_group_coordinator).
-compile([{parse_transform, lager_transform}]).
-include("../include/kafe.hrl").
-define(MAX_VERSION, 0).
-export([
run/2,
run/1,
request/2,
response/2
]).
run(ConsumerGroup, force) ->
case kafe_protocol:run(
?GROUP_COOR... |
024fd58fa21d357f3980aed48ee4dc1d42bc0075f8cae75d5471202d6649472d | ericcervin/getting-started-with-sketching | pg078b.rkt | #lang sketching
(define (setup)
(size 120 120)
(smoothing 'smoothed)
(set-frame-rate! 60)
(background 200)
)
(define (draw)
(rotate (/ mouse-x 100.0))
(rect -80 -10 160 20)
)
| null | https://raw.githubusercontent.com/ericcervin/getting-started-with-sketching/79fece5dd0bfd08f7bdf4ff34e6ab61a506163be/pg078b.rkt | racket | #lang sketching
(define (setup)
(size 120 120)
(smoothing 'smoothed)
(set-frame-rate! 60)
(background 200)
)
(define (draw)
(rotate (/ mouse-x 100.0))
(rect -80 -10 160 20)
)
| |
3d0af0516b9297b8d39d33152d569637d6f232673cde517bc1f7866c62a50f95 | chiaolun/c4-arena | players.clj | (ns c4-arena.players
(:require
[clojure.core
[async :as async :refer [go go-loop <! >! chan put! alt! alts!]]]
[taoensso.timbre :as tb]
[taoensso.timbre.profiling :refer [defnp p]]
[clojure [string :as string]]
[clojure.data.csv :as csv]
[clojure.java.io :as io]
[c4-arena
[c4-rules :refer... | null | https://raw.githubusercontent.com/chiaolun/c4-arena/71ccb9eacf87da1c4bc1696c46b4bb182c849930/src/c4_arena/players.clj | clojure | This prints out all the states not in the database | (ns c4-arena.players
(:require
[clojure.core
[async :as async :refer [go go-loop <! >! chan put! alt! alts!]]]
[taoensso.timbre :as tb]
[taoensso.timbre.profiling :refer [defnp p]]
[clojure [string :as string]]
[clojure.data.csv :as csv]
[clojure.java.io :as io]
[c4-arena
[c4-rules :refer... |
1f27c1f2957dc0a0595fe4dfbf4930609228181476d886d2f4ccd79bdbb5b97d | dsorokin/aivika | RoundRobbin.hs |
-- |
Module : Simulation . Aivika . Processor .
Copyright : Copyright ( c ) 2009 - 2017 , < >
-- License : BSD3
Maintainer : < >
-- Stability : experimental
Tested with : GHC 8.0.1
--
-- The module defines the Round-Robbin processor.
--
module Simulation.Aivika.Processor.RoundRobbin
(r... | null | https://raw.githubusercontent.com/dsorokin/aivika/7a14f460ab114b0f8cdfcd05d5cc889fdc2db0a4/Simulation/Aivika/Processor/RoundRobbin.hs | haskell | |
License : BSD3
Stability : experimental
The module defines the Round-Robbin processor.
| Represents the Round-Robbin processor that tries to perform the task within
the specified timeout. If the task times out, then it is canceled and returned
to the processor again; otherwise, the successful result is r... |
Module : Simulation . Aivika . Processor .
Copyright : Copyright ( c ) 2009 - 2017 , < >
Maintainer : < >
Tested with : GHC 8.0.1
module Simulation.Aivika.Processor.RoundRobbin
(roundRobbinProcessor,
roundRobbinProcessorUsingIds) where
import Control.Monad
import Simulation.Aivik... |
daaf9e899064e4119a6d979f9c2e3fdb1cdfb7b52136a7061224d849b78a2964 | telostat/haspara | Inventory.hs | # LANGUAGE DataKinds #
# LANGUAGE TypeApplications #
module Tests.Haspara.Accounting.Inventory where
import Data.Default (def)
import Data.Foldable (foldl')
import qualified Data.Sequence as Seq
import qualified Data.Time as Time
import Haspara.Accounting.Inventory (Inventory (..), InventoryEvent (..), InventoryHisto... | null | https://raw.githubusercontent.com/telostat/haspara/6c1c18022bf56b6ae5d5e8135cc75e990f948903/test/Tests/Haspara/Accounting/Inventory.hs | haskell | * Core Definitions
| Type definition for the inventory type used in this module.
| Type definition for the inventory type used in this module.
| Type definition for the inventory history item used in this module.
| Initial inventory.
* Test Specs
* Helper Functions | # LANGUAGE DataKinds #
# LANGUAGE TypeApplications #
module Tests.Haspara.Accounting.Inventory where
import Data.Default (def)
import Data.Foldable (foldl')
import qualified Data.Sequence as Seq
import qualified Data.Time as Time
import Haspara.Accounting.Inventory (Inventory (..), InventoryEvent (..), InventoryHisto... |
71c52820e2b49a821d7370894f4d8de8ac44d4929289dc38fc5dabbcffa71e3a | danlentz/clj-uuid | v1_test.clj | (ns clj-uuid.v1-test
(:require [clojure.test :refer :all]
[clojure.set]
[clj-uuid :refer [v1 get-timestamp]]))
(deftest check-v1-concurrency
(doseq [concur (range 5 9)]
(let [extent 100000
agents (map agent (repeat concur nil))
working (map #(send-off %
... | null | https://raw.githubusercontent.com/danlentz/clj-uuid/5cbd2662dd3fce90ec0b8354e794ca6a1b5ce44c/test/clj_uuid/v1_test.clj | clojure | (ns clj-uuid.v1-test
(:require [clojure.test :refer :all]
[clojure.set]
[clj-uuid :refer [v1 get-timestamp]]))
(deftest check-v1-concurrency
(doseq [concur (range 5 9)]
(let [extent 100000
agents (map agent (repeat concur nil))
working (map #(send-off %
... | |
f8c9229851f8293a66898efd5b0c3f54fc43dcc7423ff20f502196b0ddac808f | xinhaoyuan/morpheus | morpheus_guest.erl | -module(morpheus_guest).
-export([ call_ctl/1
, report_state/1
, cast_ctl/1
, get_node/0
, exit_with/1
, in_sandbox/0
, start_node/4
, set_flags/1
, get_code_path/0
, get_kernel_app/0
, raw_apply/3
, log/1
, global_get/1
... | null | https://raw.githubusercontent.com/xinhaoyuan/morpheus/a402f816a33fb5020d56f3b3e708e3835bebf23a/src/morpheus_guest.erl | erlang | -module(morpheus_guest).
-export([ call_ctl/1
, report_state/1
, cast_ctl/1
, get_node/0
, exit_with/1
, in_sandbox/0
, start_node/4
, set_flags/1
, get_code_path/0
, get_kernel_app/0
, raw_apply/3
, log/1
, global_get/1
... | |
ed3e0c2256a7d6fa3ee6f28c67588b1a035b49793425d63af4f671127a9f1a13 | janestreet/krb | principal_parser.ml | open! Core
open Import
module Result = struct
type t =
{ primary : string
; instance : string option
; realm : string option
}
[@@deriving sexp_of]
end
let parse s =
let split_or_fst ~on s =
match String.rsplit2 ~on s with
| None -> s, None
| Some (fst, snd) -> fst, Some snd
in
l... | null | https://raw.githubusercontent.com/janestreet/krb/5b4366e8c734ee38047522cf69baf3a2d208cfb4/src/principal_parser.ml | ocaml | open! Core
open Import
module Result = struct
type t =
{ primary : string
; instance : string option
; realm : string option
}
[@@deriving sexp_of]
end
let parse s =
let split_or_fst ~on s =
match String.rsplit2 ~on s with
| None -> s, None
| Some (fst, snd) -> fst, Some snd
in
l... | |
c2e5132930a6cef17dbb372a7bedc7181cf0076f2b30007e0158dc0051db8beb | ktakashi/sagittarius-scheme | types.scm | -*- mode : scheme ; coding : utf-8 ; -*-
;;;
;;; encode.scm - ASN.1 BER types
;;;
Copyright ( c ) 2009 - 2012 < >
;;;
;;; Redistribution and use in source and binary forms, with or without
;;; modification, are permitted provided that the following conditions
;;; are met:
;;;
;;; 1. Redistributions... | null | https://raw.githubusercontent.com/ktakashi/sagittarius-scheme/18086ec8343823a0c7f5c90aa5d253246d0dca13/sitelib/asn.1/ber/types.scm | scheme | coding : utf-8 ; -*-
encode.scm - ASN.1 BER types
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
1. Redistributions of source code must retain the above copyright
notice, this list of conditions and t... | Copyright ( c ) 2009 - 2012 < >
" AS IS " AND ANY EXPRESS OR IMPLIED WARRANTIES , INCLUDING , BUT NOT
SPECIAL , EXEMPLARY , OR CONSEQUENTIAL DAMAGES ( INCLUDING , BUT NOT LIMITED
LIABILITY , WHETHER IN CONTRACT , STRICT LIABILITY , OR TORT ( INCLUDING
(library (asn.1 ber types)
(export (rena... |
823ff11d1456185819cca072a976ed11e66cee8cb54f4e55170e3e158676e983 | simmsb/calamity | IntColour.hs | {-# OPTIONS_GHC -Wno-unrecognised-pragmas #-}
{-# HLINT ignore "Redundant bracket due to operator fixities" #-}
-- | An internal newtype for parsing colours
module Calamity.Internal.IntColour (
IntColour (..),
colourToWord64,
colourFromWord64,
) where
import Data.Aeson
import Data.Bits
import Data.Colour
impor... | null | https://raw.githubusercontent.com/simmsb/calamity/be310255b446e87e7432673de1fbc67ef46de3ae/calamity/Calamity/Internal/IntColour.hs | haskell | # OPTIONS_GHC -Wno-unrecognised-pragmas #
# HLINT ignore "Redundant bracket due to operator fixities" #
| An internal newtype for parsing colours |
module Calamity.Internal.IntColour (
IntColour (..),
colourToWord64,
colourFromWord64,
) where
import Data.Aeson
import Data.Bits
import Data.Colour
import Data.Colour.SRGB (RGB (RGB), sRGB24, toSRGB24)
import Data.Word (Word64)
import TextShow
newtype IntColour = IntColour
{ fromIntColour :: Colour Double
... |
c1e8e4e2cb850557719ad54d5888bcfd1451ebf4b983ce43ecf83b9fa0c49022 | flambard/cl-erlang-term | erlang-port.lisp | (in-package :erlang-term)
;;;;
Erlang port
;;;;
(defconstant +port-ext+ 102)
(defclass erlang-port (erlang-identifier)
()
(:documentation "Erlang port."))
;;;
;;; Methods
;;;
(defun make-port (node id creation)
(make-instance 'erlang-port
:node (make-symbol node)
:id id
... | null | https://raw.githubusercontent.com/flambard/cl-erlang-term/8e4da084107c2a6a3778856fe554dc37e9bc46bb/src/erlang-port.lisp | lisp |
Methods
Encode/Decode
PORT_EXT
+-----+------+----+----------+
+-----+------+----+----------+
| 102 | Node | ID | Creation |
+-----+------+----+----------+
| (in-package :erlang-term)
Erlang port
(defconstant +port-ext+ 102)
(defclass erlang-port (erlang-identifier)
()
(:documentation "Erlang port."))
(defun make-port (node id creation)
(make-instance 'erlang-port
:node (make-symbol node)
:id id
:creation cre... |
9d92e96b15494ce33d54555f854ad8a5b48c0e8649dd56991003e2a8ebf4e6fc | haskellari/postgresql-simple | Simple.hs | {-# LANGUAGE DeriveDataTypeable #-}
# LANGUAGE NamedFieldPuns #
{-# LANGUAGE OverloadedStrings #-}
# LANGUAGE PatternGuards #
# LANGUAGE RecordWildCards #
# LANGUAGE ViewPatterns #
------------------------------------------------------------------------------
-- |
-- Module: Database.PostgreSQL.Simple
Copyright... | null | https://raw.githubusercontent.com/haskellari/postgresql-simple/22daa1a40d2631b2fa014197349a5d487a297192/src/Database/PostgreSQL/Simple.hs | haskell | # LANGUAGE DeriveDataTypeable #
# LANGUAGE OverloadedStrings #
----------------------------------------------------------------------------
|
Module: Database.PostgreSQL.Simple
Stability: experimental
A mid-level client library for the PostgreSQL database, aimed at ease of
use and high performance.
------... | # LANGUAGE NamedFieldPuns #
# LANGUAGE PatternGuards #
# LANGUAGE RecordWildCards #
# LANGUAGE ViewPatterns #
Copyright : ( c ) 2011 MailRank , Inc.
( c ) 2011 - 2012
License : BSD3
Maintainer : < >
module Database.PostgreSQL.Simple
(
$ querytype
Connection... |
613a825072ab107a0911b64125206d21798c59afc1615e35890990ebfb9fbe8d | chaoxu/fancy-walks | 130.hs |
import Data.List hiding (union)
import Data.Ord
minus (x:xs) (y:ys) = case (compare x y) of
LT -> x : minus xs (y:ys)
EQ -> minus xs ys
GT -> minus (x:xs) ys
minus xs _ = xs
union (x:xs) (y:ys) = case (compare x y) of
LT -> x : union xs (y:ys)
... | null | https://raw.githubusercontent.com/chaoxu/fancy-walks/952fcc345883181144131f839aa61e36f488998d/projecteuler.net/130.hs | haskell |
import Data.List hiding (union)
import Data.Ord
minus (x:xs) (y:ys) = case (compare x y) of
LT -> x : minus xs (y:ys)
EQ -> minus xs ys
GT -> minus (x:xs) ys
minus xs _ = xs
union (x:xs) (y:ys) = case (compare x y) of
LT -> x : union xs (y:ys)
... | |
0b1a60115b3d38ec37844b240378e69e5fb5d05f4d8b01dffdc7a66744d795e7 | backtracking/mlpost | icairost.ml | (**************************************************************************)
(* *)
Copyright ( C ) Johannes Kanig ,
, and
(* *)
(* This software is f... | null | https://raw.githubusercontent.com/backtracking/mlpost/bd4305289fd64d531b9f42d64dd641d72ab82fd5/src/icairost.ml | ocaml | ************************************************************************
This software is free software; you can redistribute it and/or
described in file LICENSE.... | Copyright ( C ) Johannes Kanig ,
, and
modify it under the terms of the GNU Library General Public
License version 2.1 , with the special exception on linking
open Point_lib
open Format
let create create_surface out_file (draw : Cairo.context -> unit) h w =
i... |
d26ab49f048fb5c7678881366377e8e3a7322b8262e0d27a9d5187157a36067f | joedevivo/chatterbox | h2_frame_push_promise.erl | -module(h2_frame_push_promise).
-include("http2.hrl").
-behaviour(h2_frame).
-export(
[
block_fragment/1,
format/1,
new/2,
promised_stream_id/1,
read_binary/2,
to_binary/1,
to_frame/4
]).
-record(push_promise, {
promised_stream_id :: stream_id(),
block_fragment :... | null | https://raw.githubusercontent.com/joedevivo/chatterbox/560f2c71a151716512781f0f6196a8a9ff678852/src/h2_frame_push_promise.erl | erlang | Maybe break this up into continuations like the data frame
TODO: allow for padding as per HTTP/2 SPEC | -module(h2_frame_push_promise).
-include("http2.hrl").
-behaviour(h2_frame).
-export(
[
block_fragment/1,
format/1,
new/2,
promised_stream_id/1,
read_binary/2,
to_binary/1,
to_frame/4
]).
-record(push_promise, {
promised_stream_id :: stream_id(),
block_fragment :... |
202181776e297cdcf0965545bd84b06c0a142564146c16f0fa480601035a7cdf | opencog/pln | sumo-test2-bc.scm | ;; Use the backward chainer to prove that TheKB2-1 is inconsistent.
;;
;; The reasoning goes as follows
;;
1 . If - 2 is a father , then it has the attribute of
Male . Apply conditional instantiation over KB - test1 - 6 and
;; to conclude
;;
;; (EvaluationLink
( PredicateNode " attribute " )
(
( Co... | null | https://raw.githubusercontent.com/opencog/pln/52dc099e21393892cf5529fef687a69682436b2d/examples/pln/sumo/sumo-test2-bc.scm | scheme | Use the backward chainer to prove that TheKB2-1 is inconsistent.
The reasoning goes as follows
to conclude
(EvaluationLink
(EvaluationLink
Male because attribute is a subrelation of property. Apply
(EvaluationLink
of Female because attribute is a subrelation of property. Apply
(EvaluationLink
Female... | 1 . If - 2 is a father , then it has the attribute of
Male . Apply conditional instantiation over KB - test1 - 6 and
( PredicateNode " attribute " )
(
( ConceptNode " Entity2 - 2 " )
( ConceptNode " Male " ) ) )
2 . If - 2 is a mother , then it has the attribute of
Female . Apply conditi... |
95b541dea46423710b0950f8dd1893905cf6da24509de49b945ea53def0a3b16 | yetanalytics/pedestal-oidc | server.clj | (ns com.yetanalytics.pedestal-oidc.server
(:require [io.pedestal.http :as server]
[io.pedestal.http.route :as route]
[com.yetanalytics.pedestal-oidc.service :as service]
[io.pedestal.log :as log]))
;; This is an adapted service map, that can be started and stopped
;; From the REPL... | null | https://raw.githubusercontent.com/yetanalytics/pedestal-oidc/55c1a4a93937c334d921c546807df8292ec6321d/src/dev/com/yetanalytics/pedestal_oidc/server.clj | clojure | This is an adapted service map, that can be started and stopped
From the REPL you can call server/start and server/stop on this service
start with production configuration
do not block thread that starts web server
Routes can be a function that resolve routes,
we can use this to set the routes to be reloadable
... | (ns com.yetanalytics.pedestal-oidc.server
(:require [io.pedestal.http :as server]
[io.pedestal.http.route :as route]
[com.yetanalytics.pedestal-oidc.service :as service]
[io.pedestal.log :as log]))
(defonce runnable-service (server/create-server service/service))
(defn run-dev
... |
7ddc53976f8899f64f5c7abec93b09ce3658abd782b19c506097a2c13cf646be | juspay/atlas | Types.hs | |
Copyright 2022 Juspay Technologies Pvt Ltd
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
dis... | null | https://raw.githubusercontent.com/juspay/atlas/e64b227dc17887fb01c2554db21c08284d18a806/app/public-transport-bap/src/API/Swagger/Types.hs | haskell | |
Copyright 2022 Juspay Technologies Pvt Ltd
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
dis... | |
50d82024a161bac838d0b48b1fde827d8d2feebad320ac269a4f0ff35a095088 | whalliburton/language | help.lisp | (in-package :language)
(defun help ()
"Lisp helps those who help themselves."
(multiple-value-bind (commands max-size)
;; Figure out the size of the left column and sort the entries.
(loop for var being each external-symbol in :language
collect var into commands
maximizing (leng... | null | https://raw.githubusercontent.com/whalliburton/language/d16ddf05c2b7e067f6f9ce74416c73f0b64b63c4/help.lisp | lisp | Figure out the size of the left column and sort the entries.
!!! Nested formats to set the column size in the control string. | (in-package :language)
(defun help ()
"Lisp helps those who help themselves."
(multiple-value-bind (commands max-size)
(loop for var being each external-symbol in :language
collect var into commands
maximizing (length (symbol-name var)) into max-size
finally (return (value... |
0a460b3d58d38a01d1c48a783802f9edaa6a4932b3cc735956e76de9b6533ccf | Workiva/eva | unify.clj | Copyright 2015 - 2019 Workiva Inc.
;;
;; Licensed under the Eclipse Public License 1.0 (the "License");
;; you may not use this file except in compliance with the License.
;; You may obtain a copy of the License at
;;
;; -1.0.php
;;
;; Unless required by applicable law or agreed to in writing, software
dist... | null | https://raw.githubusercontent.com/Workiva/eva/b7b8a6a5215cccb507a92aa67e0168dc777ffeac/core/src/eva/utils/unify.clj | clojure |
Licensed under the Eclipse Public License 1.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
-1.0.php
Unless required by applicable law or agreed to in writing, software
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either expre... | Copyright 2015 - 2019 Workiva Inc.
distributed under the License is distributed on an " AS IS " BASIS ,
(ns eva.utils.unify)
(defn walk*
"Walks a substitution-map s, resolving all intermediate lvars
(as identified by pred lvar?), until a terminal value is found."
[s u lvar?]
(if-let [pr (s u)]
(if (lv... |
29da2ddab908eabfac2e91153fd9acf55641a1a3d6acc449665e84183fe9d6e4 | ghc/packages-Cabal | Tar.hs | module UnitTests.Distribution.Client.Tar (
tests
) where
import Distribution.Client.Tar ( filterEntries
, filterEntriesM
)
import Codec.Archive.Tar ( Entries(..)
, foldEntries
)
import ... | null | https://raw.githubusercontent.com/ghc/packages-Cabal/6f22f2a789fa23edb210a2591d74ea6a5f767872/cabal-install/tests/UnitTests/Distribution/Client/Tar.hs | haskell | module UnitTests.Distribution.Client.Tar (
tests
) where
import Distribution.Client.Tar ( filterEntries
, filterEntriesM
)
import Codec.Archive.Tar ( Entries(..)
, foldEntries
)
import ... | |
a585aaef75184a3a634d4d37309bc3628e8c39d34832c7ebb20df8dbd93226c0 | ThoughtWorksInc/DeepDarkFantasy | Bimap.hs | # LANGUAGE
NoImplicitPrelude ,
NoMonomorphismRestriction ,
UndecidableSuperClasses ,
TypeApplications ,
ScopedTypeVariables
#
NoImplicitPrelude,
NoMonomorphismRestriction,
UndecidableSuperClasses,
TypeApplications,
ScopedTypeVariables
#-}
module DDF.Bimap (module DDF.Bimap, module DDF.P... | null | https://raw.githubusercontent.com/ThoughtWorksInc/DeepDarkFantasy/4c569aefc03a2bcfb6113b65367201d30077f2b6/DDF/Bimap.hs | haskell | # LANGUAGE
NoImplicitPrelude ,
NoMonomorphismRestriction ,
UndecidableSuperClasses ,
TypeApplications ,
ScopedTypeVariables
#
NoImplicitPrelude,
NoMonomorphismRestriction,
UndecidableSuperClasses,
TypeApplications,
ScopedTypeVariables
#-}
module DDF.Bimap (module DDF.Bimap, module DDF.P... | |
c380f4bf3ec94b8c899de936ef4e8d5af9c4886fceded789211bf134be3e315d | typeclasses/assoc-list | Predicate.hs | # LANGUAGE FlexibleContexts , ScopedTypeVariables , ViewPatterns #
-- | Functions on association lists that involve 'Predicate's on the keys.
module Data.AssocList.ListLike.Predicate
(
-- * Related modules
$ relatedModules
-- * Lookup
lookupFirst
, lookupAll
-- * Removal
, removeFir... | null | https://raw.githubusercontent.com/typeclasses/assoc-list/c22ff8ba2057545015bccf24d71a14358b01627e/assoc-listlike/src/Data/AssocList/ListLike/Predicate.hs | haskell | | Functions on association lists that involve 'Predicate's on the keys.
* Related modules
* Lookup
* Removal
* Mapping
$mapping
* Grouping
base
contravariant
$setup
Some other modules that are a lot like this one:
make use of an 'Eq' constraint on the type of the keys
predicate, if such a mapping is pre... | # LANGUAGE FlexibleContexts , ScopedTypeVariables , ViewPatterns #
module Data.AssocList.ListLike.Predicate
(
$ relatedModules
lookupFirst
, lookupAll
, removeFirst
, removeAll
, mapFirst
, mapAll
, partition
, break
, breakPartition
) where
import Data.AssocList... |
06a7faed834de9b028b338a58e26216478081a8673467147fb1861dc455e566c | janestreet/core | stable_unit_test.ml | open! Import
open Std_internal
include Stable_unit_test_intf
module Make_sexp_deserialization_test (T : Stable_unit_test_intf.Arg) = struct
let%test_unit "sexp deserialization" =
Or_error.combine_errors_unit
(List.map T.tests ~f:(fun (t, sexp_as_string, _) ->
match
Or_error.try_with (fu... | null | https://raw.githubusercontent.com/janestreet/core/b0be1daa71b662bd38ef2bb406f7b3e70d63d05f/core/src/stable_unit_test.ml | ocaml | open! Import
open Std_internal
include Stable_unit_test_intf
module Make_sexp_deserialization_test (T : Stable_unit_test_intf.Arg) = struct
let%test_unit "sexp deserialization" =
Or_error.combine_errors_unit
(List.map T.tests ~f:(fun (t, sexp_as_string, _) ->
match
Or_error.try_with (fu... | |
afef9cc5e296fb5a681ccbc35850bfc884bd619943c505dfca12687b32baaff0 | tmfg/mmtis-national-access-point | operator_users.cljs | (ns ote.views.operator-users
(:require [ote.app.controller.operator-users :as ou]
[ote.ui.table :as table]
[ote.app.utils :as utils]
[ote.localization :refer [tr tr-key]]
[cljs-react-material-ui.reagent :as ui]
[ote.ui.form-fields :as form-fields]
... | null | https://raw.githubusercontent.com/tmfg/mmtis-national-access-point/bff6abd2c02e460ff8cd416f7b5d7fb628df437e/ote/src/cljs/ote/views/operator_users.cljs | clojure | (ns ote.views.operator-users
(:require [ote.app.controller.operator-users :as ou]
[ote.ui.table :as table]
[ote.app.utils :as utils]
[ote.localization :refer [tr tr-key]]
[cljs-react-material-ui.reagent :as ui]
[ote.ui.form-fields :as form-fields]
... | |
615380b4bdf8e02f26473d4738a7f5c39c88f9c110e46761d79596d6a472b399 | nick8325/jukebox | ParseSnippet.hs | Parse little bits of TPTP , e.g. a prelude for a particular tool .
# LANGUAGE CPP , OverloadedStrings #
module Jukebox.TPTP.ParseSnippet where
import Jukebox.TPTP.Parse.Core as TPTP.Parse.Core
import Jukebox.TPTP.Parsec as TPTP.Parsec
import Jukebox.TPTP.Lexer
import Jukebox.Name
import Jukebox.Form hiding (run_)
i... | null | https://raw.githubusercontent.com/nick8325/jukebox/52c3206d7def50c8ebcc0128c442fa6c2bd4e074/src/Jukebox/TPTP/ParseSnippet.hs | haskell | Parse little bits of TPTP , e.g. a prelude for a particular tool .
# LANGUAGE CPP , OverloadedStrings #
module Jukebox.TPTP.ParseSnippet where
import Jukebox.TPTP.Parse.Core as TPTP.Parse.Core
import Jukebox.TPTP.Parsec as TPTP.Parsec
import Jukebox.TPTP.Lexer
import Jukebox.Name
import Jukebox.Form hiding (run_)
i... | |
cb1e759c718d8162cd7fbd2574d9d8ba574f2d6078f516d2ccd5b7fa332efa0e | mzp/coq-ruby | scheme.ml | (************************************************************************)
v * The Coq Proof Assistant / The Coq Development Team
< O _ _ _ , , * CNRS - Ecole Polytechnique - INRIA Futurs - Universite Paris Sud
\VV/ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *... | null | https://raw.githubusercontent.com/mzp/coq-ruby/99b9f87c4397f705d1210702416176b13f8769c1/contrib/extraction/scheme.ml | ocaml | **********************************************************************
// * This file is distributed under the terms of the
* GNU Lesser General Public License Version 2.1
**********************************************************************
s Production of Scheme syntax.
s Sc... | v * The Coq Proof Assistant / The Coq Development Team
< O _ _ _ , , * CNRS - Ecole Polytechnique - INRIA Futurs - Universite Paris Sud
\VV/ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
i $ I d : scheme.ml 11559 2... |
b80ca137e697caa578918e1ea8f014b946f5faef073488e6d560baaf80e504d3 | anwarmamat/cmsc330fall18-public | disc.ml | (********************)
(* String Functions *)
(********************)
Joins together the strings in xs by separator sep
e.g. join [ " cat " ; " dog " ; " fish " ] " , " = " cat , dog , fish " .
e.g. join ["cat"; "dog"; "fish"] "," = "cat,dog,fish". *)
let join (xs : string list) (sep : string) : string =
""... | null | https://raw.githubusercontent.com/anwarmamat/cmsc330fall18-public/12585d98d45f954f75e2f78df3062444f5f97cf6/discussions/disc5/src/disc.ml | ocaml | ******************
String Functions
******************
******************
Option Functions
******************
Converts an option to a list. Some is a singleton containing
the value, while None is an empty list.
If the pair's key matches k then return the value as an option.
Otherwise return None.
********... |
Joins together the strings in xs by separator sep
e.g. join [ " cat " ; " dog " ; " fish " ] " , " = " cat , dog , fish " .
e.g. join ["cat"; "dog"; "fish"] "," = "cat,dog,fish". *)
let join (xs : string list) (sep : string) : string =
""
let list_of_option (o : 'a option) : 'a list =
[]
Returns the... |
37e33cbd367efdcf69cacc1ad257ac72c429497d9ca0e45b3db0bd4b5f1e2a1d | opencog/opencog | data_#5.scm | Test # 5
;; Anaphora is "that"
;; Antecedent is a noun
;; Expected result:
;; Acceptance
Connection between two clauses
(ListLink
(AnchorNode "CurrentResolution")
(WordInstanceNode "anaphor")
(WordInstanceNode "antecedent")
)
(ListLink
(AnchorNode "CurrentPronoun")
(WordInstanceNode "anaphor... | null | https://raw.githubusercontent.com/opencog/opencog/53f2c2c8e26160e3321b399250afb0e3dbc64d4c/tests/nlp/anaphora/data/propose/filter-%231/data_%235.scm | scheme | Anaphora is "that"
Antecedent is a noun
Expected result:
Acceptance
filter tests | Test # 5
Connection between two clauses
(ListLink
(AnchorNode "CurrentResolution")
(WordInstanceNode "anaphor")
(WordInstanceNode "antecedent")
)
(ListLink
(AnchorNode "CurrentPronoun")
(WordInstanceNode "anaphor")
)
(ListLink
(AnchorNode "CurrentProposal")
(WordInstanceNode "anteced... |
c0bff45812f054e34a2ff831be2cc76f08c370a87e8ce1bc6890c67f6a2e002d | ghc/testsuite | LoopOfTheDay3.hs | # LANGUAGE MultiParamTypeClasses , FlexibleInstances ,
OverlappingInstances , UndecidableInstances #
OverlappingInstances, UndecidableInstances #-}
Instances compile fine but instance selection loops in GHC 6.2 .
try : : t foo ( T1a 1 )
-- This is essentially the same as LoopOfTheDay2.h... | null | https://raw.githubusercontent.com/ghc/testsuite/998a816ae89c4fd573f4abd7c6abb346cf7ee9af/tests/typecheck/should_compile/LoopOfTheDay3.hs | haskell | This is essentially the same as LoopOfTheDay2.hs
but with the innocent (?) use of overlapping instances. | # LANGUAGE MultiParamTypeClasses , FlexibleInstances ,
OverlappingInstances , UndecidableInstances #
OverlappingInstances, UndecidableInstances #-}
Instances compile fine but instance selection loops in GHC 6.2 .
try : : t foo ( T1a 1 )
module ShouldCompile where
data T1 = T1a Int | ... |
b543db32bd2ad7b863c2733ccf4ef3849c705dec9832b5db31c8c6d0cf2f37e9 | wincent/docvim | Tasty.hs | # LANGUAGE CPP #
# OPTIONS_GHC -fno - warn - type - defaults #
module Main (main) where
#if !MIN_VERSION_base(4,8,0)
import Control.Applicative ((<$>))
#endif
import Control.DeepSeq
import Control.Exception hiding (assert)
import Data.ByteString.Lazy.UTF8 (fromString, toString)
import Data.Char
import Data.List --(is... | null | https://raw.githubusercontent.com/wincent/docvim/621a4d30f17a9fda64cf6b37d4608cbe08bc72e3/tests/Tasty.hs | haskell | (isPrefixOf, sort)
| Crude check to see if parse worked.
skip everything else
will need to pass in plugin name (prefix) to make this work
list monad
list monad
match standard text editor behavior.
| This is based on `goldenVsStringDiff` function defined in:
-golden/blob/470e7af018/Test/Tasty/Golden.hs#L150-L191... | # LANGUAGE CPP #
# OPTIONS_GHC -fno - warn - type - defaults #
module Main (main) where
#if !MIN_VERSION_base(4,8,0)
import Control.Applicative ((<$>))
#endif
import Control.DeepSeq
import Control.Exception hiding (assert)
import Data.ByteString.Lazy.UTF8 (fromString, toString)
import Data.Char
import Data.Monoid
imp... |
9758ec6fc2b9ce872c447be22043f8a918c5e0c4b86d3569bfe698d49b514f9c | monadbobo/ocaml-core | write_c.ml | (* Write_c: wrapping unsafe C-style writers to safe ML-style ones. *)
open Bigarray
open Common
open Unsafe_common
let unsafe_get_init buf ~pos =
if pos < 0 then array_bound_error ()
else
let buf_len = Array1.dim buf in
if pos > buf_len then raise Buffer_short
else
let start = get_sptr buf ~pos... | null | https://raw.githubusercontent.com/monadbobo/ocaml-core/9c1c06e7a1af7e15b6019a325d7dbdbd4cdb4020/base/bin_prot/lib/write_c.ml | ocaml | Write_c: wrapping unsafe C-style writers to safe ML-style ones. |
open Bigarray
open Common
open Unsafe_common
let unsafe_get_init buf ~pos =
if pos < 0 then array_bound_error ()
else
let buf_len = Array1.dim buf in
if pos > buf_len then raise Buffer_short
else
let start = get_sptr buf ~pos:0 in
let sptr = get_sptr buf ~pos in
let eptr = get_eptr ... |
457dab4e89b0d1c245ff223753a884f5215ff04852754919f0dd7deb3107e692 | cse-bristol/110-thermos-ui | schema.clj | This file is part of THERMOS , copyright © Centre for Sustainable Energy , 2017 - 2021
Licensed under the Reciprocal Public License v1.5 . See LICENSE for licensing details .
(ns thermos-test.backend.spreadsheet.schema
(:require [clojure.test :refer :all]
[thermos-backend.spreadsheet.schema :as schem... | null | https://raw.githubusercontent.com/cse-bristol/110-thermos-ui/e13b96329f3c95e5a10bae431e8ae9bccdb475f4/test/thermos_ui/test/backend/spreadsheet/schema.clj | clojure | This file is part of THERMOS , copyright © Centre for Sustainable Energy , 2017 - 2021
Licensed under the Reciprocal Public License v1.5 . See LICENSE for licensing details .
(ns thermos-test.backend.spreadsheet.schema
(:require [clojure.test :refer :all]
[thermos-backend.spreadsheet.schema :as schem... | |
eee632871864d53d2de0170dc818abbd92958c2b82c05593c0d50d841a1e9ffc | darwin/blender-clojure | runtime.cljs | (ns bcljs.runtime
(:require [bcljs.runtime.marshalling :as marshalling]))
; calls to these functions may be emitted by compiler macros
(def marshal-kw-args marshalling/marshal-kw-args)
| null | https://raw.githubusercontent.com/darwin/blender-clojure/bbdb5071d3f4a33ccbdb5a67818df58ae6767716/bcljs/src/lib/bcljs/runtime.cljs | clojure | calls to these functions may be emitted by compiler macros | (ns bcljs.runtime
(:require [bcljs.runtime.marshalling :as marshalling]))
(def marshal-kw-args marshalling/marshal-kw-args)
|
6b7b3eda54f40e9a370160db6c075e8dbe4da7a7edd50c513501e920f76f31e3 | txkaduo/weixin-mp-sdk | Types.hs | # LANGUAGE StandaloneDeriving #
# LANGUAGE GeneralizedNewtypeDeriving #
# LANGUAGE ScopedTypeVariables #
# LANGUAGE CPP #
# OPTIONS_GHC -fno - prof - auto #
module WeiXin.PublicPlatform.ThirdParty.Types where
{ { { 1 imports
import ClassyPrelude
#if !MIN_VERSION_base(4, 13, 0)
import Control.Monad.Reader ... | null | https://raw.githubusercontent.com/txkaduo/weixin-mp-sdk/87fe2bc97d4b1fe982341aaa68f32fb846b905e5/WeiXin/PublicPlatform/ThirdParty/Types.hs | haskell | | component_verify_ticket
| authorization_code
| 文档没有说明授权失败时,如何从微信平台返回
暂时认为跟 oauth 一样的逻辑
| refresh token
因为通常跟相应的 AppId 一起使用,所以打包在一起
| component_access_token
因为通常跟相应的 AppId 一起使用,所以打包在一起
^ 我方的 app id
| pre_auth_code
| 第三方接口多处用到的类似的XML报文中的真正数据
是授权事件接收URL能收到的全部事件
^ component_verify_ticket 事件推送
^ 取消授权通知:数据为授权... | # LANGUAGE StandaloneDeriving #
# LANGUAGE GeneralizedNewtypeDeriving #
# LANGUAGE ScopedTypeVariables #
# LANGUAGE CPP #
# OPTIONS_GHC -fno - prof - auto #
module WeiXin.PublicPlatform.ThirdParty.Types where
{ { { 1 imports
import ClassyPrelude
#if !MIN_VERSION_base(4, 13, 0)
import Control.Monad.Reader ... |
4bdec1cffbbef3e194bf0a549a844672fb27405ccf4724c0f102c0b22f4fb610 | callum-oakley/advent-of-code | 11.clj | (ns aoc.2021.11
(:require
[aoc.grid :as grid]
[clojure.string :as str]
[clojure.test :refer [deftest is]]))
(defn parse [s]
(grid/parse s #(- (int %) (int \0))))
(defn inc-energy [octopus->energy octopuses]
(reduce (fn [[octopus->energy excited] octopus]
[(update octopus->energy octopus inc... | null | https://raw.githubusercontent.com/callum-oakley/advent-of-code/3cf44bcb8c57693639630f95f29d4abf49a6f0e4/src/aoc/2021/11.clj | clojure | (ns aoc.2021.11
(:require
[aoc.grid :as grid]
[clojure.string :as str]
[clojure.test :refer [deftest is]]))
(defn parse [s]
(grid/parse s #(- (int %) (int \0))))
(defn inc-energy [octopus->energy octopuses]
(reduce (fn [[octopus->energy excited] octopus]
[(update octopus->energy octopus inc... | |
d7212aa15aed9f5e2739260b78430b944aab481f6ffb6d8e25710b6a5c757bd1 | rabbitmq/rabbitmq-shovel | rabbit_amqp10_shovel.erl | This Source Code Form is subject to the terms of the Mozilla Public
License , v. 2.0 . If a copy of the MPL was not distributed with this
file , You can obtain one at /.
%%
Copyright ( c ) 2007 - 2020 VMware , Inc. or its affiliates . All rights reserved .
%%
-module(rabbit_amqp10_shovel).
-behaviour(rabbit... | null | https://raw.githubusercontent.com/rabbitmq/rabbitmq-shovel/f9f4e95343a81aea093687b0fd610711bd3f70ac/src/rabbit_amqp10_shovel.erl | erlang |
wait for link credit here as if there are messages waiting we may try
to forward before we've received credit
mixed settlement mode covers all the ack_modes
needs to be sync, i.e. awaits the 'attach' event as
else we may try to use the link before it is ready
not found - this should ideally not happen
we have ... | This Source Code Form is subject to the terms of the Mozilla Public
License , v. 2.0 . If a copy of the MPL was not distributed with this
file , You can obtain one at /.
Copyright ( c ) 2007 - 2020 VMware , Inc. or its affiliates . All rights reserved .
-module(rabbit_amqp10_shovel).
-behaviour(rabbit_shove... |
b9746afb64e127653b9011ea4d9ea859c1df27870bd87e58ed6184759add879f | EveryTian/Haskell-Codewars | Tests.hs | # OPTIONS_GHC -fno - warn - type - defaults #
# LANGUAGE RecordWildCards #
import Data.Bifunctor (bimap)
import Data.Char (toLower)
import Data.Foldable (for_)
import GHC.Exts (fromList, toList)
import Test.Hspec (Spec, describe, it, shouldMatchList)
import Test.Hspec.Runner (configFastF... | null | https://raw.githubusercontent.com/EveryTian/Haskell-Codewars/dc48d95c676ce1a59f697d07672acb6d4722893b/exercism/word-count/test/Tests.hs | haskell | Here we used `fromIntegral`, `fromList` and `toList` to generalize
the tests, accepting any function that receives a string-like argumment
and returns a type that can be converted to [(String, Integer)].
Also, the words are lower-cased before comparison and the output's
order is ignored. | # OPTIONS_GHC -fno - warn - type - defaults #
# LANGUAGE RecordWildCards #
import Data.Bifunctor (bimap)
import Data.Char (toLower)
import Data.Foldable (for_)
import GHC.Exts (fromList, toList)
import Test.Hspec (Spec, describe, it, shouldMatchList)
import Test.Hspec.Runner (configFastF... |
70f0f497918a0bf31a7cfad836bbaf5dd20a8fcd93aaa8c9cb395a137e1209df | MyDataFlow/ttalk-server | mam_jid_rfc.erl | %%% @doc Encoding and decoding using encoding described in XMPP RFC specification
-module(mam_jid_rfc).
-export([encode/2,
decode/2]).
-behaviour(mam_jid).
encode(_UserJID, JID) ->
jid:to_binary(jid:to_lower(JID)).
decode(_UserJID, BSrcJID) ->
jid:from_binary(BSrcJID).
| null | https://raw.githubusercontent.com/MyDataFlow/ttalk-server/07a60d5d74cd86aedd1f19c922d9d3abf2ebf28d/apps/ejabberd/src/mam_jid_rfc.erl | erlang | @doc Encoding and decoding using encoding described in XMPP RFC specification | -module(mam_jid_rfc).
-export([encode/2,
decode/2]).
-behaviour(mam_jid).
encode(_UserJID, JID) ->
jid:to_binary(jid:to_lower(JID)).
decode(_UserJID, BSrcJID) ->
jid:from_binary(BSrcJID).
|
f98aee83cf2d452fef2ec35d58df39f1322530efcc2f55d21408a4b5da0a6061 | mokus0/polynomial | Polynomial.hs | # LANGUAGE ParallelListComp , ViewPatterns , FlexibleContexts #
# OPTIONS_GHC -fno - warn - orphans #
module Math.Polynomial
( Endianness(..)
, Poly, poly, polyDegree
, polyCoeffs, polyIsZero, polyIsOne
, zero, one, constPoly, x
, scalePoly, negatePoly
, composePoly
, addPoly, sumPolys, mult... | null | https://raw.githubusercontent.com/mokus0/polynomial/42fde2c9a72f449eeda4d534acfe64b8e92b5c27/src/Math/Polynomial.hs | haskell | instance
to re-export
|Given some constant 'k', construct the polynomial whose value is
constantly 'k'.
|Given some scalar 's' and a polynomial 'f', computes the polynomial 'g'
such that:
> evalPoly g x = s * evalPoly f x
|Given some polynomial 'f', computes the polynomial 'g' such that:
> evalPoly g x =... | # LANGUAGE ParallelListComp , ViewPatterns , FlexibleContexts #
# OPTIONS_GHC -fno - warn - orphans #
module Math.Polynomial
( Endianness(..)
, Poly, poly, polyDegree
, polyCoeffs, polyIsZero, polyIsOne
, zero, one, constPoly, x
, scalePoly, negatePoly
, composePoly
, addPoly, sumPolys, mult... |
9e05235b9d3fcecd04957d777d9b023c57a395f65e4f915c1c04beb3c1e7aa92 | kumarshantanu/quiddity | internal.cljc | 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/quiddity/834f8fe18194f1038909211e0e55464535f68c47/src/quiddity/internal.cljc | 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 quiddity.internal
#?(:cljs (:require
[goog.string :as gstring]
[goog.string.format]))
#?(:clj (:import
[clojure.lang IDeref])))
(def sformat #?(:cljs gstring/format :clj format))
(def ^{:dynamic true
:doc "Volatile ... |
b6748c879d766a825a2bd3cd47e4826882c36db6be4e75ad8cee73997aee377c | cedlemo/OCaml-GI-ctypes-bindings-generator | Attach_options.mli | open Ctypes
type t = Expand | Shrink | Fill
type t_list = t list
val of_value:
Unsigned.uint32 -> t
val to_value:
t -> Unsigned.uint32
val list_of_value:
Unsigned.uint32 -> t_list
val list_to_value:
t_list -> Unsigned.uint32
val t_list_view : t_list typ
| null | https://raw.githubusercontent.com/cedlemo/OCaml-GI-ctypes-bindings-generator/21a4d449f9dbd6785131979b91aa76877bad2615/tools/Gtk3/Attach_options.mli | ocaml | open Ctypes
type t = Expand | Shrink | Fill
type t_list = t list
val of_value:
Unsigned.uint32 -> t
val to_value:
t -> Unsigned.uint32
val list_of_value:
Unsigned.uint32 -> t_list
val list_to_value:
t_list -> Unsigned.uint32
val t_list_view : t_list typ
| |
258f9ae892bf85232905de3460d05c9c6085f57c22b2b3772e4ad7af5a8a0620 | patricoferris/ocaml-multicore-monorepo | waiters.mli | type 'a t
(* A queue of fibers waiting for something.
Note: an [_ t] is not thread-safe itself.
To use share it between domains, the user is responsible for wrapping it in a mutex. *)
val create : unit -> 'a t
val wake_all : 'a t -> 'a -> unit
(** [wake_all t] calls (and removes) all the functions waiting on [t... | null | https://raw.githubusercontent.com/patricoferris/ocaml-multicore-monorepo/624b3293ee41e83736fe7ac3a79f810c2b70f68b/duniverse/eio/lib_eio/waiters.mli | ocaml | A queue of fibers waiting for something.
Note: an [_ t] is not thread-safe itself.
To use share it between domains, the user is responsible for wrapping it in a mutex.
* [wake_all t] calls (and removes) all the functions waiting on [t].
If [t] is shared between domains, the caller must hold the mutex while ... | type 'a t
val create : unit -> 'a t
val wake_all : 'a t -> 'a -> unit
val wake_one : 'a t -> 'a -> [`Ok | `Queue_empty]
* [ wake_one t ] is like { ! , but only calls ( and removes ) the first waiter in the queue .
If [ t ] is shared between domains , the caller must hold the mutex while calling this .
If... |
7f7a754babad6f1d2f385c2c1f0d85a3b819e2f7f586fbefdcdc1ec3ca0b7767 | Eonblast/Trinity | hello_gen_server.erl | : Gen Server Skeleton
% --------------------------------
% file: eonbeam/dev/3/h_supervisortest/hello_gen_server.erl
unclear source . taken from Emysql but must come from www.erlang.org .
-module(hello_gen_server).
-behaviour(gen_server).
-export([start_link/0, init/1, handle_call/3, handle_cast/2]).
-export([h... | null | https://raw.githubusercontent.com/Eonblast/Trinity/15bcc0fa0997d7dd360f1542493e63208645bd88/h_supervisortest/hello_gen_server.erl | erlang | --------------------------------
file: eonbeam/dev/3/h_supervisortest/hello_gen_server.erl
====================================================================
API
====================================================================
--------------------------------------------------------------------
Description: S... | : Gen Server Skeleton
unclear source . taken from Emysql but must come from www.erlang.org .
-module(hello_gen_server).
-behaviour(gen_server).
-export([start_link/0, init/1, handle_call/3, handle_cast/2]).
-export([handle_info/2, terminate/2, code_change/3]).
Function : start_link ( ) - > { ok , Pid } | ign... |
086a49b1b348b661b4a2b8196b9ca41e256ba0f4b6b4f6e6930b74ca8c4a23a3 | ryukinix/leraxandria | game-of-life-lain.lisp | ;;; ****************************************************************
Conway 's Game of Life * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
;;; ****************************************************************
;;; Don't know where/when got this. --mk
(defpackage #:leraxandria/game... | null | https://raw.githubusercontent.com/ryukinix/leraxandria/e8c4d1f6d1e88072fbd58dd6c48b5d80577f3b62/apps/game-of-life-lain.lisp | lisp | ****************************************************************
****************************************************************
Don't know where/when got this. --mk
set the next bit pattern
reset the bounds, if necessary | Conway 's Game of Life * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
(defpackage #:leraxandria/game-of-life/lain
(:use :cl :cl-user)
(:export #:life
#:main))
(in-package #:leraxandria/game-of-life/lain)
(defstruct (world (:print-function
(lam... |
3dde0e4ad821a1bbc84892f1ba8d2abe918002a00415c299a6fe30cb47a8c7f6 | fukamachi/fukacl | shell.lisp | (in-package :fukacl)
(defun args ()
#+allegro (system:command-line-arguments)
#+sbcl sb-ext:*posix-argv*
#+clisp ext:*args*
#+ecl (si:command-args)
#+cmu ext:*command-line-words*
#+ccl ccl:*command-line-argument-list*
#+lispworks system:*line-arguments-list*)
| null | https://raw.githubusercontent.com/fukamachi/fukacl/c633005755c4273dbee3aef54a8d86a8fbecc6f5/shell.lisp | lisp | (in-package :fukacl)
(defun args ()
#+allegro (system:command-line-arguments)
#+sbcl sb-ext:*posix-argv*
#+clisp ext:*args*
#+ecl (si:command-args)
#+cmu ext:*command-line-words*
#+ccl ccl:*command-line-argument-list*
#+lispworks system:*line-arguments-list*)
| |
2abc9d57d9afb54771091ca2443202956e4fede646f25c7d523aa42fca3bd8bf | webyrd/n-grams-for-synthesis | generators-test.scm | (use test)
(use srfi-121)
(use (only srfi-1 unfold))
(use (only srfi-13 string-for-each))
(use srfi-4)
(test-group "generators"
(test-group "generators/constructors"
(test '() (generator->list (generator)))
(test '(1 2 3) (generator->list (generator 1 2 3)))
(test '(8 9 10) (generator->list (make-iota-ge... | null | https://raw.githubusercontent.com/webyrd/n-grams-for-synthesis/b53b071e53445337d3fe20db0249363aeb9f3e51/datasets/srfi/srfi-121/generators/generators-test.scm | scheme | end "generators/constructors"
end "generators/operators"
no test for plain generator->list (used throughout)
end "generators/consumers"
end "generators" | (use test)
(use srfi-121)
(use (only srfi-1 unfold))
(use (only srfi-13 string-for-each))
(use srfi-4)
(test-group "generators"
(test-group "generators/constructors"
(test '() (generator->list (generator)))
(test '(1 2 3) (generator->list (generator 1 2 3)))
(test '(8 9 10) (generator->list (make-iota-ge... |
72294f99b57a619a5fc4a3808da90ac2348d4da0fb31c49869c7301b16bfe10a | Clojure2D/clojure2d-examples | scene.clj | (ns rt4.the-next-week.ch05a.scene
(:require [fastmath.vector :as v]
[fastmath.core :as m]
[rt4.the-next-week.ch05a.hittable :as hittable]
[rt4.the-next-week.ch05a.interval :as interval]
[rt4.the-next-week.ch05a.material :as material]
[rt4.common :as common]
... | null | https://raw.githubusercontent.com/Clojure2D/clojure2d-examples/ead92d6f17744b91070e6308157364ad4eab8a1b/src/rt4/the_next_week/ch05a/scene.clj | clojure | (ns rt4.the-next-week.ch05a.scene
(:require [fastmath.vector :as v]
[fastmath.core :as m]
[rt4.the-next-week.ch05a.hittable :as hittable]
[rt4.the-next-week.ch05a.interval :as interval]
[rt4.the-next-week.ch05a.material :as material]
[rt4.common :as common]
... | |
cb89b4583e05c41e362f7f8084e334bdb8aa59c5791fb80a05801dc9ec8c26c6 | let-def/ttx | ttx_types_gen.mli | type type_expr
type type_scheme
type value_desc
type constructor
type label
type type_decl
type functor_parameter
type module_type
type module_decl
type module_type_decl
type signature_item
type signature
open Ttx_def
module Type_expr : sig
type t = type_expr
type desc =
| Var of Type_level.variable
| Arr... | null | https://raw.githubusercontent.com/let-def/ttx/0a50ba7253056d1202f108b67faf4d9cc78e020d/attic/abstract-astgen/ttx_types_gen.mli | ocaml | type type_expr
type type_scheme
type value_desc
type constructor
type label
type type_decl
type functor_parameter
type module_type
type module_decl
type module_type_decl
type signature_item
type signature
open Ttx_def
module Type_expr : sig
type t = type_expr
type desc =
| Var of Type_level.variable
| Arr... | |
58f491c55b31e5a854327db6682a2b21dada993d3c287bbdd59b27b23de6a9f8 | LCBH/UKano | proswapper.ml | * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* *
* Cryptographic protocol verifier *
* *
... | null | https://raw.githubusercontent.com/LCBH/UKano/13c046ddaca48b45d3652c3ea08e21599e051527/proverif2.01/src/proswapper.ml | ocaml | split function
[split_term bv bn t] returns a pair [(t',subst)] where
[t'] is a term and [subst] is a substitution
(represented as a list of pairs (variable, image)), such that
[t = t' subst], the image of [subst] consists of the largest
possible subterms of [t] that do not contain
the variable... | * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* *
* Cryptographic protocol verifier *
* *
... |
74b160de1422c822ae26dc7fc76b64867e580daeb0f9bc1e94c8655176c9df6c | lojic/LearningRacket | triangle.rkt | #lang racket
(provide triangle)
(define (invalid-lengths? a b c)
(or (>= a (+ b c))
(>= b (+ a c))
(>= c (+ a b))))
(define/match (triangle a b c)
[ (a b c) #:when (ormap negative? (list a b c)) '(error "negative side length(s)") ]
[ (a b c) #:when (invalid-lengths? a b c) '(error "invalid sid... | null | https://raw.githubusercontent.com/lojic/LearningRacket/eb0e75b0e16d3e0a91b8fa6612e2678a9e12e8c7/exercism.io/triangle/triangle.rkt | racket | #lang racket
(provide triangle)
(define (invalid-lengths? a b c)
(or (>= a (+ b c))
(>= b (+ a c))
(>= c (+ a b))))
(define/match (triangle a b c)
[ (a b c) #:when (ormap negative? (list a b c)) '(error "negative side length(s)") ]
[ (a b c) #:when (invalid-lengths? a b c) '(error "invalid sid... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.