_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
55e9594d2de0281177045e526a207682ed88f70ee6598d8569d5f7b233449fb0
nextjournal/clerk-demo
zipper_with_scars.clj
# Clojure Zippers with Scars à la ;; _Building scars into clojure zipper library to go up and back down at the previous location._ (ns zipper-with-scars {:nextjournal.clerk/visibility {:code :fold} :nextjournal.clerk/no-cache true} (:require [clojure.zip :as zip] [arrowic.core :as a] [...
null
https://raw.githubusercontent.com/nextjournal/clerk-demo/e004b275b98f677d30724b234285da22c16980fa/notebooks/zipper_with_scars.clj
clojure
_Building scars into clojure zipper library to go up and back down at the previous location._ I recently stumbled into a parsing scenario where a stream of tokens is folded onto a zipper. Some of these tokens would just push a new child at the current location while others would also need to vary the shape some anc...
# Clojure Zippers with Scars à la (ns zipper-with-scars {:nextjournal.clerk/visibility {:code :fold} :nextjournal.clerk/no-cache true} (:require [clojure.zip :as zip] [arrowic.core :as a] [nextjournal.clerk :as clerk] [nextjournal.clerk.viewer :as v] [clojure.st...
e4668494aa6b7bc5703f8028abd514483daba11776e02ee789eaf4ed90733836
tsoding/HyperNerd
OrgMode.hs
{-# LANGUAGE OverloadedStrings #-} module OrgMode ( renderTable ) where import Data.List import qualified Data.Text as T charEscapeList :: String charEscapeList = "|" renderTable :: [T.Text] -> [[T.Text]] -> T.Text renderTable header rows = T.unlines ([renderRow header, "|-"] <> map (renderRow . normalizeRow)...
null
https://raw.githubusercontent.com/tsoding/HyperNerd/5322580483c5c05179bc455a6f94566d398bccdf/src/OrgMode.hs
haskell
# LANGUAGE OverloadedStrings #
module OrgMode ( renderTable ) where import Data.List import qualified Data.Text as T charEscapeList :: String charEscapeList = "|" renderTable :: [T.Text] -> [[T.Text]] -> T.Text renderTable header rows = T.unlines ([renderRow header, "|-"] <> map (renderRow . normalizeRow) rows) where normalizeRow row...
ca1acd96f0e809756a1982fe6dfe915a38f447c74945ed4dc69afb6bb0a16675
RichiH/git-annex
Repair.hs
git - annex command - - Copyright 2013 < > - - Licensed under the GNU GPL version 3 or higher . - - Copyright 2013 Joey Hess <> - - Licensed under the GNU GPL version 3 or higher. -} module Command.Repair where import Command import qualified Annex import qualified Git.Repair import qualified...
null
https://raw.githubusercontent.com/RichiH/git-annex/bbcad2b0af8cd9264d0cb86e6ca126ae626171f3/Command/Repair.hs
haskell
This command can be run in git repos not using git-annex, so avoid git annex branch stuff in that case.
git - annex command - - Copyright 2013 < > - - Licensed under the GNU GPL version 3 or higher . - - Copyright 2013 Joey Hess <> - - Licensed under the GNU GPL version 3 or higher. -} module Command.Repair where import Command import qualified Annex import qualified Git.Repair import qualified...
0195683ac9b58b6c02ddd6504ed3efef98495631d35e78faac83c1ea66002500
let-def/menhir
parserAux.ml
(**************************************************************************) (* *) Menhir (* *) , INRIA Ro...
null
https://raw.githubusercontent.com/let-def/menhir/e8ba7bef219acd355798072c42abbd11335ecf09/src/parserAux.ml
ocaml
************************************************************************ et en Automatique. All rig...
Menhir , INRIA Rocquencourt , PPS , Université Paris Diderot Copyright 2005 - 2008 Institut National de Recherche en Informatique under the terms of the Q Public License versi...
3c119384b7a0874a7247cd5a5d25581bd11b4c9e57b881184f05dea027849068
juspay/atlas
DriverQuote.hs
# LANGUAGE DerivingStrategies # # LANGUAGE GeneralizedNewtypeDeriving # # LANGUAGE QuasiQuotes # # LANGUAGE StandaloneDeriving # # LANGUAGE TemplateHaskell # # OPTIONS_GHC -Wno - orphans # | Copyright 2022 Juspay Technologies Pvt Ltd Licensed under the Apache License , Version 2.0 ( the " License " ) ; you m...
null
https://raw.githubusercontent.com/juspay/atlas/e64b227dc17887fb01c2554db21c08284d18a806/app/driver-offer-bpp/src/Storage/Tabular/DriverQuote.hs
haskell
# LANGUAGE DerivingStrategies # # LANGUAGE GeneralizedNewtypeDeriving # # LANGUAGE QuasiQuotes # # LANGUAGE StandaloneDeriving # # LANGUAGE TemplateHaskell # # OPTIONS_GHC -Wno - orphans # | Copyright 2022 Juspay Technologies Pvt Ltd Licensed under the Apache License , Version 2.0 ( the " License " ) ; you m...
c406e90f555add0856d8dde668bbd19cb423fd73b0d4322ce4d58adfacd75006
hyperfiddle/electric
binding_flat.cljc
(ns contrib.clojurex ;(:refer-clojure :exclude [binding]) (:require [hyperfiddle.rcf :refer [tests]]) #?(:cljs (:require-macros [contrib.clojurex :refer [binding-pyramid]]))) (defn binding-pyramid* [bindings body] (let [[s expr & xs] bindings] (if (seq xs) ; don't qualify - for Photon CLJS compatibil...
null
https://raw.githubusercontent.com/hyperfiddle/electric/1c6c3891cbf13123fef8d33e6555d300f0dac134/scratch/dustin/y2022/binding_flat.cljc
clojure
(:refer-clojure :exclude [binding]) don't qualify - for Photon CLJS compatibility ?
(ns contrib.clojurex (:require [hyperfiddle.rcf :refer [tests]]) #?(:cljs (:require-macros [contrib.clojurex :refer [binding-pyramid]]))) (defn binding-pyramid* [bindings body] (let [[s expr & xs] bindings] (if (seq xs) `(~'binding [~s ~expr] ~(binding-pyramid* xs body)) `(~'binding [~s ~expr] ~@...
96f1390448bce17242001aa74ca4dbd5127ef1fa316ce3ebfde6aaabed40488f
jordillonch/eggs
example_game_world.erl
%% eggs (Erlang Generic Game Server) %% Copyright ( C ) 2012 - 2013 < llonch.jordi at gmail dot com > %% %% This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation , either version 3 of the %%...
null
https://raw.githubusercontent.com/jordillonch/eggs/e20ccd5093952ec967458bb2d50d5acf82e69063/apps/eggs_example_game/src/example_game_world.erl
erlang
eggs (Erlang Generic Game Server) This program is free software: you can redistribute it and/or modify License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A ...
Copyright ( C ) 2012 - 2013 < llonch.jordi at gmail dot com > it under the terms of the GNU Affero General Public License as published by the Free Software Foundation , either version 3 of the You should have received a copy of the GNU Affero General Public License -module(example_game_world). -behaviour(e...
c31c2d38e2220bc9adec549cc6df419044ccaf1772a99728d200dfbc006ce2b8
brendanhay/amazonka
ImprovementSummary.hs
# LANGUAGE DeriveGeneric # # LANGUAGE DuplicateRecordFields # # LANGUAGE NamedFieldPuns # {-# LANGUAGE OverloadedStrings #-} # LANGUAGE RecordWildCards # {-# LANGUAGE StrictData #-} # LANGUAGE NoImplicitPrelude # # OPTIONS_GHC -fno - warn - unused - imports # # OPTIONS_GHC -fno - warn - unused - matches # Derived fr...
null
https://raw.githubusercontent.com/brendanhay/amazonka/09f52b75d2cfdff221b439280d3279d22690d6a6/lib/services/amazonka-wellarchitected/gen/Amazonka/WellArchitected/Types/ImprovementSummary.hs
haskell
# LANGUAGE OverloadedStrings # # LANGUAGE StrictData # | Module : Amazonka.WellArchitected.Types.ImprovementSummary Stability : auto-generated | An improvement summary of a lens review in a workload. /See:/ 'newImprovementSummary' smart constructor. | The improvement plan details. | Create a value of 'I...
# LANGUAGE DeriveGeneric # # LANGUAGE DuplicateRecordFields # # LANGUAGE NamedFieldPuns # # LANGUAGE RecordWildCards # # LANGUAGE NoImplicitPrelude # # OPTIONS_GHC -fno - warn - unused - imports # # OPTIONS_GHC -fno - warn - unused - matches # Derived from AWS service descriptions , licensed under Apache 2.0 . Co...
4da39373025360e201198acfb22b92b6829ef9dea1cce9e6c7fb18af10f84a42
nikodemus/raylisp
normal.lisp
by Nikodemus Siivola < > , 2009 . ;;;; ;;;; Permission is hereby granted, free of charge, to any person ;;;; obtaining a copy of this software and associated documentation files ( the " Software " ) , to deal in the Software without restriction , ;;;; including without limitation the rights to use, copy, modify, m...
null
https://raw.githubusercontent.com/nikodemus/raylisp/f79f61c6df283baad265dfdc207d798b63ca19a9/kernel/normal.lisp
lisp
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files including without limitation the rights to use, copy, modify, merge, subject to the following conditions: EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF IN NO EVEN...
by Nikodemus Siivola < > , 2009 . ( the " Software " ) , to deal in the Software without restriction , publish , distribute , sublicense , and/or sell copies of the Software , and to permit persons to whom the Software is furnished to do so , THE SOFTWARE IS PROVIDED " AS IS " , WITHOUT WARRANTY OF ANY KIND ...
c9d91e9a04aded50be6b2f1bccc8d0cd1b6a8062db097721863b57f92ca5a7f8
xapi-project/xen-api
db_rpc_common_v1.ml
* Copyright ( C ) 2006 - 2009 Citrix Systems Inc. * * 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 ; version 2.1 only . with the special * exception on linking describe...
null
https://raw.githubusercontent.com/xapi-project/xen-api/47fae74032aa6ade0fc12e867c530eaf2a96bf75/ocaml/database/db_rpc_common_v1.ml
ocaml
Nb, we always use 'non-legacy' mode for remote access get_table_from_ref is_valid_ref read_refs read_field_where db_get_by_uuid db_get_by_name_label delete_row write_field read_field find_refs_with_filter process_structured_field read_record read_records_where
* Copyright ( C ) 2006 - 2009 Citrix Systems Inc. * * 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 ; version 2.1 only . with the special * exception on linking describe...
e2466e1cd87b4c02b30af9bd9942e21b3fd7942dbbcdcca1bf1eeba4c6562d97
facebook/duckling
Corpus.hs
Copyright ( c ) 2016 - present , Facebook , Inc. -- All rights reserved. -- -- This source code is licensed under the BSD-style license found in the -- LICENSE file in the root directory of this source tree. {-# LANGUAGE OverloadedStrings #-} module Duckling.Numeral.IS.Corpus ( corpus ) where import Data.Stri...
null
https://raw.githubusercontent.com/facebook/duckling/72f45e8e2c7385f41f2f8b1f063e7b5daa6dca94/Duckling/Numeral/IS/Corpus.hs
haskell
All rights reserved. This source code is licensed under the BSD-style license found in the LICENSE file in the root directory of this source tree. # LANGUAGE OverloadedStrings #
Copyright ( c ) 2016 - present , Facebook , Inc. module Duckling.Numeral.IS.Corpus ( corpus ) where import Data.String import Prelude import Duckling.Locale import Duckling.Numeral.Types import Duckling.Resolve import Duckling.Testing.Types context :: Context context = testContext{locale = makeLocale IS Not...
6412c0c3c1db652793abe6345bb42213ce8463fd5fff99b0a813f842f744cdd3
ghilesZ/picasso
colors.ml
type t = int * int * int let rgb r g b = (r, g, b) let red = (255, 0, 0) let green = (0, 255, 0) let blue = (0, 0, 255) let white = (255, 255, 255) let black = (0, 0, 0)
null
https://raw.githubusercontent.com/ghilesZ/picasso/520e5dbfa12ad6e7db5f1c5eb40c18812ff099f3/src/colors.ml
ocaml
type t = int * int * int let rgb r g b = (r, g, b) let red = (255, 0, 0) let green = (0, 255, 0) let blue = (0, 0, 255) let white = (255, 255, 255) let black = (0, 0, 0)
bcd3171f16cedaa2b98de3babe37409fc4faeed658082a11d865ce651fa31843
inria-parkas/sundialsml
cvsFoodWeb_ASAi_kry.ml
* ----------------------------------------------------------------- * $ Revision : 1.4 $ * $ Date : 2011/11/23 23:53:02 $ * ----------------------------------------------------------------- * Programmer(s ): @ LLNL * ----------------------------------------------------------------- * OCaml port :...
null
https://raw.githubusercontent.com/inria-parkas/sundialsml/a1848318cac2e340c32ddfd42671bef07b1390db/examples/cvodes/serial/cvsFoodWeb_ASAi_kry.ml
ocaml
Problem Specification Constants aa = a ee = e gg = g bb = b Method Constants CVodeInit Constants Output Constants Note: The value for species i at mesh point (j,k) is stored in component number (i-1) + j*NS + k*NS*MX of an N_Vector, Structure for user data species # in objective *------...
* ----------------------------------------------------------------- * $ Revision : 1.4 $ * $ Date : 2011/11/23 23:53:02 $ * ----------------------------------------------------------------- * Programmer(s ): @ LLNL * ----------------------------------------------------------------- * OCaml port :...
436c2c715dffeda5ee5e23b2f10e83f1c3532e17b0fd2282a306e4628e2c3f82
walkie/Hagl
Game.hs
# LANGUAGE FlexibleContexts , FlexibleInstances , PatternGuards , TypeFamilies , UndecidableInstances # FlexibleInstances, PatternGuards, TypeFamilies, UndecidableInstances #-} | All games in Hagl can be r...
null
https://raw.githubusercontent.com/walkie/Hagl/ac1edda51c53d2b683c4ada3f1c3d4d14a285d38/src/Hagl/Game.hs
haskell
Each node in a game tree consists of a game state and an action to perform (e.g. a player must make a decision). Edges between nodes are determined by moves. For `Discrete` game trees, the edges are given explicitly as a list. For `Continuous` game trees, the edges are defined implicitly by a function...
# LANGUAGE FlexibleContexts , FlexibleInstances , PatternGuards , TypeFamilies , UndecidableInstances # FlexibleInstances, PatternGuards, TypeFamilies, UndecidableInstances #-} | All games in Hagl can be r...
8d3b258d13128cbbd04dea2489a5565f9f25cccb373ba63ccaecb51219d36341
ushitora-anqou/alqo
room_database.erl
-module(room_database). -behaviour(gen_server). -export([ start_link/0, stop/0, create_room/1, get_current_state/1, set_current_state/2 ]). -export([init/1, handle_call/3, handle_cast/2, handle_info/2, code_change/3, terminate/2]). start_link() -> gen_server:start_link({local, ?MODULE}, ?MODULE...
null
https://raw.githubusercontent.com/ushitora-anqou/alqo/9900172d765100dec40c00a7aec3c2dc971956f1/src/room_database.erl
erlang
-module(room_database). -behaviour(gen_server). -export([ start_link/0, stop/0, create_room/1, get_current_state/1, set_current_state/2 ]). -export([init/1, handle_call/3, handle_cast/2, handle_info/2, code_change/3, terminate/2]). start_link() -> gen_server:start_link({local, ?MODULE}, ?MODULE...
ec7c595f923bf3e0d7675f82c106bfbfaf128ad34c8b6e185715f05cd5e3ee9e
input-output-hk/cardano-addresses
GenerateSpec.hs
# LANGUAGE FlexibleContexts # module Command.RecoveryPhrase.GenerateSpec ( spec ) where import Prelude import Test.Hspec ( Spec, SpecWith, it, shouldBe, shouldContain ) import Test.Utils ( cli, describeCmd ) spec :: Spec spec = describeCmd ["recovery-phrase", "generate"] $ do specDefaultSize ...
null
https://raw.githubusercontent.com/input-output-hk/cardano-addresses/41971b6bc29d6d69cd258ee78253af8da4b414f4/command-line/test/Command/RecoveryPhrase/GenerateSpec.hs
haskell
# LANGUAGE FlexibleContexts # module Command.RecoveryPhrase.GenerateSpec ( spec ) where import Prelude import Test.Hspec ( Spec, SpecWith, it, shouldBe, shouldContain ) import Test.Utils ( cli, describeCmd ) spec :: Spec spec = describeCmd ["recovery-phrase", "generate"] $ do specDefaultSize ...
5b467612974f1b048089a87aa8c9b2af673a2911f52e22caf641261d9c5e2ce8
iustin/corydalis
Image.hs
Copyright ( C ) 2013 This program is free software : you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation , either version 3 of the License , or ( at your option ) any later version . This program is distributed i...
null
https://raw.githubusercontent.com/iustin/corydalis/43f8bf004904847fad43c428a9e1b20e67da964d/src/Handler/Image.hs
haskell
# LANGUAGE TemplateHaskell #
Copyright ( C ) 2013 This program is free software : you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation , either version 3 of the License , or ( at your option ) any later version . This program is distributed i...
38dbe0651dabc73c34ac6c56d6240634dcb21885e360ad5713c5e242ac3ed5c8
cjay/vulkyrie
Memory.hs
{-# LANGUAGE StrictData #-} # LANGUAGE DuplicateRecordFields # module Vulkyrie.Vulkan.Memory ( findMemoryType , MemTypeIndex(..) , MemoryLoc(..) , allocBindImageMem , allocBindBufferMem , MemoryPool , createMemoryPool , allocMem ) where import Control.Monad import Control.Monad.Pr...
null
https://raw.githubusercontent.com/cjay/vulkyrie/83edbd0099f9bb02b2b1fe159523245861011018/src/Vulkyrie/Vulkan/Memory.hs
haskell
# LANGUAGE StrictData # | Return an index of a memory type for a device ^ type filter bitfield ^ desired memory properties | Best-fit sub-allocating memory pool. Not thread-safe. across smaller allocations. ^ requested size in bytes ^ requested alignment For real world bufferImageGranularity see . all allo...
# LANGUAGE DuplicateRecordFields # module Vulkyrie.Vulkan.Memory ( findMemoryType , MemTypeIndex(..) , MemoryLoc(..) , allocBindImageMem , allocBindBufferMem , MemoryPool , createMemoryPool , allocMem ) where import Control.Monad import Control.Monad.Primitive import Dat...
d9a95c39e4ae7be581fea77c81c737fd31752729d68b1e01d25b831c174f6b20
robert-strandh/SICL
call-instruction.lisp
(cl:in-package #:sicl-mir-to-lir) ;;; We need to store arguments into the appropriate registers and stack slots ( relative to RSP now ) , and then adjust RBP . The code generated is as per the description in section 27.3 " Calling conventions " of the SICL specification , though we have ;;; changed the order of...
null
https://raw.githubusercontent.com/robert-strandh/SICL/f4d9a0515801f15869692af9d420c9f202fed3fc/Code/Compiler/MIR-to-LIR/call-instruction.lisp
lisp
We need to store arguments into the appropriate registers and changed the order of some independent steps to make code generation easier. The callee function object and arguments have already been computed by previous instructions, so we are left to generate code for the rest of the process. TODO: put these magi...
(cl:in-package #:sicl-mir-to-lir) stack slots ( relative to RSP now ) , and then adjust RBP . The code generated is as per the description in section 27.3 " Calling conventions " of the SICL specification , though we have (defconstant +rack-prefix-size+ 2) (defconstant +rack-tag+ 7) (defconstant +standard-obje...
d272fd7eea807bca90c1f7a775842d607f5c6ae3a092aedc937e3672d275668e
davdar/maam
GHCI.hs
module FP.GHCI where
null
https://raw.githubusercontent.com/davdar/maam/2cc3ff3511a7a4daadcd44c60c4b08862c01e183/src/FP/GHCI.hs
haskell
module FP.GHCI where
be535a71e54391d3b4de98a65840646022ee19a841eaafa83232d0e1cf92da99
ds-wizard/engine-backend
MigratorService.hs
module Wizard.Service.Migration.Questionnaire.MigratorService where import Control.Monad.Reader (asks, liftIO) import qualified Data.UUID as U import Shared.Util.Uuid import Wizard.Api.Resource.Migration.Questionnaire.MigratorStateChangeDTO import Wizard.Api.Resource.Migration.Questionnaire.MigratorStateCreateDTO imp...
null
https://raw.githubusercontent.com/ds-wizard/engine-backend/d392b751192a646064305d3534c57becaa229f28/engine-wizard/src/Wizard/Service/Migration/Questionnaire/MigratorService.hs
haskell
-------------------------------- PRIVATE --------------------------------
module Wizard.Service.Migration.Questionnaire.MigratorService where import Control.Monad.Reader (asks, liftIO) import qualified Data.UUID as U import Shared.Util.Uuid import Wizard.Api.Resource.Migration.Questionnaire.MigratorStateChangeDTO import Wizard.Api.Resource.Migration.Questionnaire.MigratorStateCreateDTO imp...
39424d96653f3b817f845a5be433740bb1f78fe5f8fd70afe422ea05b55427c1
pirapira/coq2rust
mod_typing.ml
(************************************************************************) v * The Coq Proof Assistant / The Coq Development Team < O _ _ _ , , * INRIA - CNRS - LIX - LRI - PPS - Copyright 1999 - 2012 \VV/ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *...
null
https://raw.githubusercontent.com/pirapira/coq2rust/22e8aaefc723bfb324ca2001b2b8e51fcc923543/kernel/mod_typing.ml
ocaml
********************************************************************** // * This file is distributed under the terms of the * GNU Lesser General Public License Version 2.1 ********************************************************************** This module provides the main funct...
v * The Coq Proof Assistant / The Coq Development Team < O _ _ _ , , * INRIA - CNRS - LIX - LRI - PPS - Copyright 1999 - 2012 \VV/ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Created by , Aug 2002 as ...
ed90f60aed67fcca51e163f56b604ff629317fdff0ba888768235be4dd6fd770
graninas/Functional-Design-and-Architecture
HardwareTest.hs
module HardwareTest where import Andromeda.Hardware.Device import Andromeda.Hardware.Service import DeviceTest makeDeviceMock _ = blankDevice mockedHandle = newHandle makeDeviceMock blankDevice test = do putStr "With real service: " testDevice defaultHandle putStr "With mocked service: " testDev...
null
https://raw.githubusercontent.com/graninas/Functional-Design-and-Architecture/1736abc16d3e4917fc466010dcc182746af2fd0e/First-Edition/BookSamples/CH03/Services/PureStateless/HardwareTest.hs
haskell
IORef
module HardwareTest where import Andromeda.Hardware.Device import Andromeda.Hardware.Service import DeviceTest makeDeviceMock _ = blankDevice mockedHandle = newHandle makeDeviceMock blankDevice test = do putStr "With real service: " testDevice defaultHandle putStr "With mocked service: " testDev...
705db6c18dd1485e4284a2312274476129968bfedca33881205f36656b586ce8
LambdaScientist/CLaSH-by-example
Dflop_sync_enable.hs
# LANGUAGE DataKinds # # LANGUAGE RecordWildCards # # LANGUAGE TemplateHaskell # # LANGUAGE NoImplicitPrelude # module ClocksAndRegisters.Models.Dflop_sync_enable where import CLaSH.Prelude import Control.Lens hiding ((:>)) import Text.PrettyPrint.HughesPJClass import SAFE.TestingTools import SAFE.Co...
null
https://raw.githubusercontent.com/LambdaScientist/CLaSH-by-example/e783cd2f2408e67baf7f36c10398c27036a78ef3/HaskellClashExamples/src/ClocksAndRegisters/Models/Dflop_sync_enable.hs
haskell
inputs Outputs and state data
# LANGUAGE DataKinds # # LANGUAGE RecordWildCards # # LANGUAGE TemplateHaskell # # LANGUAGE NoImplicitPrelude # module ClocksAndRegisters.Models.Dflop_sync_enable where import CLaSH.Prelude import Control.Lens hiding ((:>)) import Text.PrettyPrint.HughesPJClass import SAFE.TestingTools import SAFE.Co...
34f0eb5e3417c31b6bcdf97ed9896324ce2752b2fc02cc3fffe2c2d041e24613
aggieben/weblocks
dependencies.lisp
(in-package :weblocks-test) (deftest dependencies-by-symbol-1 (remove nil (weblocks::dependencies-by-symbol 'non-existent-widget-name)) nil) (deftest dependencies-by-symbol-2 (format nil "~A" (mapcar #'dependency-url (remove nil (weblocks::dependencies-by-symbol 'navigation)))) "(/pub/stylesheets/...
null
https://raw.githubusercontent.com/aggieben/weblocks/8d86be6a4fff8dde0b94181ba60d0dca2cbd9e25/test/dependencies.lisp
lisp
(in-package :weblocks-test) (deftest dependencies-by-symbol-1 (remove nil (weblocks::dependencies-by-symbol 'non-existent-widget-name)) nil) (deftest dependencies-by-symbol-2 (format nil "~A" (mapcar #'dependency-url (remove nil (weblocks::dependencies-by-symbol 'navigation)))) "(/pub/stylesheets/...
5421c59bfbd9717db5f09d6dc5cd657c9bb8112721ce30500a8387486de2b4c7
ndmitchell/cmdargs
Process.hs
# LANGUAGE RecordWildCards # module System.Console.CmdArgs.Explicit.Process(process) where import System.Console.CmdArgs.Explicit.Type import Control.Arrow import Data.List import Data.Maybe -- | Process a list of flags (usually obtained from @getArgs@/@expandArgsAt@) with a mode. Returns -- @Left@ and an error me...
null
https://raw.githubusercontent.com/ndmitchell/cmdargs/107fd11bcc466e7c62b7b2150e05bac20675655a/System/Console/CmdArgs/Explicit/Process.hs
haskell
| Process a list of flags (usually obtained from @getArgs@/@expandArgsAt@) with a mode. Returns @Left@ and an error message if the command line fails to parse, or @Right@ and the associated value. The value you are accumulating The arguments you are processing through The number of unnamed arguments you have ...
# LANGUAGE RecordWildCards # module System.Console.CmdArgs.Explicit.Process(process) where import System.Console.CmdArgs.Explicit.Type import Control.Arrow import Data.List import Data.Maybe process :: Mode a -> [String] -> Either String a process = processMode processMode :: Mode a -> [String] -> Either String a ...
85de58ba87c1287878a14a4e182ef4ce5eda6a6fcdcd8624a492f72b93393c2d
realworldocaml/book
interpreter.ml
open Base open Ppxlib open Ast_builder.Default module Filename = Stdlib.Filename module Parsing = Stdlib.Parsing module Type = struct type t = | Var of string | Bool | Int | Char | String | Tuple of t list let rec to_string = function | Var v -> "'" ^ v | Bool -> "bool" ...
null
https://raw.githubusercontent.com/realworldocaml/book/d822fd065f19dbb6324bf83e0143bc73fd77dbf9/duniverse/ppx_optcomp/src/interpreter.ml
ocaml
* Location at which it was defined/undefined +-----------------------------------------------------------------+ | Expression evaluation | +-----------------------------------------------------------------+ Let-binding Pattern matching +---------------------------...
open Base open Ppxlib open Ast_builder.Default module Filename = Stdlib.Filename module Parsing = Stdlib.Parsing module Type = struct type t = | Var of string | Bool | Int | Char | String | Tuple of t list let rec to_string = function | Var v -> "'" ^ v | Bool -> "bool" ...
fa377c9120ece2c5500eee6455b2dd8fbb8b6e71554f50173731f835e2990037
alidloren/interdep
multi_repo.clj
(ns interdep.multi-repo "Unify multiple subrepo deps into one config." (:require [clojure.java.io :as io] [clojure.edn :as edn] [interdep.impl.cli :as cli] [interdep.impl.path :as path])) ;; [Note on dep path handling]: ;; Constraints: * Interdep will throw error when processsing any : local / root ...
null
https://raw.githubusercontent.com/alidloren/interdep/ad9bfabb1c72e61854340be791b74e23482a1425/interdep-core/src/interdep/multi_repo.clj
clojure
[Note on dep path handling]: Constraints: * All registered local deps must be inside root repo. Reasoning: to see how many dirs back a subrepo dep path should be changed to. --- Validations
(ns interdep.multi-repo "Unify multiple subrepo deps into one config." (:require [clojure.java.io :as io] [clojure.edn :as edn] [interdep.impl.cli :as cli] [interdep.impl.path :as path])) * Interdep will throw error when processsing any : local / root deps that are not registered . We can change...
20dfee9cb26cb6f286d9eab740fad2508240ac3a308abd299bef29be3ddd1f9f
vivid-inc/ash-ra-template
args.clj
; Copyright 2020 Vivid Inc. ; Licensed under the Apache License , Version 2.0 ( the " License " ) ; ; you may not use this file except in compliance with the License. ; You may obtain a copy of the License at ; ; -2.0 ; ; Unless required by applicable law or agreed to in writing, software distributed under the L...
null
https://raw.githubusercontent.com/vivid-inc/ash-ra-template/f64be7efd6f52ccd451cddb851f02511d1665b11/art-cli/src/vivid/art/cli/args.clj
clojure
Copyright 2020 Vivid Inc. you may not use this file except in compliance with the License. You may obtain a copy of the License at -2.0 Unless required by applicable law or agreed to in writing, software WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the speci...
distributed under the License is distributed on an " AS IS " BASIS , (ns vivid.art.cli.args (:require [clojure.java.io :as io] [clojure.spec.alpha :as s] [clojure.string] [clojure.tools.cli] [farolero.core :as farolero] [vivid.art.cli.files :as files] [vivid.art.cli.specs] [vivid.ar...
62a1548f141033de190fcf998f913ed9e4983e002c7f485389f9e49a9f1a90e9
DSiSc/why3
expr.mli
(********************************************************************) (* *) The Why3 Verification Platform / The Why3 Development Team Copyright 2010 - 2018 -- Inria - CNRS - Paris - Sud University (* ...
null
https://raw.githubusercontent.com/DSiSc/why3/8ba9c2287224b53075adc51544bc377bc8ea5c75/src/mlw/expr.mli
ocaml
****************************************************************** This software is distributed under the terms of the GNU Lesser on linking described in file LICENSE. ...
The Why3 Verification Platform / The Why3 Development Team Copyright 2010 - 2018 -- Inria - CNRS - Paris - Sud University General Public License version 2.1 , with the special exception open Wstdlib open Ident open Term open Ity * { 2 Routine symbols } type rsymbol = private { rs_name :...
f0d392373d36c068e866fe0b899304879be83f9303a7cb696fded80962e23bf2
DomainDrivenArchitecture/dda-serverspec-crate
http_test.clj
Licensed to the Apache Software Foundation ( ASF ) under one ; or more contributor license agreements. See the NOTICE file ; distributed with this work for additional information ; regarding copyright ownership. The ASF licenses this file to you under the Apache License , Version 2.0 ( the ; "License"); you may not...
null
https://raw.githubusercontent.com/DomainDrivenArchitecture/dda-serverspec-crate/0a2fd8cdd54a9efc3aad9e141098c2bf01d40861/test/src/dda/pallet/dda_serverspec_crate/infra/fact/http_test.clj
clojure
or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file "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 b...
Licensed to the Apache Software Foundation ( ASF ) under one to you under the Apache License , Version 2.0 ( the distributed under the License is distributed on an " AS IS " BASIS , (ns dda.pallet.dda-serverspec-crate.infra.fact.http-test (:require [clojure.test :refer :all] [data-test :refer :all] [cl...
656a43ebd7c4bec5e222f0f5874919ffaffdd69c8a352af24e49cf5920d7c033
mirage/wodan
test.mli
* Copyright ( c ) 2013 - 2017 < > * * Permission to use , copy , modify , and distribute this software for any * purpose with or without fee is hereby granted , provided that the above * copyright notice and this permission notice appear in all copies . * * THE SOFTWARE IS PROVIDED " AS IS " AND...
null
https://raw.githubusercontent.com/mirage/wodan/fa37883ed73a1e9d7a05781453caf926134edcf3/tests/wodan-irmin/test.mli
ocaml
left empty on purpose
* Copyright ( c ) 2013 - 2017 < > * * Permission to use , copy , modify , and distribute this software for any * purpose with or without fee is hereby granted , provided that the above * copyright notice and this permission notice appear in all copies . * * THE SOFTWARE IS PROVIDED " AS IS " AND...
87115e7fccb6f18a72e4cc9979a765fd8c553af9d6107c205def78f2e5ba5e0c
stumpwm/stumpwm-contrib
swm-gaps.lisp
;;;; swm-gaps.lisp (in-package #:swm-gaps) (export '(*inner-gaps-size* *outer-gaps-size* *head-gaps-size* *gaps-on* toggle-gaps toggle-gaps-on toggle-gaps-off)) (defvar *inner-gaps-size* 5) (defvar *outer-gaps-size* 10) (defvar *head-gaps-size* 0) (defvar *gaps-on* nil) (defun apply-gaps-p (win) "Tell if gaps sho...
null
https://raw.githubusercontent.com/stumpwm/stumpwm-contrib/a7dc1c663d04e6c73a4772c8a6ad56a34381096a/util/swm-gaps/swm-gaps.lisp
lisp
swm-gaps.lisp Only do width or height subtraction if result will be positive, if needed (i.e. window at least fills frame minus gap). This is the only place a window's geometry should change FIXME: updating the border doesn't need to be run everytime the window is maximized, but only when the border style or win...
(in-package #:swm-gaps) (export '(*inner-gaps-size* *outer-gaps-size* *head-gaps-size* *gaps-on* toggle-gaps toggle-gaps-on toggle-gaps-off)) (defvar *inner-gaps-size* 5) (defvar *outer-gaps-size* 10) (defvar *head-gaps-size* 0) (defvar *gaps-on* nil) (defun apply-gaps-p (win) "Tell if gaps should be applied to t...
ea3b7eb947b6e853770510a0b929f18e9157d86dda1b2853bedfdc7ccaf40c68
biocaml/phylogenetics
alignment.ml
open Core type t = { descriptions : string array ; sequences : string array ; } let sequence t i = t.sequences.(i) let description t i = t.descriptions.(i) let nrows a = Array.length a.sequences let ncols a = String.length a.sequences.(0) type error = [ | `Empty_alignment | `Unequal_sequence_lengths ] [@@...
null
https://raw.githubusercontent.com/biocaml/phylogenetics/3697dcf2f94485fea680718bdec7d59edf962ad3/lib/alignment.ml
ocaml
this is the length of the sequences, not the nb of sequences! returns only if all lengths were equal
open Core type t = { descriptions : string array ; sequences : string array ; } let sequence t i = t.sequences.(i) let description t i = t.descriptions.(i) let nrows a = Array.length a.sequences let ncols a = String.length a.sequences.(0) type error = [ | `Empty_alignment | `Unequal_sequence_lengths ] [@@...
04a2a5f5b110a37dc31ed5ef15c62c575de92dc91925af58e26afe5c8327e848
renatoalencar/milho-ocaml
milho_core.ml
exception Invalid_argument of string let sum args = let sum a b = match a, b with | Value.Number (an, ad), Value.Number (bn, bd) -> Value.Number ((an * bd) + (bn *ad), ad * bd) | _ -> Value.Nil in List.fold_left sum (Number (0, 1)) args let sub args = let negative x = match x with ...
null
https://raw.githubusercontent.com/renatoalencar/milho-ocaml/9e0f75e3d531f927851604631dca453ee814949b/milho_core.ml
ocaml
exception Invalid_argument of string let sum args = let sum a b = match a, b with | Value.Number (an, ad), Value.Number (bn, bd) -> Value.Number ((an * bd) + (bn *ad), ad * bd) | _ -> Value.Nil in List.fold_left sum (Number (0, 1)) args let sub args = let negative x = match x with ...
ec39ec3b75327b064c43c5dea88c0b2b83691c8faa8bd034d6e62d66509f52e2
mbutterick/typesetting
test0.rkt
#lang racket/base (require pitfall/pdftest) (define-runtime-path pdf "test0rkt.pdf") (make-doc pdf #f) (define-runtime-path pdfc "test0crkt.pdf") (make-doc pdfc #t)
null
https://raw.githubusercontent.com/mbutterick/typesetting/6f7a8bbc422a64d3a54cbbbd78801a01410f5c92/pitfall/ptest/test0.rkt
racket
#lang racket/base (require pitfall/pdftest) (define-runtime-path pdf "test0rkt.pdf") (make-doc pdf #f) (define-runtime-path pdfc "test0crkt.pdf") (make-doc pdfc #t)
017c7eb0621ea55ea54049b7f1ef1381dbfa7f71403902b639e10db40c878059
charlieg/Sparser
initialize1.lisp
;;; -*- Mode:LISP; Syntax:Common-Lisp; Package:(SPARSER LISP) -*- copyright ( c ) 1997 - 2005 -- all rights reserved extensions copyright ( c ) 2009 BBNT Solutions LLC . All Rights Reserved $ Id:$ ;;; ;;; File: "initialize" ;;; Module: "objects;model:lattice-points:" version : 1.0 August 2009 ...
null
https://raw.githubusercontent.com/charlieg/Sparser/b9bb7d01d2e40f783f3214fc104062db3d15e608/Sparser/code/s/objects/model/lattice-points/initialize1.lisp
lisp
-*- Mode:LISP; Syntax:Common-Lisp; Package:(SPARSER LISP) -*- File: "initialize" Module: "objects;model:lattice-points:" upward pointer of the new node so that you can successfully climb through it. 3/20/00 Added to Index-node-to-top-point so that it would properly set the down pointers of the top-lp, th...
copyright ( c ) 1997 - 2005 -- all rights reserved extensions copyright ( c ) 2009 BBNT Solutions LLC . All Rights Reserved $ Id:$ version : 1.0 August 2009 initiated 11/29/97 . Moved code in from other files 7/7/98 . 9/3/99 renamed Construct - self - lattice - point to avoid brain - dead conflict ...
44783702394a0b080dc554b319a8b5cacdf64125a5925cea2a6751bcfa2785b0
basho/riak_shell
debug_EXT.erl
%% ------------------------------------------------------------------- %% %% debug extension for riak_shell %% Copyright ( c ) 2007 - 2016 Basho Technologies , Inc. All Rights Reserved . %% This file is provided to you under the Apache License , %% Version 2.0 (the "License"); you may not use this file except i...
null
https://raw.githubusercontent.com/basho/riak_shell/afc4b7c04925f8accaa5b32ee0253d8c0ddc5000/src/debug_EXT.erl
erlang
------------------------------------------------------------------- debug extension for riak_shell Version 2.0 (the "License"); you may not use this file a copy of the License at -2.0 Unless required by applicable law or agreed to in writing, KIND, either express or implied. See the License for the spec...
Copyright ( c ) 2007 - 2016 Basho Technologies , Inc. All Rights Reserved . This file is provided to you under the Apache License , except in compliance with the License . You may obtain software distributed under the License is distributed on an " AS IS " BASIS , WITHOUT WARRANTIES OR CONDITIONS OF ANY -...
45c5e46a2f0edc139a2efcbb9e3b0348184b4beeabda4da6477a4bf6737fafab
SKA-ScienceDataProcessor/RC
Activity.hs
module Profiling.CUDA.Activity ( cuptiEnable, cuptiDisable, cuptiFlush , CUptiMemLoc(..) , cuptiGetMemsetTime, cuptiGetMemcpyTime , cuptiGetKernelTime, cuptiGetOverheadTime , cuptiGetMemsetBytes, cuptiGetMemcpyBytes , cuptiGetMemcpyTimeTo, cuptiGetMemcpyBytesTo ) where import Control.Mona...
null
https://raw.githubusercontent.com/SKA-ScienceDataProcessor/RC/1b5e25baf9204a9f7ef40ed8ee94a86cc6c674af/MS6/dna/cupti/Profiling/CUDA/Activity.hs
haskell
foreign import ccall unsafe "cupti_getDroppedRecords" | Enables CUDA activity monitoring, starting the counters. | Disables CUDA activity monitoring | Flushes CUDA performance counters | Queries times. The return values are the sum of times spend on certain actions. Note that with parallel execution, this might a...
module Profiling.CUDA.Activity ( cuptiEnable, cuptiDisable, cuptiFlush , CUptiMemLoc(..) , cuptiGetMemsetTime, cuptiGetMemcpyTime , cuptiGetKernelTime, cuptiGetOverheadTime , cuptiGetMemsetBytes, cuptiGetMemcpyBytes , cuptiGetMemcpyTimeTo, cuptiGetMemcpyBytesTo ) where import Control.Mona...
18dc497997bab9f73118186b59f9a66bcdc07984618c2a858e6245e9b5d23320
shriphani/pegasus
project.clj
(defproject pegasus "0.7.1" :description "A scaleable production-ready crawler in clojure" :url "" :license {:name "Eclipse Public License" :url "-v10.html"} :dependencies [[clj-http "3.9.1"] [clj-named-leveldb "0.1.0"] [clj-robots "0.6.0"] [clj-tim...
null
https://raw.githubusercontent.com/shriphani/pegasus/0ffbce77e596ae0af8d5ae9ffb85a8f1fa66914b/project.clj
clojure
(defproject pegasus "0.7.1" :description "A scaleable production-ready crawler in clojure" :url "" :license {:name "Eclipse Public License" :url "-v10.html"} :dependencies [[clj-http "3.9.1"] [clj-named-leveldb "0.1.0"] [clj-robots "0.6.0"] [clj-tim...
f1aafa42355d80cc005c5030799ba1510c9b8c19bd70ff126fcc69e46ab6facf
nuprl/gradual-typing-performance
footnote.rkt
#lang scheme/base (require scribble/core scribble/decode scribble/html-properties scribble/latex-properties racket/promise setup/main-collects "private/counter.rkt") (provide note define-footnote) (define footnote-style-extras (let ([abs (lambda (s) ...
null
https://raw.githubusercontent.com/nuprl/gradual-typing-performance/35442b3221299a9cadba6810573007736b0d65d4/pre-benchmark/ecoop/scribble-lib/scriblib/footnote.rkt
racket
#lang scheme/base (require scribble/core scribble/decode scribble/html-properties scribble/latex-properties racket/promise setup/main-collects "private/counter.rkt") (provide note define-footnote) (define footnote-style-extras (let ([abs (lambda (s) ...
4a968d22471edd314835a8cc2ab695cf3d60e527e2b4e944c1625ba2f3adfcbc
clojurecup2014/parade-route
def.clj
Copyright ( c ) . All rights reserved . ; The use and distribution terms for this software are covered by the ; Eclipse Public License 1.0 (-1.0.php) ; which can be found in the file 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/clojurecup2014/parade-route/adb2e1ea202228e3da07902849dee08f0bb8d81c/Assets/Clojure/Internal/Plugins/clojure/test_clojure/def.clj
clojure
The use and distribution terms for this software are covered by the Eclipse Public License 1.0 (-1.0.php) which can be found in the file epl-v10.html at the root of this distribution. By using this software in any fashion, you are agreeing to be bound by the terms of this license. You must not remove ...
Copyright ( c ) . All rights reserved . (ns clojure.test-clojure.def (:use clojure.test clojure.test-helper clojure.test-clojure.protocols)) (deftest defn-error-messages (testing "multiarity syntax invalid parameter declaration" (is (fails-with-cause? IllegalArgumentException #"Para...
7b3550d9eb4a43cebcb6b0a45c7f28ca0899c674cad9d046883747683425834a
andersfugmann/aws-s3
s3.ml
(** Async aware S3 commands. For API documentation @see <../../../aws-s3/Aws_s3/S3/Make/index.html>({!module:Aws_s3.S3.Make}) *) include Aws_s3.S3.Make(Io)
null
https://raw.githubusercontent.com/andersfugmann/aws-s3/84af629119e313ba46cf3eab9dd7b914e6bae5e9/aws-s3-async/s3.ml
ocaml
* Async aware S3 commands. For API documentation @see <../../../aws-s3/Aws_s3/S3/Make/index.html>({!module:Aws_s3.S3.Make})
include Aws_s3.S3.Make(Io)
a1fd84d2d156ce633f3252962ce53ec3ab321f48e053e17927106a246a6293a9
mwand/5010-examples
07-1-number-list-with-stress-tests.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 07-1-number-list-with-stress-tests) (read-case-sensitive #t) (teachpacks ()) (htdp-setting...
null
https://raw.githubusercontent.com/mwand/5010-examples/ac24491ec2e533d048e11087ccc30ff1c087c218/07-1-number-list-with-stress-tests.rkt
racket
about the language level of this file in a form that our tools can easily process. comment out all versions of number-list except the one you want, then say (run-stress-tests 0) DATA DEFINITIONS The contract and purpose statement: number-list : ListOfX -> NumberedListOfX RETURNS: a list like the original, but ...
The first three lines of this file were inserted by . They record metadata #reader(lib "htdp-intermediate-lambda-reader.ss" "lang")((modname 07-1-number-list-with-stress-tests) (read-case-sensitive #t) (teachpacks ()) (htdp-settings #(#t constructor repeating-decimal #f #t none #f ()))) (require rackunit) (require ...
0ae0f6cbf81e8b356662d6f60f14eacc78a6bc73146fba619f5f2738cdef2109
CoNarrative/precept
listeners_test.cljc
(ns precept.listeners-test (:require [clojure.test :refer [use-fixtures is deftest testing run-tests]] [clara.rules.accumulators :as acc] [clara.rules :refer [query fire-rules] :as cr] [precept.listeners :as l] [precept.state :as state] [precept.query :as q]...
null
https://raw.githubusercontent.com/CoNarrative/precept/6078286cae641b924a2bffca4ecba19dcc304dde/test/cljc/precept/listeners_test.cljc
clojure
affected by
(ns precept.listeners-test (:require [clojure.test :refer [use-fixtures is deftest testing run-tests]] [clara.rules.accumulators :as acc] [clara.rules :refer [query fire-rules] :as cr] [precept.listeners :as l] [precept.state :as state] [precept.query :as q]...
bd042684a870717d7ffda8b1cf164cdcaf8082c9cd3cea16539a0bae90d289f0
cse-bristol/110-thermos-ui
core.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-backend.routes.core)
null
https://raw.githubusercontent.com/cse-bristol/110-thermos-ui/e13b96329f3c95e5a10bae431e8ae9bccdb475f4/src/thermos_backend/routes/core.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-backend.routes.core)
ea563c240bece73e8c1e4b60e8deb0dbb884a6f252631e90b7436ce0f74e1219
links-lang/links
lens_errors.ml
open Lens open Lens.Utility let unpack r ~die ~fmt = match r with | Result.Ok t -> t | Result.Error e -> Format.asprintf "%a" fmt e |> die let format_lens_sort_error f e = let open Sort.Lens_sort_error in match e with | UnboundColumns c -> Format.fprintf f "The columns { %a } are not bound." Alias.S...
null
https://raw.githubusercontent.com/links-lang/links/2923893c80677b67cacc6747a25b5bcd65c4c2b6/core/lens_errors.ml
ocaml
open Lens open Lens.Utility let unpack r ~die ~fmt = match r with | Result.Ok t -> t | Result.Error e -> Format.asprintf "%a" fmt e |> die let format_lens_sort_error f e = let open Sort.Lens_sort_error in match e with | UnboundColumns c -> Format.fprintf f "The columns { %a } are not bound." Alias.S...
cb811ff586239ff939cd9cd6b1364d712adf39ca7888a063f6b8d9f135e58b36
csg-tokyo/typelevelLR
Spec.hs
import Test.Hspec import Syntax import SyntaxParser import qualified SampleSyntaxes import qualified UtilitySpec import qualified IntegratedTest import Control.Monad (forM_) import Data.Either (isRight) ------------------------------------------------------------------------------- main :: IO () main = hspec ...
null
https://raw.githubusercontent.com/csg-tokyo/typelevelLR/ca5853890fac7fb819a026f0fd15d8b43f7c8470/test/Spec.hs
haskell
----------------------------------------------------------------------------- -----------------------------------------------------------------------------
import Test.Hspec import Syntax import SyntaxParser import qualified SampleSyntaxes import qualified UtilitySpec import qualified IntegratedTest import Control.Monad (forM_) import Data.Either (isRight) main :: IO () main = hspec $ do describe "sample syntaxes" $ do it "should parse sample syntaxes" $ d...
a8f1daf19b24e81cdc047d70439a13aceb83f514fd3cfc303be2283d6b802fbe
Clozure/ccl
display.lisp
;;; ;;; Copyright 2013 Clozure Associates ;;; 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, softw...
null
https://raw.githubusercontent.com/Clozure/ccl/6c1a9458f7a5437b73ec227e989aa5b825f32fd3/cocoa-ide/hemlock/src/display.lisp
lisp
Copyright 2013 Clozure Associates you may not use this file except in compliance with the License. You may obtain a copy of the License at -2.0 Unless required by applicable law or agreed to in writing, software WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for...
distributed under the License is distributed on an " AS IS " BASIS , (in-package :hemlock) (defmacro with-display-context ((view &optional pane) &body body) (let ((viewvar (gensym "VIEW"))) `(let* ((,viewvar ,view) (hi::*current-view* ,viewvar) (hi::*current-buffer* (ecase ,pane ...
0474a6544a6e388836b482cbb6dda649a81dd610a12a8298bb9d2e391486380f
TGOlson/blockchain
BlockchainConfig.hs
module Data.Blockchain.Types.BlockchainConfig ( BlockchainConfig(..) , defaultConfig , targetReward , targetDifficulty ) where import Control.Monad (when) import qualified Data.Aeson as Aeson import qualified Data.Time.Clock as Tim...
null
https://raw.githubusercontent.com/TGOlson/blockchain/da53ad888589b5a2f3fd2c53c33a399fefb48ab1/lib/Data/Blockchain/Types/BlockchainConfig.hs
haskell
Maximum hash - difficulties will be calculated using this value Defines num blocks when reward is halved -- `0` means reward never changes | A reasonable default config to use for testing. Mines blocks quickly and changes difficulty and rewards frequently. @ } @ | Calculates the target reward for a blockc...
module Data.Blockchain.Types.BlockchainConfig ( BlockchainConfig(..) , defaultConfig , targetReward , targetDifficulty ) where import Control.Monad (when) import qualified Data.Aeson as Aeson import qualified Data.Time.Clock as Tim...
bbe5ac123860a3b4c5957f99aea74debb1b3a5938b2bf62bbef4157ceaa277a4
nuprl/gradual-typing-performance
eval.rkt
#lang racket/base (require "manual.rkt" "struct.rkt" "scheme.rkt" "decode.rkt" (only-in "core.rkt" content?) racket/list file/convertible ;; attached into new namespace via anchor racket/serialize ;; attached into new namespace via anchor racket/pretty ;; attached into new ...
null
https://raw.githubusercontent.com/nuprl/gradual-typing-performance/35442b3221299a9cadba6810573007736b0d65d4/pre-benchmark/ecoop/scribble-lib/scribble/eval.rkt
racket
attached into new namespace via anchor attached into new namespace via anchor attached into new namespace via anchor attached into new namespace via anchor Error result case: Output written to a port Normal result case: extracts from a datum or syntax object --- while keeping the syntax-objectness of the origi...
#lang racket/base (require "manual.rkt" "struct.rkt" "scheme.rkt" "decode.rkt" (only-in "core.rkt" content?) racket/list racket/sandbox racket/promise racket/port racket/gui/dynamic (for-syntax racket/base syntax/srcloc unstable/struct) racket/stxparam rac...
e997411d2ffa2e53bc1f89ce0040c96406645f6b98fb650ee82ef7e3fb668448
emotiq/emotiq
test-vecrepr.lisp
(in-package :core-crypto-test) (define-test conversions (let* ((n (field-random *ed-r*)) (n1 (bev n)) (n2 (lev n)) (n3 (hex n)) (n4 (base58 n)) (n5 (base64 n))) (assert-true (and (int= n n1) (int= n n2) (int= n n3) ...
null
https://raw.githubusercontent.com/emotiq/emotiq/9af78023f670777895a3dac29a2bbe98e19b6249/src/Crypto/test/test-vecrepr.lisp
lisp
(lisp-unit:run-tests :all :crypto/test)
(in-package :core-crypto-test) (define-test conversions (let* ((n (field-random *ed-r*)) (n1 (bev n)) (n2 (lev n)) (n3 (hex n)) (n4 (base58 n)) (n5 (base64 n))) (assert-true (and (int= n n1) (int= n n2) (int= n n3) ...
8257028d1ff653b3ef2eccbeacda3a9955f842f86eebdc948aba9492dc26dde1
Ericson2314/lighthouse
runghc.hs
# OPTIONS -cpp -fffi # #if __GLASGOW_HASKELL__ < 603 #include "config.h" #else #include "ghcconfig.h" #endif ----------------------------------------------------------------------------- -- ( c ) The University of Glasgow , 2004 -- -- runghc program, for invoking from a #! line in a script. For example: -- scrip...
null
https://raw.githubusercontent.com/Ericson2314/lighthouse/210078b846ebd6c43b89b5f0f735362a01a9af02/ghc-6.8.2/utils/runghc/runghc.hs
haskell
--------------------------------------------------------------------------- runghc program, for invoking from a #! line in a script. For example: #! /usr/bin/runghc > main = putStrLn "hello!" -f <path> specify the path -----------------------------------------------------------------------...
# OPTIONS -cpp -fffi # #if __GLASGOW_HASKELL__ < 603 #include "config.h" #else #include "ghcconfig.h" #endif ( c ) The University of Glasgow , 2004 script.lhs : runghc accepts one flag : module Main (main) where import System.Environment import System.IO import Data.List import System.Exit import Data.Char #...
26f14c1c47c5fa068e5b6c1b75012e2f2c60e910f5972dfa5ab44768d284975d
juliannagele/ebso
uninterpreted_instruction.mli
Copyright 2020 and under the Apache License , Version 2.0 ( the " License " ) ; you may not use this file except in compliance with the License . You may obtain a copy of the License at -2.0 Unless required by applicable law or agreed to in writing , software distributed under ...
null
https://raw.githubusercontent.com/juliannagele/ebso/8e516036fcb98074b6be14fc81ae020f76977712/lib/uninterpreted_instruction.mli
ocaml
Copyright 2020 and under the Apache License , Version 2.0 ( the " License " ) ; you may not use this file except in compliance with the License . You may obtain a copy of the License at -2.0 Unless required by applicable law or agreed to in writing , software distributed under ...
00fda069095d01159b9c240676325af45906fc0af9d87d77714565c1da808651
ghcjs/ghcjs-base
ArrayBuffer.hs
module JavaScript.TypedArray.ArrayBuffer ( ArrayBuffer , MutableArrayBuffer , freeze, unsafeFreeze , thaw, unsafeThaw , byteLength ) where import JavaScript.TypedArray.ArrayBuffer.Internal import GHC.Exts import GHC.Types create :: Int -> IO MutableArrayBuffer create n = fmap SomeArrayBuffer ...
null
https://raw.githubusercontent.com/ghcjs/ghcjs-base/18f31dec5d9eae1ef35ff8bbf163394942efd227/JavaScript/TypedArray/ArrayBuffer.hs
haskell
| Create an immutable 'ArrayBuffer' by copying a 'MutableArrayBuffer' | Create an immutable 'ArrayBuffer' from a 'MutableArrayBuffer' without copying. The result shares the buffer with the argument, not modify the data in the 'MutableArrayBuffer' after freezing | Create a 'MutableArrayBuffer' by copyin...
module JavaScript.TypedArray.ArrayBuffer ( ArrayBuffer , MutableArrayBuffer , freeze, unsafeFreeze , thaw, unsafeThaw , byteLength ) where import JavaScript.TypedArray.ArrayBuffer.Internal import GHC.Exts import GHC.Types create :: Int -> IO MutableArrayBuffer create n = fmap SomeArrayBuffer ...
dbbe82378c79ecda3d9e77c7673f7b73eccecd70e643a8d7bac78ff37eb92390
finnishtransportagency/harja
laskutusyhteenveto.cljs
(ns harja.views.urakka.laskutusyhteenveto "Urakan Laskutusyhteenveto-välilehti" (:require [reagent.core :refer [atom] :as r] [cljs.core.async :refer [<! >! chan]] [harja.ui.yleiset :refer [ajax-loader linkki livi-pudotusvalikko]] [harja.ui.komponentti :as komp] [harj...
null
https://raw.githubusercontent.com/finnishtransportagency/harja/81a676bf90e43128ebb836f1f5424b47f27a0b76/src/cljs/harja/views/urakka/laskutusyhteenveto.cljs
clojure
(ns harja.views.urakka.laskutusyhteenveto "Urakan Laskutusyhteenveto-välilehti" (:require [reagent.core :refer [atom] :as r] [cljs.core.async :refer [<! >! chan]] [harja.ui.yleiset :refer [ajax-loader linkki livi-pudotusvalikko]] [harja.ui.komponentti :as komp] [harj...
210ea198ffe1bd84b1e5f4c51afb6e46fb85bf3f4ea107715df46db3547bb8a1
c4-project/c4f
lvalue.ml
This file is part of c4f . Copyright ( c ) 2018 - 2022 C4 Project c4 t itself is licensed under the MIT License . See the LICENSE file in the project root for more information . Parts of c4 t are based on code from the Herdtools7 project ( ) : see the LICENSE.herd file in the project...
null
https://raw.githubusercontent.com/c4-project/c4f/8939477732861789abc807c8c1532a302b2848a5/lib/fir_gen/src/lvalue.ml
ocaml
to override as needed
This file is part of c4f . Copyright ( c ) 2018 - 2022 C4 Project c4 t itself is licensed under the MIT License . See the LICENSE file in the project root for more information . Parts of c4 t are based on code from the Herdtools7 project ( ) : see the LICENSE.herd file in the project...
efc067103f92bc0180dd0573c6ed522486f21a8c31000fd489ec915c77b8a048
cj1128/sicp-review
2.51.scm
; writing a procedure that is analogous to the beside (define (below painter1 painter2) (let ((split-point (make-vect 0.0 0.5))) (let ((painter-top (transform-painter painter2 split-point (make-vect 1.0 0.5) (make-vect 0.0 1.0))) (paint...
null
https://raw.githubusercontent.com/cj1128/sicp-review/efaa2f863b7f03c51641c22d701bac97e398a050/chapter-2/2.2/2.51.scm
scheme
writing a procedure that is analogous to the beside using beside and rotate to implement below
(define (below painter1 painter2) (let ((split-point (make-vect 0.0 0.5))) (let ((painter-top (transform-painter painter2 split-point (make-vect 1.0 0.5) (make-vect 0.0 1.0))) (painter-bottom painter1 (make-vect ...
3001c1631a6290c6d7c60be0fde1a25a5e88e4c3407b6c5270f92682ff96e0fe
TerrorJack/ghc-alter
Show.hs
# LANGUAGE Trustworthy # # LANGUAGE CPP , NoImplicitPrelude , BangPatterns , StandaloneDeriving , MagicHash , UnboxedTuples # MagicHash, UnboxedTuples #-} {-# OPTIONS_HADDOCK hide #-} #include "MachDeps.h" #if SIZEOF_HSWORD == 4 #define DIGITS 9 #define BASE 1000000000 #elif S...
null
https://raw.githubusercontent.com/TerrorJack/ghc-alter/db736f34095eef416b7e077f9b26fc03aa78c311/ghc-alter/boot-lib/base/GHC/Show.hs
haskell
# OPTIONS_HADDOCK hide # DIGITS should be the largest integer such that --------------------------------------------------------------------------- | Module : GHC.Show License : see libraries/base/LICENSE Maintainer : Stability : internal The 'Show' class, and related operations. ------------...
# LANGUAGE Trustworthy # # LANGUAGE CPP , NoImplicitPrelude , BangPatterns , StandaloneDeriving , MagicHash , UnboxedTuples # MagicHash, UnboxedTuples #-} #include "MachDeps.h" #if SIZEOF_HSWORD == 4 #define DIGITS 9 #define BASE 1000000000 #elif SIZEOF_HSWORD == 8 #define DIG...
7a259e3ea5ac0b0fb77c0b11795d12492468ade2e51729a50eae0e976cc323d5
HaskellEmbedded/data-stm32
UART.hs
# LANGUAGE DataKinds # # LANGUAGE TypeFamilies # # LANGUAGE FlexibleContexts # {-# LANGUAGE Rank2Types #-} # LANGUAGE ExistentialQuantification # # LANGUAGE TypeOperators # module {{ modns }} ( UART(..) , UARTPins(..) , UARTVersion(..) , mkUARTVersion module Ivory . BSP.STM32.Peripheral . UART1.Peripher...
null
https://raw.githubusercontent.com/HaskellEmbedded/data-stm32/204aff53eaae422d30516039719a6ec7522a6ab7/templates/STM32/Peripheral/UART.hs
haskell
# LANGUAGE Rank2Types #
# LANGUAGE DataKinds # # LANGUAGE TypeFamilies # # LANGUAGE FlexibleContexts # # LANGUAGE ExistentialQuantification # # LANGUAGE TypeOperators # module {{ modns }} ( UART(..) , UARTPins(..) , UARTVersion(..) , mkUARTVersion module Ivory . BSP.STM32.Peripheral . UART1.Peripheral ) where import Ivory.L...
616b0123b6277ce4d887dece0b7b8ebc2af255a65aad0aa3eea566b40b5984c3
bobzhang/fan
ref.mli
(** @params r v body treat [r]'s state as [v] in [body], the value will be restored when exit *) val protect : 'a ref -> 'a -> (unit -> 'b) -> 'b (** see [protect]*) val protect2 : 'a ref * 'a -> 'b ref * 'b -> (unit -> 'c) -> 'c val protects : 'a ref list -> 'a list -> (unit -> 'b) -> 'b (** A weak form of...
null
https://raw.githubusercontent.com/bobzhang/fan/7ed527d96c5a006da43d3813f32ad8a5baa31b7f/src/utils/ref.mli
ocaml
* @params r v body treat [r]'s state as [v] in [body], the value will be restored when exit * see [protect] * A weak form of [protect]. Restore the value when exit
val protect : 'a ref -> 'a -> (unit -> 'b) -> 'b val protect2 : 'a ref * 'a -> 'b ref * 'b -> (unit -> 'c) -> 'c val protects : 'a ref list -> 'a list -> (unit -> 'b) -> 'b val save : 'a ref -> (unit -> 'b) -> 'b val save2 : 'a ref -> 'b ref -> (unit -> 'c) -> 'c val saves : 'a ref list -> (unit -> 'b) ->...
22e40db3cd0486cb3f95e70920844678bee1c7459b680f8dac3045c72273f7ba
BinaryAnalysisPlatform/bap
bap_c_term_attributes.mli
* BIR attributes . open Bap.Std open Bap_c_type (** Abstraction of a data representation of C value. This attribute is attached to each inserted arg term, but can be further propagated by other passes *) val data : Bap_c_data.t tag (** Function prototype. This attribute is inserted into each annotated...
null
https://raw.githubusercontent.com/BinaryAnalysisPlatform/bap/5a71fb10683f0d865322a9df99951c3b11ba1a50/lib/bap_c/bap_c_term_attributes.mli
ocaml
* Abstraction of a data representation of C value. This attribute is attached to each inserted arg term, but can be further propagated by other passes * Function prototype. This attribute is inserted into each annotated function. * A c type associated with a term. This attribute is attached to each i...
* BIR attributes . open Bap.Std open Bap_c_type val data : Bap_c_data.t tag val proto : proto tag * [ layout ] describes the layout of a C object . @since 2.5.0 @since 2.5.0 *) val layout : Bap_c_data.layout tag val t : t tag
fa7152c33969431610b093222d6f8f06fc92d91e02988a696b41cd6c98861e43
sethfowler/pygmalion
Request.hs
# LANGUAGE DeriveGeneric # module Pygmalion.RPC.Request ( RPCRequest (..) , RPCResponse (..) ) where import Data.Serialize import qualified Data.Vector as V import Data.Vector.Serialize () import GHC.Generics import Pygmalion.Core import Pygmalion.Database.Request data RPCRequest = RPCIndexCommand !CommandInfo !Tim...
null
https://raw.githubusercontent.com/sethfowler/pygmalion/d58cc3411d6a17cd05c3b0263824cd6a2f862409/src/Pygmalion/RPC/Request.hs
haskell
# LANGUAGE DeriveGeneric # module Pygmalion.RPC.Request ( RPCRequest (..) , RPCResponse (..) ) where import Data.Serialize import qualified Data.Vector as V import Data.Vector.Serialize () import GHC.Generics import Pygmalion.Core import Pygmalion.Database.Request data RPCRequest = RPCIndexCommand !CommandInfo !Tim...
eff63ec3a99cced67434835806cfb3850614927165932a9bf38ba19c36fc357b
dmitryvk/sbcl-win32-threads
defconstant.lisp
This software is part of the SBCL system . See the README file for ;;;; more information. ;;;; This software is derived from the CMU CL system , which was written at Carnegie Mellon University and released into the ;;;; public domain. The software is in the public domain and is ;;;; provided with absolutely no wa...
null
https://raw.githubusercontent.com/dmitryvk/sbcl-win32-threads/5abfd64b00a0937ba2df2919f177697d1d91bde4/src/compiler/defconstant.lisp
lisp
more information. public domain. The software is in the public domain and is provided with absolutely no warranty. See the COPYING and CREDITS files for more information. Note: This behavior (discouraging any non-EQL modification) want bindings which are constant in some sense other than (This is OK -- undefine...
This software is part of the SBCL system . See the README file for This software is derived from the CMU CL system , which was written at Carnegie Mellon University and released into the (in-package "SB!IMPL") (def!macro sb!xc:defconstant (name value &optional documentation) #!+sb-doc "Define a global const...
cf6f0a4a0161074bd3871f44f70d5e083faa10f624145c9cd562ecf3c89babee
erlang/otp
diameter_examples_SUITE.erl
%% %% %CopyrightBegin% %% Copyright Ericsson AB 2013 - 2022 . All Rights Reserved . %% Licensed under the Apache License , Version 2.0 ( the " License " ) ; %% you may not use this file except in compliance with the License. %% You may obtain a copy of the License at %% %% -2.0 %% %% Unless required by applicab...
null
https://raw.githubusercontent.com/erlang/otp/c4d2c952fec0c4ab4ac7ff34c1a153e740fac9a6/lib/diameter/test/diameter_examples_SUITE.erl
erlang
%CopyrightBegin% you may not use this file except in compliance with the License. You may obtain a copy of the License at -2.0 Unless required by applicable law or agreed to in writing, software WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific lan...
Copyright Ericsson AB 2013 - 2022 . All Rights Reserved . Licensed under the Apache License , Version 2.0 ( the " License " ) ; distributed under the License is distributed on an " AS IS " BASIS , -module(diameter_examples_SUITE). -export([run/0, run/1]). -export([suite/0, all/0, di...
f72252368220b22d43bba7ff0b6bcb1a992752d2848a00f15deec7eaa55e4b71
static-analysis-engineering/codehawk
jCHXNativeMethodSignatures.ml
= = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = CodeHawk C Analyzer Author : ------------------------------------------------------------------------------ The MIT License ( MIT ) Copyrig...
null
https://raw.githubusercontent.com/static-analysis-engineering/codehawk/98ced4d5e6d7989575092df232759afc2cb851f6/CodeHawk/CHJ/jchcmdline/jCHXNativeMethodSignatures.ml
ocaml
chutil jchlib jchpre
= = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = CodeHawk C Analyzer Author : ------------------------------------------------------------------------------ The MIT License ( MIT ) Copyrig...
79721da32b27840e32ad161412b2b33f86da07764418b758287a52ff01b4696c
replikativ/datahike
db_test.cljc
(ns datahike.test.attribute-refs.db-test (:require #?(:cljs [cljs.test :as t :refer-macros [is deftest testing]] :clj [clojure.test :as t :refer [is deftest testing]]) [datahike.api :as d])) (def ref-cfg {:store {:backend :mem :id "attr-refs-test.db"} :keep-history? true :attribute-refs? true ...
null
https://raw.githubusercontent.com/replikativ/datahike/408cb0f538a837267e44b098df895fa00348fe10/test/datahike/test/attribute_refs/db_test.cljc
clojure
(ns datahike.test.attribute-refs.db-test (:require #?(:cljs [cljs.test :as t :refer-macros [is deftest testing]] :clj [clojure.test :as t :refer [is deftest testing]]) [datahike.api :as d])) (def ref-cfg {:store {:backend :mem :id "attr-refs-test.db"} :keep-history? true :attribute-refs? true ...
5ff20e02f62c2e27f7d99fd37082ec6a5de30472a3c996166f6036a010e03171
chrisaddy/astronaut
core.clj
(ns astronaut.core (:require [cli-matic.core :refer [run-cmd]]) (:require [clojure.java.jdbc :refer :all]) (:require [clojure.pprint :as p]) (:require [clojure.java.jdbc :as j]) (:require [clj-time.core :as t]) (:require [clj-time.coerce :as c]) (:require [clojure.java.io :as io]) (:require [clojure.str...
null
https://raw.githubusercontent.com/chrisaddy/astronaut/42fb7f5d83ccf0cea4d52f8cf21cbef96b805ae6/src/astronaut/core.clj
clojure
:global-opts [{:option "tags" :short "t" :as "Card context" :type :string :default ""}]
(ns astronaut.core (:require [cli-matic.core :refer [run-cmd]]) (:require [clojure.java.jdbc :refer :all]) (:require [clojure.pprint :as p]) (:require [clojure.java.jdbc :as j]) (:require [clj-time.core :as t]) (:require [clj-time.coerce :as c]) (:require [clojure.java.io :as io]) (:require [clojure.str...
0199072ef454c0649f10be9f13805fd5f8846b59df483d4fc9366d8c6923feb7
NorfairKing/feedback
Filter.hs
# LANGUAGE CPP # {-# LANGUAGE OverloadedStrings #-} # LANGUAGE QuasiQuotes # # LANGUAGE RecordWildCards # # LANGUAGE ScopedTypeVariables # module Feedback.Loop.Filter where import Data.ByteString (ByteString) import qualified Data.ByteString.Lazy as LB import qualified Data.ByteString.Lazy.Char8 as LB8 import Data.Co...
null
https://raw.githubusercontent.com/NorfairKing/feedback/3448bebcf1bad33fad4bd050f4527e3e3217f415/feedback/src/Feedback/Loop/Filter.hs
haskell
# LANGUAGE OverloadedStrings # If there is no git directory, we'll get a 'fatal' message on stderr. We don't need the user to see this, so we setStderr nullStream. It's not one of those files that vim makes
# LANGUAGE CPP # # LANGUAGE QuasiQuotes # # LANGUAGE RecordWildCards # # LANGUAGE ScopedTypeVariables # module Feedback.Loop.Filter where import Data.ByteString (ByteString) import qualified Data.ByteString.Lazy as LB import qualified Data.ByteString.Lazy.Char8 as LB8 import Data.Conduit import qualified Data.Conduit...
f7b7b49b0a144396c9c083882616ca076d394b05bb4679315d40c50fd798c6a5
kazu-yamamoto/http2
Queue.hs
# LANGUAGE RecordWildCards # module Network.HTTP2.Arch.Queue where import UnliftIO.Concurrent (forkIO) import UnliftIO.Exception (bracket) import UnliftIO.STM import Imports import Network.HTTP2.Arch.Manager import Network.HTTP2.Arch.Types # INLINE forkAndEnqueueWhenReady # forkAndEnqueueWhenReady :: IO () -> TQueu...
null
https://raw.githubusercontent.com/kazu-yamamoto/http2/88b3c192c251c15fa4dc426aa0372841dc3fee49/Network/HTTP2/Arch/Queue.hs
haskell
--------------------------------------------------------------
# LANGUAGE RecordWildCards # module Network.HTTP2.Arch.Queue where import UnliftIO.Concurrent (forkIO) import UnliftIO.Exception (bracket) import UnliftIO.STM import Imports import Network.HTTP2.Arch.Manager import Network.HTTP2.Arch.Types # INLINE forkAndEnqueueWhenReady # forkAndEnqueueWhenReady :: IO () -> TQueu...
ad7db188a0e1c9b46caa93ffd7b583ab01a41e6d2b980b9d5bd6ba7f2b4074cc
jonase/eastwood
recur.clj
(ns testcases.performance.red.recur (:require [clojure.string :as string])) (def ^:const vlq-base-shift 5) (def ^:const vlq-base (bit-shift-left 1 vlq-base-shift)) (def ^:const vlq-base-mask (dec vlq-base)) (def ^:const vlq-continuation-bit vlq-base) (defn to-vlq-signed [v] (if (neg? v) (inc (bit-shift-lef...
null
https://raw.githubusercontent.com/jonase/eastwood/605ab4a1d169270701200005792fa37b4c025405/cases/testcases/performance/red/recur.clj
clojure
(ns testcases.performance.red.recur (:require [clojure.string :as string])) (def ^:const vlq-base-shift 5) (def ^:const vlq-base (bit-shift-left 1 vlq-base-shift)) (def ^:const vlq-base-mask (dec vlq-base)) (def ^:const vlq-continuation-bit vlq-base) (defn to-vlq-signed [v] (if (neg? v) (inc (bit-shift-lef...
8f428d539cd263ba5bc916b1100a23955b56cbc87ea9fc876a8bee843d1c1e95
Tclv/HaskellBook
DoesItTypecheck.hs
1 data Person = Person Bool deriving Show --Did not derive show printPerson :: Person -> IO () printPerson person = putStrLn (show person) 2 Did not derive Eq settleDown :: Mood -> Mood -- No type signature settleDown x = if x == Woot then Blah else x 3 a ) Values of the type Mood due to the equality chec...
null
https://raw.githubusercontent.com/Tclv/HaskellBook/78eaa5c67579526b0f00f85a10be3156bc304c14/ch6/DoesItTypecheck.hs
haskell
Did not derive show No type signature b) Type error This is; curried data constructor
1 printPerson :: Person -> IO () printPerson person = putStrLn (show person) 2 Did not derive Eq settleDown x = if x == Woot then Blah else x 3 a ) Values of the type Mood due to the equality check with ` Woot ` . c ) Type error that Mood is not an instance of . 4 type Subject = String type Verb = ...
3b72cf2ebd195df7861e0d426c73108116d6368b8c25a1004ff066ba7c4393ec
SimulaVR/godot-haskell
AudioStreamMicrophone.hs
# LANGUAGE DerivingStrategies , GeneralizedNewtypeDeriving , TypeFamilies , TypeOperators , FlexibleContexts , DataKinds , MultiParamTypeClasses # TypeFamilies, TypeOperators, FlexibleContexts, DataKinds, MultiParamTypeClasses #-} module Godot.Core.AudioStreamMicrophone () where import Data.Coerce import Fo...
null
https://raw.githubusercontent.com/SimulaVR/godot-haskell/e8f2c45f1b9cc2f0586ebdc9ec6002c8c2d384ae/src/Godot/Core/AudioStreamMicrophone.hs
haskell
# LANGUAGE DerivingStrategies , GeneralizedNewtypeDeriving , TypeFamilies , TypeOperators , FlexibleContexts , DataKinds , MultiParamTypeClasses # TypeFamilies, TypeOperators, FlexibleContexts, DataKinds, MultiParamTypeClasses #-} module Godot.Core.AudioStreamMicrophone () where import Data.Coerce import Fo...
090991d54a2428e50901f18d24beee84b3f686df005482cf8b9d7399f427330e
uwplse/PUMPKIN-PATCH
abstracters.ml
(* --- Abstraction Strategies --- *) open Constr open Environ open Evd open Utilities open Substitution open Reducers open Filters open Candidates open Convertibility open Stateutils type abstraction_dimension = Arguments | Property type abstracter = env -> types -> types -> candidates -> evar_map -> candidates sta...
null
https://raw.githubusercontent.com/uwplse/PUMPKIN-PATCH/73fd77ba49388fdc72702a252a8fa8f071a8e1ea/plugin/src/core/components/abstraction/abstracters.ml
ocaml
--- Abstraction Strategies --- --- Auxiliary functions --- * Count the number of applications in a term. * Do not consider lambdas. --- Top-level --- * Substitute actual args with abstract args in candidates, * using an abstracter to determine when to substitute. * Reduce using the reducer in the abst...
open Constr open Environ open Evd open Utilities open Substitution open Reducers open Filters open Candidates open Convertibility open Stateutils type abstraction_dimension = Arguments | Property type abstracter = env -> types -> types -> candidates -> evar_map -> candidates state type abstraction_strategy = { ...
d9137213a5064e15f2fc24183016647c553a96891198f21f6dc912762b900a74
emqx/emqx
emqx_gateway_auth_ct.erl
%%-------------------------------------------------------------------- Copyright ( c ) 2020 - 2023 EMQ Technologies Co. , Ltd. All Rights Reserved . %% Licensed under the Apache License , Version 2.0 ( the " License " ) ; %% you may not use this file except in compliance with the License. %% You may obtain a copy o...
null
https://raw.githubusercontent.com/emqx/emqx/dbc10c2eed3df314586c7b9ac6292083204f1f68/apps/emqx_gateway/test/emqx_gateway_auth_ct.erl
erlang
-------------------------------------------------------------------- you may not use this file except in compliance with the License. You may obtain a copy of the License at -2.0 Unless required by applicable law or agreed to in writing, software WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express ...
Copyright ( c ) 2020 - 2023 EMQ Technologies Co. , Ltd. All Rights Reserved . Licensed under the Apache License , Version 2.0 ( the " License " ) ; distributed under the License is distributed on an " AS IS " BASIS , -module(emqx_gateway_auth_ct). -compile(nowarn_export_all). -compile(export_all). -behaviour(g...
9563e94942d6f35772fcc4def0f2c8b9d230897ee6aa9b5abf20bd184b03bba1
pirj/ryan
couchdb.erl
Copyright ( c ) 2009 ' Dimandt < > %% %% Permission is hereby granted, free of charge, to any person %% obtaining a copy of this software and associated documentation files ( the " Software " ) , to deal in the Software without %% restriction, including without limitation the rights to use, %% copy, modify, mer...
null
https://raw.githubusercontent.com/pirj/ryan/4df9ed791c3663c1de7864f62524e6f49700cda0/deps/erlang_couchdb/src/couchdb.erl
erlang
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell Software is furnished to do so, subject to the following condit...
Copyright ( c ) 2009 ' Dimandt < > files ( the " Software " ) , to deal in the Software without copies of the Software , and to permit persons to whom the included in all copies or substantial portions of the Software . THE SOFTWARE IS PROVIDED " AS IS " , WITHOUT WARRANTY OF ANY KIND , @author ' Dim...
77d7c3787bf3d0cc16a58383f65f408f2f8d2735bc24ae828af60fc02e5ea79f
ocaml-multicore/ocaml-tsan
exception_handler.ml
TEST * frame_pointers * * native readonly_files = " " all_modules = " $ { readonly_files } exception_handler.ml " * frame_pointers ** native readonly_files = "fp_backtrace.c" all_modules = "${readonly_files} exception_handler.ml" *) external fp_backtrace : unit -> unit = "fp_backtrace" [@@noalloc] ...
null
https://raw.githubusercontent.com/ocaml-multicore/ocaml-tsan/f54002470cc6ab780963cc81b11a85a820a40819/testsuite/tests/frame-pointers/exception_handler.ml
ocaml
We want to be sure to use some stack space so that rbp is shifted, * preventing inlining seems enough shouldn't happen This give us a chance to overwrite the memory address pointed by rbp if it * is still within 'raiser' stack frame. * Technically we don't need to overwrite it but by doing so we avoid some * infin...
TEST * frame_pointers * * native readonly_files = " " all_modules = " $ { readonly_files } exception_handler.ml " * frame_pointers ** native readonly_files = "fp_backtrace.c" all_modules = "${readonly_files} exception_handler.ml" *) external fp_backtrace : unit -> unit = "fp_backtrace" [@@noalloc] ...
9b4dd91bc105efff63e9384bfaebf8b68a0118e4fe031754a25696fb0a29e400
MyDataFlow/ttalk-server
pgsql_util.erl
%%% File : pgsql_util.erl Author : %%% Description : utility functions used in implementation of %%% postgresql driver. Created : 11 May 2005 by Blah < cos@local > -module(pgsql_util). %% Key-Value handling -export([option/3]). Networking -export([socket/1]). -export([send/2, send_int/2, ...
null
https://raw.githubusercontent.com/MyDataFlow/ttalk-server/07a60d5d74cd86aedd1f19c922d9d3abf2ebf28d/apps/pgsql/src/pgsql_util.erl
erlang
File : pgsql_util.erl Description : utility functions used in implementation of postgresql driver. Key-Value handling Constructing authentication messages. Lookup key in a plist stored in process dictionary under 'options'. Default is returned if there is no value for Key in the plist. Open a ...
Author : Created : 11 May 2005 by Blah < cos@local > -module(pgsql_util). -export([option/3]). Networking -export([socket/1]). -export([send/2, send_int/2, send_msg/3]). -export([recv_msg/2, recv_msg/1, recv_byte/2, recv_byte/1]). Protocol packing -export([string/1, make_pair/2, split_pair/2]). -export(...
4cf94dacad02d125697154c1b7a73ce1612008f03e3e69578525b20896773198
simmone/racket-simple-qr
separator.rkt
#lang racket (require "../func/func.rkt") (require "../../../share/func.rkt") (require "../../../share/separator.rkt") (provide (contract-out [draw-separator (-> exact-nonnegative-integer? hash? hash? void?)] )) (define (draw-separator modules points_map type_map) (let* ([finder_pattern_start_p...
null
https://raw.githubusercontent.com/simmone/racket-simple-qr/904f1491bc521badeafeabd0d7d7e97e3d0ee958/simple-qr/write/lib/separator/separator.rkt
racket
#lang racket (require "../func/func.rkt") (require "../../../share/func.rkt") (require "../../../share/separator.rkt") (provide (contract-out [draw-separator (-> exact-nonnegative-integer? hash? hash? void?)] )) (define (draw-separator modules points_map type_map) (let* ([finder_pattern_start_p...
f395c5627563dd07e04e7b0246bd90b88b45f68b1369edc95a6caffad52a50d0
ThoughtWorksInc/DeepDarkFantasy
Double.hs
# LANGUAGE NoImplicitPrelude , NoMonomorphismRestriction , FlexibleInstances , MultiParamTypeClasses , UndecidableInstances , UndecidableSuperClasses # NoImplicitPrelude, NoMonomorphismRestriction, FlexibleInstances, MultiParamTypeClasses, UndecidableInstances, UndecidableSuperClas...
null
https://raw.githubusercontent.com/ThoughtWorksInc/DeepDarkFantasy/4c569aefc03a2bcfb6113b65367201d30077f2b6/DDF/Double.hs
haskell
# LANGUAGE NoImplicitPrelude , NoMonomorphismRestriction , FlexibleInstances , MultiParamTypeClasses , UndecidableInstances , UndecidableSuperClasses # NoImplicitPrelude, NoMonomorphismRestriction, FlexibleInstances, MultiParamTypeClasses, UndecidableInstances, UndecidableSuperClas...
2239a881f510e4caf5f0a36be6ad1c5c22a22c149951c0a0450d029ffff8bf67
ds-wizard/engine-backend
Common.hs
module Wizard.Service.Migration.Metamodel.Migrator.Common ( convertValueToOject, getField, getArrayField, migrateMetamodelVersionField, migrateEventsField, validateMetamodelVersionField, ) where import Data.Aeson import qualified Data.Aeson.KeyMap as KM import Data.String (fromString) import qualified Data...
null
https://raw.githubusercontent.com/ds-wizard/engine-backend/d392b751192a646064305d3534c57becaa229f28/engine-wizard/src/Wizard/Service/Migration/Metamodel/Migrator/Common.hs
haskell
module Wizard.Service.Migration.Metamodel.Migrator.Common ( convertValueToOject, getField, getArrayField, migrateMetamodelVersionField, migrateEventsField, validateMetamodelVersionField, ) where import Data.Aeson import qualified Data.Aeson.KeyMap as KM import Data.String (fromString) import qualified Data...
c3b2456f9f8922d493af319543b1a6e8eb8b71932dfb6aa71343608cf658e9ce
imandra-ai/imandra-ros
tf_to_json.ml
open Json_utils;; open Basic_types_to_json;; open Ros_messages.Tf;; let tfMessage_to_json x = [ ( "transforms" , x.transforms |> (mklist Geometry_msgs_to_json.transformStamped_to_json) ); ] |> assoc_filter_nulls
null
https://raw.githubusercontent.com/imandra-ai/imandra-ros/e1380c267ee319dd4f86c4b54e0b270bc0738796/imandra_model/src-messages-pp/tf_to_json.ml
ocaml
open Json_utils;; open Basic_types_to_json;; open Ros_messages.Tf;; let tfMessage_to_json x = [ ( "transforms" , x.transforms |> (mklist Geometry_msgs_to_json.transformStamped_to_json) ); ] |> assoc_filter_nulls
93d9db86208702219bcd9c4fd373f29e6d23fdc753d4d08be78c93fabc9a9376
namin/reflection-schemes
os_tests.scm
(define (factorial-process n) (full-copy `((:exp . (begin (if (= n 0) (set! :done #t) (begin (set! result (* n result)) (set! n (- n 1)))) result)) (:env . ((result . 1) (n . ,n)))))) (define (double-process p) (full-copy-but (...
null
https://raw.githubusercontent.com/namin/reflection-schemes/d3fd61aa7edc8af5f7f2c9783b4e3c5356cd2bd5/01-toyos-jit/os_tests.scm
scheme
(define (factorial-process n) (full-copy `((:exp . (begin (if (= n 0) (set! :done #t) (begin (set! result (* n result)) (set! n (- n 1)))) result)) (:env . ((result . 1) (n . ,n)))))) (define (double-process p) (full-copy-but (...
5d08bd16cf643c3c01547d962102537d09a501471a450030655ba2357acd6681
ekmett/reactive
Merge.hs
-- Tracking down a problem with event merging import Data.Monoid (mappend) import Control.Applicative ((<$>)) import FRP.Reactive.Improving import FRP.Reactive.Future import FRP.Reactive.PrimReactive import FRP.Reactive.Reactive import FRP.Reactive.Internal.Future import FRP.Reactive.Internal.Reactive -- (Imp 1.0,1...
null
https://raw.githubusercontent.com/ekmett/reactive/61b20b7a2e92af372b5bd9a2af294db0fbdfa9d8/src/Test/Merge.hs
haskell
Tracking down a problem with event merging (Imp 1.0,1)->(Imp 2.0,2)->(Imp 3.0,3)->(Imp *** Exception: Prelude.undefined (Imp *** Exception: Prelude.undefined (Imp 1.5,100)->(Imp 2.3,200)->(Imp *** Exception: Prelude.undefined (Imp 1.0,1)->(Imp 1.5,100)->(Imp 2.0,2)->(Imp 2.5,200)->(Imp 3.0,3)->(Imp *** Exception: ...
import Data.Monoid (mappend) import Control.Applicative ((<$>)) import FRP.Reactive.Improving import FRP.Reactive.Future import FRP.Reactive.PrimReactive import FRP.Reactive.Reactive import FRP.Reactive.Internal.Future import FRP.Reactive.Internal.Reactive e1 = listEG [(exactly 1,1),(exactly 2,2),(exactly 3,3),(aft...
c1d80f19e70222062fe214554ea62948119ad601c81c5ddbbbea3f490a607315
fluentpython/lispy
chap9f.scm
$ I d : chap9f.scm , v 4.0 1995/07/10 06:52:22 queinnec Exp $ ;;;(((((((((((((((((((((((((((((((( L i S P )))))))))))))))))))))))))))))))) ;;; This file is part of the files that accompany the book: LISP Implantation Semantique Programmation ( InterEditions , France ) By Christian Queinnec < > ;;; Newest ve...
null
https://raw.githubusercontent.com/fluentpython/lispy/6b995c398e2d100fc3fc292e34ba1a00c0ae9b5a/references/LiSP-2ndEdition-2006Dec11/src/chap9f.scm
scheme
(((((((((((((((((((((((((((((((( L i S P )))))))))))))))))))))))))))))))) This file is part of the files that accompany the book: Newest version may be retrieved from: Check the README file before using this file. (((((((((((((((((((((((((((((((( L i S P )))))))))))))))))))))))))))))))) end of chap9f.scm
$ I d : chap9f.scm , v 4.0 1995/07/10 06:52:22 queinnec Exp $ LISP Implantation Semantique Programmation ( InterEditions , France ) By Christian Queinnec < > ( IP 128.93.2.54 ) ftp.inria.fr : INRIA / Projects / icsla / Books / LiSP*.tar.gz Only one world (define (make-macro-environment current-level...
0d7d50e5bf92f467287eda80690d1ead4b243e7b6769019eb96c258eae3b54e9
satori-com/mzbench
mzb_staticcloud_plugin.erl
-module(mzb_staticcloud_plugin). -behaviour(gen_server). -export([ start/2, create_cluster/3, destroy_cluster/1 ]). %% gen_server callbacks -export([init/1, handle_call/3, handle_cast/2, handle_info/2, terminate/2, code_change/3]). %%%============================================================...
null
https://raw.githubusercontent.com/satori-com/mzbench/02be2684655cde94d537c322bb0611e258ae9718/server/src/mzb_staticcloud_plugin.erl
erlang
gen_server callbacks =================================================================== API =================================================================== =================================================================== gen_server callbacks ===================================================================...
-module(mzb_staticcloud_plugin). -behaviour(gen_server). -export([ start/2, create_cluster/3, destroy_cluster/1 ]). -export([init/1, handle_call/3, handle_cast/2, handle_info/2, terminate/2, code_change/3]). start(Name, Opts) -> Spec = {Name, _MFA = {gen_server, start_link, [?M...
3eee23d667c51b828182df7078994e999dc379590065be42150ff593bd57ad57
gs0510/ofronds
b_type_declarations.ml
(* OCaml is strongly typed; types are often inferred by the compiler. It's possible to declare types inline as done in this exercise, but that's not a common practice. *) let x : int = 5 let y : float = "hello"
null
https://raw.githubusercontent.com/gs0510/ofronds/e2f614dbdafab1ac5088afbd29b45451784ea896/exercises/1.variables/b_type_declarations/b_type_declarations.ml
ocaml
OCaml is strongly typed; types are often inferred by the compiler. It's possible to declare types inline as done in this exercise, but that's not a common practice.
let x : int = 5 let y : float = "hello"
7fa40ea77fa699691d0500cfabc9946afdd7115f8faefc1d851633532cee5c34
racketscript/racketscript
info.rkt
#lang info (define collection 'multi) (define version "0.1") (define deps '("base" ["racket" "6.4"] "typed-racket-lib" "typed-racket-more" "threading-lib" "graph-lib" "anaphoric")) (define build-deps '("base" "typed-racket-lib" "typed-racket-more" ...
null
https://raw.githubusercontent.com/racketscript/racketscript/07e908679fe1f86b812a30d5b91314dd5c500e4f/racketscript-compiler/info.rkt
racket
Test configuration Coverage
#lang info (define collection 'multi) (define version "0.1") (define deps '("base" ["racket" "6.4"] "typed-racket-lib" "typed-racket-more" "threading-lib" "graph-lib" "anaphoric")) (define build-deps '("base" "typed-racket-lib" "typed-racket-more" ...
fbe81f437e85f4487de3c116d225c9307b92c23e9651777a2246cbbed7f04966
raptazure/experiments
Main.hs
import qualified Data.Map as Map data Bool = False | True deriving ( ) 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 - x...
null
https://raw.githubusercontent.com/raptazure/experiments/c48263980d1ce22ee9407ff8dcf0cf5091b01c70/haskell/learnyouahaskell/ch08/Main.hs
haskell
module Shapes ( Point(..) , Shape(..) , surface , nudge , baseRect ) where :t age Car {company="Ford", model="Mustang", year=1967} (++) :: [a] -> [a] -> [a] [] ++ ys = ys (x:xs) ++ ys = x : (xs ++ ys) (==) :: a -> a -> Bool (/=) :: a -> a -> Bool x == y = not (x /= y) x /= y = not (x == y) ...
import qualified Data.Map as Map data Bool = False | True deriving ( ) 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 - x...
fd1b512ecd85942d6b3ce36025007d26994496d60670045c5bd67ba9652cef38
protz/mezzo
Types.mli
(*****************************************************************************) (* Mezzo, a programming language based on permissions *) Copyright ( C ) 2011 , 2012 and (* *) (* This program is free softwar...
null
https://raw.githubusercontent.com/protz/mezzo/4e9d917558bd96067437116341b7a6ea02ab9c39/typing/Types.mli
ocaml
*************************************************************************** Mezzo, a programming language based on permissions This program is free software: you can redistribute it and/or modify (at your optio...
Copyright ( C ) 2011 , 2012 and it under the terms of the GNU General Public License as published by the Free Software Foundation , either version 3 of the License , or You should have received a copy of the GNU General Public License * This module provides a variety of fu...
4af6f30af4fc2de5426a80622ffbb7c65fe45d7feb0ec65a62bcf584d9b39217
GumTreeDiff/cgum
parsing_consistency_c.mli
* Copyright 2014 , INRIA * * This file is part of Cgen . Much of it comes from Coccinelle , which is * also available under the GPLv2 license * * Cgen is free software : you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free So...
null
https://raw.githubusercontent.com/GumTreeDiff/cgum/8521aa80fcf4873a19e60ce8c846c886aaefb41b/parsing_c/parsing_consistency_c.mli
ocaml
check consistency and possibly change some Ident expression into * TypeName, especially in argument to functions.
* Copyright 2014 , INRIA * * This file is part of Cgen . Much of it comes from Coccinelle , which is * also available under the GPLv2 license * * Cgen is free software : you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free So...
0f3097f848b7d2c0291e2811e86ad4c2100165f2d7a7303a899ce1f929fff0cf
janestreet/file_path
relative.mli
* @inline
null
https://raw.githubusercontent.com/janestreet/file_path/ba8b499a6cc0e47bf949b292c07afd853b6b9a4a/src/relative.mli
ocaml
* @inline
56494537a2bf48b07b1c5108efb1b8b0588e36938a76cee034aab9647d7bc2d5
triffon/fp-2019-20
b-tests.rkt
#lang racket (require rackunit) (require "describe.rkt") (display "=== b - 1 ===\n") (describe sum-digit-divisors (check-equal? (sum-digit-divisors 46) 0) (check-equal? (sum-digit-divisors 52) 2) (check-equal? (sum-digit-divisors 222) 6) (check-equal? (sum-digit-divisors 123) 4) (check-equal? (sum-digit-div...
null
https://raw.githubusercontent.com/triffon/fp-2019-20/7efb13ff4de3ea13baa2c5c59eb57341fac15641/exercises/computer-science-2/exam-01/b-tests.rkt
racket
the tricky test
#lang racket (require rackunit) (require "describe.rkt") (display "=== b - 1 ===\n") (describe sum-digit-divisors (check-equal? (sum-digit-divisors 46) 0) (check-equal? (sum-digit-divisors 52) 2) (check-equal? (sum-digit-divisors 222) 6) (check-equal? (sum-digit-divisors 123) 4) (check-equal? (sum-digit-div...
8af7c386e43cf8063bb3274445738000e52d6ecb7f47f09a6190a4d8889a3731
techascent/tech.parallel
next_item_fn.clj
(ns tech.parallel.next-item-fn) (defn create-next-item-fn "Given a sequence return a function that each time called (with no arguments) returns the next item in the sequence in a mutable fashion." [item-sequence] (let [primary-sequence (atom item-sequence)] (fn [] (loop [sequence @primary-sequence] ...
null
https://raw.githubusercontent.com/techascent/tech.parallel/3d25ebe0e7260a4ebcc9ae48167c6a0937212ddd/src/tech/parallel/next_item_fn.clj
clojure
(ns tech.parallel.next-item-fn) (defn create-next-item-fn "Given a sequence return a function that each time called (with no arguments) returns the next item in the sequence in a mutable fashion." [item-sequence] (let [primary-sequence (atom item-sequence)] (fn [] (loop [sequence @primary-sequence] ...
2296fb5817fb7531f0c9bc6ed3cb2a863bfb01ae524b43720d9f6f34ec689b84
haskell/hackage-server
Repo.hs
# LANGUAGE RecordWildCards # module Distribution.Client.Mirror.Repo ( -- * Repository types SourceRepo(..) , TargetRepo(..) -- ** Initialization , withSourceRepo , withTargetRepo -- ** Operations on source repos , downloadSourceIndex , downloadPackage -- ** Operations on target repos , r...
null
https://raw.githubusercontent.com/haskell/hackage-server/6c53b708ded21bef40ce04a43741fc921ecafcaa/src/Distribution/Client/Mirror/Repo.hs
haskell
* Repository types ** Initialization ** Operations on source repos ** Operations on target repos ** Finalizing a mirror stdlib hackage hackage-security ------------------------------------------------------------------------------ Initialization TODO: Should really call validateHackageURI'. ---------------...
# LANGUAGE RecordWildCards # module Distribution.Client.Mirror.Repo ( SourceRepo(..) , TargetRepo(..) , withSourceRepo , withTargetRepo , downloadSourceIndex , downloadPackage , readCachedTargetIndex , authenticate , uploadPackage , packageExists , finalizeMirror , cacheTargetIndex ) where ...
0390f40fe4ce90431e2440f958ddb01bd66f8e546dabb43bd24f9fec716bcbc5
serras/lambdaconf-2015-web
Main.hs
{-# LANGUAGE OverloadedStrings #-} # LANGUAGE ScopedTypeVariables # # LANGUAGE QuasiQuotes # module Main where import Control.Monad.IO.Class import Control.Monad.Logger import Data.Monoid import Database.Persist hiding (get) import Database.Persist.Sql hiding (get) import qualified Database.Persist as Db import qualif...
null
https://raw.githubusercontent.com/serras/lambdaconf-2015-web/ec29b8b47dfb8ee33b09a0c18caceb6247e5a413/p3-db/src/Main.hs
haskell
# LANGUAGE OverloadedStrings # Create the database small function for running db create new user obtain user by id obtain users with a certain username obtain users with a certain username
# LANGUAGE ScopedTypeVariables # # LANGUAGE QuasiQuotes # module Main where import Control.Monad.IO.Class import Control.Monad.Logger import Data.Monoid import Database.Persist hiding (get) import Database.Persist.Sql hiding (get) import qualified Database.Persist as Db import qualified Database.Persist.Sqlite as Sqli...
a072a0feac57372efe17e2a945f401afd665cc24a53ce6e7aac16d69c9dbc504
DerekCuevas/interview-cake-clj
core_test.clj
(ns find-rotation-point.core-test (:require [clojure.test :refer :all] [find-rotation-point.core :refer :all])) (def words-a ["ptolemaic" "retrograde" "supplant" "undulate" "xenoepist" "asymptote" "babka" "banoffee" "engender" "karpatka" "othellolagkage"]) (def words-b ...
null
https://raw.githubusercontent.com/DerekCuevas/interview-cake-clj/f17d3239bb30bcc17ced473f055a9859f9d1fb8d/find-rotation-point/test/find_rotation_point/core_test.clj
clojure
(ns find-rotation-point.core-test (:require [clojure.test :refer :all] [find-rotation-point.core :refer :all])) (def words-a ["ptolemaic" "retrograde" "supplant" "undulate" "xenoepist" "asymptote" "babka" "banoffee" "engender" "karpatka" "othellolagkage"]) (def words-b ...
14cab2488842dd908c1d08595ec3b1574c8c55b309326bcb0a2ce24bf03791df
threatgrid/ctia
store.clj
(ns ctia.store) (defprotocol IStore (create-record [this new-records ident params]) (read-record [this id ident params]) (read-records [this ids ident params]) (update-record [this id record ident params]) (delete-record [this id ident params]) (bulk-delete [this ids ident params]) (bulk-update [this rec...
null
https://raw.githubusercontent.com/threatgrid/ctia/6c11ba6a7c57a44de64c16601d3914f5b0cf308e/src/ctia/store.clj
clojure
(ns ctia.store) (defprotocol IStore (create-record [this new-records ident params]) (read-record [this id ident params]) (read-records [this ids ident params]) (update-record [this id record ident params]) (delete-record [this id ident params]) (bulk-delete [this ids ident params]) (bulk-update [this rec...
379c93b555a312d7f1b35faf7bd643471d4b8ccf591f1be28cc83e1927f6ccc5
WorksHub/client
config.clj
;; This is placeholder code. Do not add config here. (ns wh.config (:refer-clojure :exclude [get get-in])) (def config {}) (defn get-in [ks] (clojure.core/get-in config ks)) (defn get [k] (clojure.core/get config k))
null
https://raw.githubusercontent.com/WorksHub/client/a51729585c2b9d7692e57b3edcd5217c228cf47c/server/src/wh/config.clj
clojure
This is placeholder code. Do not add config here.
(ns wh.config (:refer-clojure :exclude [get get-in])) (def config {}) (defn get-in [ks] (clojure.core/get-in config ks)) (defn get [k] (clojure.core/get config k))
2fc39e2f47eb49b89954c94c249107881cb4134095b3db379fb2da5eb3f9b855
8c6794b6/guile-tjit
compare.scm
Copyright ( c ) 2011 Free Software Foundation , Inc. Copyright ( c ) 2005 and . ; ; Permission is hereby granted, free of charge, to any person obtaining ; a copy of this software and associated documentation files (the ` ` Software '' ) , to deal in the Software without restriction , including ; without li...
null
https://raw.githubusercontent.com/8c6794b6/guile-tjit/9566e480af2ff695e524984992626426f393414f/module/srfi/srfi-67/compare.scm
scheme
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the without limitation the rights to use, copy, modify, merge, publish, the following conditions: The above copyright notice and this permission notice shall be THE SOFTWARE IS P...
Copyright ( c ) 2011 Free Software Foundation , Inc. Copyright ( c ) 2005 and . ` ` Software '' ) , to deal in the Software without restriction , including distribute , sublicense , and/or sell copies of the Software , and to permit persons to whom the Software is furnished to do so , subject to includ...