_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 |
|---|---|---|---|---|---|---|---|---|
2d3b49244947f1b3c0a93ee3973354c7439ed17535ff3aac0c33d5521377d10e | ghc/testsuite | tc017.hs | module ShouldSucceed where
v | True = v+1
| False = v
| null | https://raw.githubusercontent.com/ghc/testsuite/998a816ae89c4fd573f4abd7c6abb346cf7ee9af/tests/typecheck/should_compile/tc017.hs | haskell | module ShouldSucceed where
v | True = v+1
| False = v
| |
fa3dbeef252cb3c6ec7b1db70eeb604c6276f803d540376a3fc9035c15d88d5c | project-oak/hafnium-verification | Fnv64Hash.ml |
* Copyright ( c ) Facebook , Inc. and its affiliates .
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree .
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
... | null | https://raw.githubusercontent.com/project-oak/hafnium-verification/6071eff162148e4d25a0fedaea003addac242ace/experiments/ownership-inference/infer/infer/src/c_stubs/Fnv64Hash.ml | ocaml |
* Copyright ( c ) Facebook , Inc. and its affiliates .
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree .
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
... | |
ac2c3adda29f668765c69381cb9bc2cae9e7694c5e8f4ac4a1a12df982c333b4 | SamirTalwar/advent-of-code | Map.hs | {-# OPTIONS -Wall #-}
module Helpers.Map where
import Data.Map (Map)
import qualified Data.Map as Map
countValues :: (Foldable t, Ord k) => t k -> Map k Int
countValues = foldr (\x -> Map.insertWith (+) x 1) Map.empty
| null | https://raw.githubusercontent.com/SamirTalwar/advent-of-code/48a6373b3242a634393f1f503932829d95abcdae/2021/Helpers/Map.hs | haskell | # OPTIONS -Wall # |
module Helpers.Map where
import Data.Map (Map)
import qualified Data.Map as Map
countValues :: (Foldable t, Ord k) => t k -> Map k Int
countValues = foldr (\x -> Map.insertWith (+) x 1) Map.empty
|
6c18ad5e5e9064ab6fffc044fd097c569769053757ab2563d5ee3ee5cf88ca37 | DaveWM/lobster-writer | css.clj | (ns lobster-writer.css
(:require [garden.def :refer [defstyles]]
[garden.stylesheet :refer [at-keyframes at-media]]
[garden.color :as gc]))
(def light-gray "#e1e8f0")
(def palette-1 "#0072BB")
(def palette-2 "#1B3B6F")
(def palette-3 "0B132B")
(def palette-4 "#B9D6F2")
(def palette-5 "#00ABE... | null | https://raw.githubusercontent.com/DaveWM/lobster-writer/de40ee73d612abd1cdb4281e61a604f73afb215d/src/clj/lobster_writer/css.clj | clojure | (ns lobster-writer.css
(:require [garden.def :refer [defstyles]]
[garden.stylesheet :refer [at-keyframes at-media]]
[garden.color :as gc]))
(def light-gray "#e1e8f0")
(def palette-1 "#0072BB")
(def palette-2 "#1B3B6F")
(def palette-3 "0B132B")
(def palette-4 "#B9D6F2")
(def palette-5 "#00ABE... | |
b7baeeac282cb5f3bf4492c6ec5ee45c03930fc59d744d4365399568bf797115 | fakedata-haskell/fakedata | Marketing.hs | {-# LANGUAGE OverloadedStrings #-}
# LANGUAGE TemplateHaskell #
module Faker.Provider.Marketing where
import Config
import Control.Monad.Catch
import Control.Monad.IO.Class
import Data.Map.Strict (Map)
import Data.Monoid ((<>))
import Data.Text (Text)
import Data.Vector (Vector)
import Data.Yaml
import Faker
import F... | null | https://raw.githubusercontent.com/fakedata-haskell/fakedata/7b0875067386e9bb844c8b985c901c91a58842ff/src/Faker/Provider/Marketing.hs | haskell | # LANGUAGE OverloadedStrings # | # LANGUAGE TemplateHaskell #
module Faker.Provider.Marketing where
import Config
import Control.Monad.Catch
import Control.Monad.IO.Class
import Data.Map.Strict (Map)
import Data.Monoid ((<>))
import Data.Text (Text)
import Data.Vector (Vector)
import Data.Yaml
import Faker
import Faker.Internal
import Faker.Provider... |
5dbe57e6b87b48a01f811619aacfcb9620bcb673bfd02b8b0847fd7b96ea29d2 | PacktWorkshops/The-Clojure-Workshop | activity_4_02_test.clj | (ns packt-clj.chapter-4-tests.activity-4-02-test
(:require
[clojure.test :as t :refer [deftest is testing]]
[clojure.java.io :as io]
[packt-clj.chapter-4-tests.activity-4-02 :as exo]))
;;; For convenience, we reference the csv file as a resource.
(def data (io/file (io/resource "match_scores_1991-2016_unin... | null | https://raw.githubusercontent.com/PacktWorkshops/The-Clojure-Workshop/3d309bb0e46a41ce2c93737870433b47ce0ba6a2/Chapter04/tests/packt-clj.chapter-4-tests/test/packt_clj/chapter_4_tests/activity_4_02_test.clj | clojure | For convenience, we reference the csv file as a resource. | (ns packt-clj.chapter-4-tests.activity-4-02-test
(:require
[clojure.test :as t :refer [deftest is testing]]
[clojure.java.io :as io]
[packt-clj.chapter-4-tests.activity-4-02 :as exo]))
(def data (io/file (io/resource "match_scores_1991-2016_unindexed_csv.csv")))
(deftest rivalry-count
(let [rivalry (e... |
27db992a48b29ff3802d65f1ec6aa35389c6572e2fb6f576aaa691b027a35fc0 | 0install/0install | ui.mli | Copyright ( C ) 2013 , the README file for details , or visit .
* See the README file for details, or visit .
*)
(** Common types for user interface callbacks *)
type select_mode = [
| `Select_only (* only download feeds, not archives; display "Select" in GUI *)
| `Download_only (* download... | null | https://raw.githubusercontent.com/0install/0install/22eebdbe51a9f46cda29eed3e9e02e37e36b2d18/src/zeroinstall/ui.mli | ocaml | * Common types for user interface callbacks
only download feeds, not archives; display "Select" in GUI
download archives too; refresh if stale feeds; display "Download" in GUI
download archives; update stale in background; display "Run" in GUI
* Choose (and possibly download) a set of implementations.
* @pa... | Copyright ( C ) 2013 , the README file for details , or visit .
* See the README file for details, or visit .
*)
type select_mode = [
]
class type ui_handler =
object
method run_solver :
< config : General.config; distro : Distro.t; make_fetcher : Progress.watcher -> Fetch.fetcher; .. > ->
... |
43b194bec9317143fd7c94a5acdda21fc29f4ef3bc964404683d4b5c7233ef43 | wdebeaum/step | extinguish.lisp | ;;;;
W::extinguish
;;;;
(define-words :pos W::v :TEMPL AGENT-FORMAL-XP-TEMPL
:words (
(W::extinguish
(SENSES
((EXAMPLE "extinguish the candle")
(LF-PARENT ont::deactivate-turn-off) ;stop)
(TEMPL AGENT-AFFECTED-XP-NP-TEMPL)
(SEM (F::Cause F::agentive) (F::Aspect F::bounded) (F::time-sp... | null | https://raw.githubusercontent.com/wdebeaum/step/f38c07d9cd3a58d0e0183159d4445de9a0eafe26/src/LexiconManager/Data/new/extinguish.lisp | lisp |
stop) | W::extinguish
(define-words :pos W::v :TEMPL AGENT-FORMAL-XP-TEMPL
:words (
(W::extinguish
(SENSES
((EXAMPLE "extinguish the candle")
(TEMPL AGENT-AFFECTED-XP-NP-TEMPL)
(SEM (F::Cause F::agentive) (F::Aspect F::bounded) (F::time-span F::atomic))
)
)
)
))
|
57fd0d7e81c6c0a939bf88bebc72f83860aef834fc9c55f2de9ffdb8cbe0bf2d | NorfairKing/tickler | DeleteAccount.hs | # LANGUAGE DataKinds #
# LANGUAGE FlexibleContexts #
# LANGUAGE MultiParamTypeClasses #
# LANGUAGE RecordWildCards #
module Tickler.Server.Handler.Admin.DeleteAccount
( serveAdminDeleteAccount,
)
where
import Database.Persist
import Import
import Servant
import Tickler.API
import Tickler.Server.Handler.Utils
impo... | null | https://raw.githubusercontent.com/NorfairKing/tickler/71c6aec471d095fe2357e135bed90a92619de393/tickler-server/src/Tickler/Server/Handler/Admin/DeleteAccount.hs | haskell | # LANGUAGE DataKinds #
# LANGUAGE FlexibleContexts #
# LANGUAGE MultiParamTypeClasses #
# LANGUAGE RecordWildCards #
module Tickler.Server.Handler.Admin.DeleteAccount
( serveAdminDeleteAccount,
)
where
import Database.Persist
import Import
import Servant
import Tickler.API
import Tickler.Server.Handler.Utils
impo... | |
9da83e95f4c63bfc0f4ae7e1ac7a5172a02756438d8eff60592655cf39566000 | anwarmamat/cmsc330fall18-public | testUtils.ml | open OUnit2
open P4b.EvalUtils
open P4b.Eval
open P4b.SmallCTypes
(* Assertion wrappers for convenience and readability *)
let assert_true b = assert_equal true b
let assert_false b = assert_equal false b
let assert_succeed () = assert_true true
(* Constants pertaining to error case tests *)
let stmt_env : environmen... | null | https://raw.githubusercontent.com/anwarmamat/cmsc330fall18-public/12585d98d45f954f75e2f78df3062444f5f97cf6/p4b/test/testUtils.ml | ocaml | Assertion wrappers for convenience and readability
Constants pertaining to error case tests | open OUnit2
open P4b.EvalUtils
open P4b.Eval
open P4b.SmallCTypes
let assert_true b = assert_equal true b
let assert_false b = assert_equal false b
let assert_succeed () = assert_true true
let stmt_env : environment = [("x", Int_Val(1)); ("p", Bool_Val(false))]
let expr_env : environment = stmt_env @ [("y", Int_Val(6... |
f18f62941c36f4e917c0c259b3a8f3d481a2bd8e7fa2e2ef08768f883ea077a2 | mindreframer/clojure-stuff | core.cljs | (ns omchaya.core
(:require [cljs.core.async :as async :refer [>! <! alts! chan sliding-buffer put! close!]]
[clojure.string :as string]
[dommy.core :as dommy]
[omchaya.api.mock :as api]
[omchaya.components.app :as app]
[omchaya.controllers.controls :as contr... | null | https://raw.githubusercontent.com/mindreframer/clojure-stuff/1e761b2dacbbfbeec6f20530f136767e788e0fe3/github.com/sgrove/omchaya/src/omchaya/core.cljs | clojure | :state-history is a vector of vectors, where the inner
vector is the same shape as the messages played
Capture the current history for playback in the absence
of a server to store it
Local dev tooling
Uncomment to have random messages send | (ns omchaya.core
(:require [cljs.core.async :as async :refer [>! <! alts! chan sliding-buffer put! close!]]
[clojure.string :as string]
[dommy.core :as dommy]
[omchaya.api.mock :as api]
[omchaya.components.app :as app]
[omchaya.controllers.controls :as contr... |
e55e0e269c90c4e85ca2fdbef37dea6fee655eed47e3e89023a4d803e62aadfa | byteverse/json-syntax | Flatten.hs | # language BangPatterns #
# language DuplicateRecordFields #
# language NamedFieldPuns #
-- | Flatten nested JSON objects into a single JSON object in which the keys
-- have been joined by the separator.
module Json.Flatten
( flatten
) where
import Control.Monad.ST (ST)
import Control.Monad.ST.Run (runByteArrayST... | null | https://raw.githubusercontent.com/byteverse/json-syntax/c4ecc71e9972edfdeb0111300f120feab1780974/src/Json/Flatten.hs | haskell | | Flatten nested JSON objects into a single JSON object in which the keys
have been joined by the separator.
| Flatten a json value, recursively descending into objects and joining
keys with the separator. For example:
> , "occupation":
> { "name": "burglar"
> }
> , "favorites": ["adventures","lunch"]
> }... | # language BangPatterns #
# language DuplicateRecordFields #
# language NamedFieldPuns #
module Json.Flatten
( flatten
) where
import Control.Monad.ST (ST)
import Control.Monad.ST.Run (runByteArrayST)
import Data.Builder.Catenable (Builder)
import Data.ByteString.Short.Internal (ShortByteString(SBS))
import Data.... |
0bda75ffd0e1c6d8b9a203564254519469261cc7b0ccb4dcbb4a733b7d337aaa | ruhler/smten | IO0.hs |
# LANGUAGE NoImplicitPrelude #
module Smten.System.IO0 (
IO, putChar, readFile, getContents,
linebuffer,
) where
import Prelude (IO, Char, String)
import qualified Prelude as P
import Smten.Plugin.Annotations
import qualified System.IO as P
# ANN module PrimitiveModule #
{-# NOINLINE putChar #-}
putChar ::... | null | https://raw.githubusercontent.com/ruhler/smten/16dd37fb0ee3809408803d4be20401211b6c4027/smten-base/Smten/System/IO0.hs | haskell | # NOINLINE putChar #
# SCC "PRIM_PUT_CHAR" #
# SCC "PRIM_READ_FILE" #
# SCC "PRIM_GET_CONTENTS" # |
# LANGUAGE NoImplicitPrelude #
module Smten.System.IO0 (
IO, putChar, readFile, getContents,
linebuffer,
) where
import Prelude (IO, Char, String)
import qualified Prelude as P
import Smten.Plugin.Annotations
import qualified System.IO as P
# ANN module PrimitiveModule #
putChar :: Char -> IO ()
# NOINLIN... |
3d9772c63b85196ab050feefcef3e53fd577e331638c7d382c6dd1c57febfe79 | crategus/cl-cffi-gtk | gdk.device-manager.lisp | ;;; ----------------------------------------------------------------------------
;;; gdk.device-manager.lisp
;;;
The documentation of this file is taken from the 3 Reference Manual
Version 3.24 and modified to document the Lisp binding to the GDK library .
;;; See <>. The API documentation of the Lisp binding is
... | null | https://raw.githubusercontent.com/crategus/cl-cffi-gtk/ba198f7d29cb06de1e8965e1b8a78522d5430516/gdk/gdk.device-manager.lisp | lisp | ----------------------------------------------------------------------------
gdk.device-manager.lisp
See <>. The API documentation of the Lisp binding is
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License for Lisp
License, or (at you... | The documentation of this file is taken from the 3 Reference Manual
Version 3.24 and modified to document the Lisp binding to the GDK library .
available from < -cffi-gtk/ > .
Copyright ( C ) 2012 - 2021
as published by the Free Software Foundation , either version 3 of the
the GNU Lesser General Public ... |
0bf9a7542b6d35793b4a000e00f54d0b8335120caf0312b5ecffb5ff5ccffea6 | ghc/testsuite | TH_tuple1.hs | # LANGUAGE TemplateHaskell #
-- Test the use of tupleDataName, tupleTypeName
module ShouldCompile where
import Language.Haskell.TH
foo = $( sigE (appsE [conE (tupleDataName 2),
litE (integerL 1),
litE (integerL 2)])
(appT (appT (conT (tupleTypeName 2))
(conT ''Integer))
(conT ''Integ... | null | https://raw.githubusercontent.com/ghc/testsuite/998a816ae89c4fd573f4abd7c6abb346cf7ee9af/tests/th/TH_tuple1.hs | haskell | Test the use of tupleDataName, tupleTypeName | # LANGUAGE TemplateHaskell #
module ShouldCompile where
import Language.Haskell.TH
foo = $( sigE (appsE [conE (tupleDataName 2),
litE (integerL 1),
litE (integerL 2)])
(appT (appT (conT (tupleTypeName 2))
(conT ''Integer))
(conT ''Integer))
)
|
4fdf255ea9989f3c55038fb4038c8bfc81b6a6013298958a9ceb67fe04db871c | weavejester/codox | import.clj | (ns codox.import
(:require [codox.example :as ex]))
(defn foop
[& args]
(apply ex/foop args))
(alter-meta! #'foop merge (meta #'ex/foop))
| null | https://raw.githubusercontent.com/weavejester/codox/bc41c2bbc270f52bceba095e57be30de80b892e0/example/src/clojure/codox/import.clj | clojure | (ns codox.import
(:require [codox.example :as ex]))
(defn foop
[& args]
(apply ex/foop args))
(alter-meta! #'foop merge (meta #'ex/foop))
| |
35179c2005f626fc4053bc3fc6ef0f14b3359d2d08baf493450018c325c3bfc2 | ds-wizard/engine-backend | DocumentTemplateAssetChangeJM.hs | module Wizard.Api.Resource.DocumentTemplate.Asset.DocumentTemplateAssetChangeJM where
import Data.Aeson
import Shared.Util.Aeson
import Wizard.Api.Resource.DocumentTemplate.Asset.DocumentTemplateAssetChangeDTO
instance FromJSON DocumentTemplateAssetChangeDTO where
parseJSON = genericParseJSON jsonOptions
instance... | null | https://raw.githubusercontent.com/ds-wizard/engine-backend/d392b751192a646064305d3534c57becaa229f28/engine-wizard/src/Wizard/Api/Resource/DocumentTemplate/Asset/DocumentTemplateAssetChangeJM.hs | haskell | module Wizard.Api.Resource.DocumentTemplate.Asset.DocumentTemplateAssetChangeJM where
import Data.Aeson
import Shared.Util.Aeson
import Wizard.Api.Resource.DocumentTemplate.Asset.DocumentTemplateAssetChangeDTO
instance FromJSON DocumentTemplateAssetChangeDTO where
parseJSON = genericParseJSON jsonOptions
instance... | |
8e7bad7456d76bd8db3c1d890d109fd5d3c030475444a1e1da1d2a0abe76c949 | yapsterapp/er-cassandra | select_buffered.clj | (ns er-cassandra.model.alia.select-buffered
(:require
[cats.context :refer [with-context]]
[cats.core :refer [mlet return]]
[cats.labs.manifold :refer [deferred-context]]
[er-cassandra.key :as k]
[er-cassandra.model.alia.select :as select]
[er-cassandra.model.model-session :as ms]
[er-cassandra.m... | null | https://raw.githubusercontent.com/yapsterapp/er-cassandra/1d059f47bdf8654c7a4dd6f0759f1a114fdeba81/src/er_cassandra/model/alia/select_buffered.clj | clojure | query lookups with a downstream buffer to limit concurrency
of join queries | (ns er-cassandra.model.alia.select-buffered
(:require
[cats.context :refer [with-context]]
[cats.core :refer [mlet return]]
[cats.labs.manifold :refer [deferred-context]]
[er-cassandra.key :as k]
[er-cassandra.model.alia.select :as select]
[er-cassandra.model.model-session :as ms]
[er-cassandra.m... |
738cf3b16eb3b8b29e4d44047f966c2ee19a8849f618fe91fdceced3a67eabd7 | jepsen-io/voltdb | perf.clj | (ns jepsen.voltdb.perf
"Performance benchmarks for single and multi transactions, with a mixed
read-write fixed-concurrency workload, over varying node count."
(:require [jepsen [core :as jepsen]
[control :as c :refer [|]]
[checker :as checker]
... | null | https://raw.githubusercontent.com/jepsen-io/voltdb/7c29d0d6caa29b85143d6942e078d7c0bdb82e35/src/jepsen/voltdb/perf.clj | clojure | (ns jepsen.voltdb.perf
"Performance benchmarks for single and multi transactions, with a mixed
read-write fixed-concurrency workload, over varying node count."
(:require [jepsen [core :as jepsen]
[control :as c :refer [|]]
[checker :as checker]
... | |
61abc8d4b18c511ac559d2574be86e9b28f3a452e32ed2e5905a6d4244e1cc20 | mhkoji/Senn | katakana.lisp | (defpackage :senn.im.predict.katakana
(:use :cl)
(:export :predictor))
(in-package :senn.im.predict.katakana)
(defclass predictor () ())
(defmethod senn.im.predict:execute append ((mixin predictor) (string string))
(list (senn.ja:hiragana->katakana string)))
| null | https://raw.githubusercontent.com/mhkoji/Senn/34ea3e47293d5ae9722500cf503abf37fb39bc70/senn/src/im/predict/katakana.lisp | lisp | (defpackage :senn.im.predict.katakana
(:use :cl)
(:export :predictor))
(in-package :senn.im.predict.katakana)
(defclass predictor () ())
(defmethod senn.im.predict:execute append ((mixin predictor) (string string))
(list (senn.ja:hiragana->katakana string)))
| |
aec53c9baea8c265bba6ad5367d73853ad245d037509f024ff5f5b208ecf16cf | screenshotbot/screenshotbot-oss | misc.lisp | ;; Copyright 2018-Present Modern Interpreters Inc.
;;
This Source Code Form is subject to the terms of the Mozilla Public
License , v. 2.0 . If a copy of the MPL was not distributed with this
file , You can obtain one at /.
(defpackage :util/misc
(:use #:cl)
(:export
#:funcall-if
#:?.
#:or-setf
#... | null | https://raw.githubusercontent.com/screenshotbot/screenshotbot-oss/740c8348176d71da0b5297a467b688d128e92877/src/util/misc.lisp | lisp | Copyright 2018-Present Modern Interpreters Inc.
The lock isn't doing much here though, the idea is just to
reduce the possibility of collisions.
If an error happens, the file-error-pathname is | This Source Code Form is subject to the terms of the Mozilla Public
License , v. 2.0 . If a copy of the MPL was not distributed with this
file , You can obtain one at /.
(defpackage :util/misc
(:use #:cl)
(:export
#:funcall-if
#:?.
#:or-setf
#:not-null!
#:uniq
#:safe-ensure-directories-exis... |
ec20e40d2cfbddb95feff5acb579d6c8f48f7dd712b9dfdd5b67b7b3b4f06cb4 | synduce/Synduce | contains.ml |
let xi_0 x11 x12 = x12 = x11
let xi_2 x13 x14 x15 x16 = ((x13 = x14) || x15) || x16
let xi_1 x17 = x17
let rec g =
function Leaf(a) -> xi_0 x a
| Node(a, l, r) -> x < a ? xi_1 (g l) : xi_2 x a (g l) (g r)
| null | https://raw.githubusercontent.com/synduce/Synduce/d453b04cfb507395908a270b1906f5ac34298d29/extras/solutions/constraints/bst/from_list/contains.ml | ocaml |
let xi_0 x11 x12 = x12 = x11
let xi_2 x13 x14 x15 x16 = ((x13 = x14) || x15) || x16
let xi_1 x17 = x17
let rec g =
function Leaf(a) -> xi_0 x a
| Node(a, l, r) -> x < a ? xi_1 (g l) : xi_2 x a (g l) (g r)
| |
059cbbdb663d5dc5fa03a558cf2778b4340899506918bf057df0e5602a72ceed | kappelmann/eidi2_repetitorium_tum | ha6_sol.ml | open Printf
open Batteries.List
open Ha6_angabe
open Batteries.Option
Eine Linse kann dazu verwendet werden , das Feld eines Records wie einen
. Sie bietet dazu eine Funktion zum Lesen und eine Funktion
zum Schreiben des jeweiligen Feldes an .
Wert herumzureichen. Sie bietet dazu eine Funktion zum Les... | null | https://raw.githubusercontent.com/kappelmann/eidi2_repetitorium_tum/1d16bbc498487a85960e0d83152249eb13944611/additional_exercises/2016_17/Blatt%206%20L%C3%B6sungen/ocaml/ha6_sol.ml | ocaml | Definiert eine Liste für den linken Teilbaum | open Printf
open Batteries.List
open Ha6_angabe
open Batteries.Option
Eine Linse kann dazu verwendet werden , das Feld eines Records wie einen
. Sie bietet dazu eine Funktion zum Lesen und eine Funktion
zum Schreiben des jeweiligen Feldes an .
Wert herumzureichen. Sie bietet dazu eine Funktion zum Les... |
fb79d6e55009023a9e4af42db371f7aded4faf194644c23bdd8237bcdf26d0b4 | chumsley/jwacs | test-shadow-values-transformation.lisp | ;;;; test-shadow-values-transformation.lisp
;;;
;;; Tests for the shadow-values transformation
;;;
Copyright ( c ) 2006
;;; See LICENSE for full licensing details.
;;;
(in-package :jw-tests)
(defnote shadow-values "Tests for the shadow-values transformation")
(deftest shadow-values/fn-decl/arguments-referenced/1 ... | null | https://raw.githubusercontent.com/chumsley/jwacs/c25adb3bb31fc2dc6e8c8a58346949ee400633d7/tests/test-shadow-values-transformation.lisp | lisp | test-shadow-values-transformation.lisp
Tests for the shadow-values transformation
See LICENSE for full licensing details.
")))
"))
")))
"))
")))
"))
")))
")) | Copyright ( c ) 2006
(in-package :jw-tests)
(defnote shadow-values "Tests for the shadow-values transformation")
(deftest shadow-values/fn-decl/arguments-referenced/1 :notes shadow-values
(with-fresh-genvar
(test-transform 'shadow-values (parse "
function foo(a, b)
{
if(arguments.length ... |
615136c9f3dace0b78aff3a187294f5bd3041bfbb3347090025a00eb520f6104 | tobbebex/GPipe-Core | PrimitiveStream.hs | # LANGUAGE CPP #
# LANGUAGE TypeFamilies , TypeSynonymInstances , FlexibleContexts , FlexibleInstances , ScopedTypeVariables , Arrows , , PatternSynonyms #
module Graphics.GPipe.Internal.PrimitiveStream where
import Control.Monad.Trans.Class
import Control.Monad.Trans.State.Strict
import Control.Monad.Trans.Reader
i... | null | https://raw.githubusercontent.com/tobbebex/GPipe-Core/4607e2c31d5beec30f2a918ab8ad48472ca236b7/GPipe-Core/src/Graphics/GPipe/Internal/PrimitiveStream.hs | haskell | You may also append 'PrimitiveStream's using the 'Monoid' instance, but if possible append the origin 'PrimitiveArray's instead, as this will create more optimized
draw calls.
| This class constraints which buffer types can be turned into vertex values, and what type those values have.
| The type the buffer val... | # LANGUAGE CPP #
# LANGUAGE TypeFamilies , TypeSynonymInstances , FlexibleContexts , FlexibleInstances , ScopedTypeVariables , Arrows , , PatternSynonyms #
module Graphics.GPipe.Internal.PrimitiveStream where
import Control.Monad.Trans.Class
import Control.Monad.Trans.State.Strict
import Control.Monad.Trans.Reader
i... |
f27f53670645bf8cdd73a5f01d599ffc046df86c46cda432018ce4b3c458ce25 | lemenkov/rtplib | rtcp_app_test.erl | %%%----------------------------------------------------------------------
Copyright ( c ) 2008 - 2012 < >
%%%
%%% All rights reserved.
%%%
%%% Redistribution and use in source and binary forms, with or without modification,
%%% are permitted provided that the following conditions are met:
%%%
%%% * Redistributions... | null | https://raw.githubusercontent.com/lemenkov/rtplib/b74a43b41fdb3dcdac6e33c5f2b9196780f7cbc8/test/rtcp_app_test.erl | erlang | ----------------------------------------------------------------------
All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice, this
... | Copyright ( c ) 2008 - 2012 < >
DISCLAIMED . IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY
DIRECT , INDIRECT , INCIDENTAL , SPECIAL , EXEMPLARY , OR CONSEQUENTIAL DAMAGES
( INCLUDING , BUT NOT LIMITED TO , PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES ;
ANY THEORY OF LIABILITY , WHETHER IN ... |
ab32304259bb5920cd112360165b10a411f42e2123400cc8ebd9f4f8944aa6ba | let-def/owee | owee_buf.mli | (** Low-level buffer manipulation library *)
type t =
(int, Bigarray.int8_unsigned_elt, Bigarray.c_layout) Bigarray.Array1.t
val map_binary : string -> t
Size of buffer remains int , because the size ( aka dim ) of
Bigarray . Array1 is int , not int64 . It should be enough in practice ,
as we will not ... | null | https://raw.githubusercontent.com/let-def/owee/4994a882bb4055dc4f6e59a7d01986caa2a8c37e/src/owee_buf.mli | ocaml | * Low-level buffer manipulation library
* Size of the buffer
* Minimal support for error reporting. FIXME: Improve that someday.
Some aliases to make more explicit the nature of values being read.
* A mutable cursor, pointing to an arbitrary position of a buffer
* [sub t len] returns a fresh cursor pointing to th... |
type t =
(int, Bigarray.int8_unsigned_elt, Bigarray.c_layout) Bigarray.Array1.t
val map_binary : string -> t
Size of buffer remains int , because the size ( aka dim ) of
Bigarray . Array1 is int , not int64 . It should be enough in practice ,
as we will not be able to manipulate larger binaries anyway ... |
7119748db6a93e6f0f5b28f2d2a27ecd1ca16860d6f71f01cc110baa21b88461 | brendanhay/terrafomo | DNSimple.hs | -- This module is auto-generated.
# OPTIONS_GHC -fno - warn - unused - imports #
# OPTIONS_GHC -fno - warn - dodgy - exports #
-- |
-- Module : Terrafomo.DNSimple
Copyright : ( c ) 2017 - 2018
License : Mozilla Public License , v. 2.0 .
Maintainer : < brendan.g.hay+ >
-- Stability : auto-... | null | https://raw.githubusercontent.com/brendanhay/terrafomo/387a0e9341fb9cd5543ef8332dea126f50f1070e/provider/terrafomo-dnsimple/gen/Terrafomo/DNSimple.hs | haskell | This module is auto-generated.
|
Module : Terrafomo.DNSimple
Stability : auto-generated
* Provider
* Types
* Resources |
# OPTIONS_GHC -fno - warn - unused - imports #
# OPTIONS_GHC -fno - warn - dodgy - exports #
Copyright : ( c ) 2017 - 2018
License : Mozilla Public License , v. 2.0 .
Maintainer : < brendan.g.hay+ >
Portability : non - portable ( GHC extensions )
module Terrafomo.DNSimple
(
module Te... |
b51bf831c3397cddc482a1d37f8bb2210399c01ccd643c1d668156eeb6243a06 | prg-titech/Kani-CUDA | main.rkt | #lang rosette
(require "../../lang.rkt"
"convo.rkt")
(define SIZEX 6)
(define SIZE (* SIZEX SIZEX))
(define KERNEL-RADIUS 2)
(define in-data (make-array (for/vector ([i SIZE]) (make-element i)) SIZE))
(define out-data (make-array (for/vector ([i SIZE]) (make-element 0)) SIZE))
(define d-kernel (make-array (... | null | https://raw.githubusercontent.com/prg-titech/Kani-CUDA/e97c4bede43a5fc4031a7d2cfc32d71b01ac26c4/Emulator/Examples/convolution/main.rkt | racket | #lang rosette
(require "../../lang.rkt"
"convo.rkt")
(define SIZEX 6)
(define SIZE (* SIZEX SIZEX))
(define KERNEL-RADIUS 2)
(define in-data (make-array (for/vector ([i SIZE]) (make-element i)) SIZE))
(define out-data (make-array (for/vector ([i SIZE]) (make-element 0)) SIZE))
(define d-kernel (make-array (... | |
890da3d5d0c505818dfd3ad62ef89b0b5301b8176572160500a6096e0a80807e | sile/taomp-sbcl | lockfree-exchanger.lisp | (defpackage lockfree-exchanger
(:use :common-lisp :util)
(:export make
exchange
object))
(in-package :lockfree-exchanger)
(eval-when (:compile-toplevel :load-toplevel)
(defconstant +EMPTY+ 0)
(defconstant +BUSY+ 1)
(defconstant +WAITING+ 2))
(defstruct object
(slot (asr:make nil +EM... | null | https://raw.githubusercontent.com/sile/taomp-sbcl/6216891346160e613fae3bb73491bc8c8fbad1c4/c11/lockfree-exchanger.lisp | lisp | (defpackage lockfree-exchanger
(:use :common-lisp :util)
(:export make
exchange
object))
(in-package :lockfree-exchanger)
(eval-when (:compile-toplevel :load-toplevel)
(defconstant +EMPTY+ 0)
(defconstant +BUSY+ 1)
(defconstant +WAITING+ 2))
(defstruct object
(slot (asr:make nil +EM... | |
0bbf90a7abbbf81807daa5c06cf7b6f90abe9c0155d91777f8228f863e1d26a2 | mcorbin/meuse | crate.clj | (ns meuse.api.meuse.crate
(:require [meuse.api.params :as params]
[meuse.auth.request :as auth-request]
[meuse.db.public.category :as public-category]
[meuse.db.public.crate :as public-crate]
[meuse.crate :refer [check]]
[meuse.log :as log]
[cloj... | null | https://raw.githubusercontent.com/mcorbin/meuse/d2b74543fce37c8cde770ae6f6097cabb509a804/src/meuse/api/meuse/crate.clj | clojure | (ns meuse.api.meuse.crate
(:require [meuse.api.params :as params]
[meuse.auth.request :as auth-request]
[meuse.db.public.category :as public-category]
[meuse.db.public.crate :as public-crate]
[meuse.crate :refer [check]]
[meuse.log :as log]
[cloj... | |
7395c05963cc5d1adbbf9324b39c0da8f0a2a090f2a3951eda2a16ea2e831bdb | bos/rwh | RegexExec.hs |
- snippet pcreexec -
foreign import ccall "pcre.h pcre_exec"
c_pcre_exec :: Ptr PCRE
-> Ptr PCREExtra
-> Ptr Word8
-> CInt
-> CInt
-> PCREExecOption
-> Ptr CInt
-> CInt
... | null | https://raw.githubusercontent.com/bos/rwh/7fd1e467d54aef832f5476ebf5f4f6a898a895d1/examples/ch17/RegexExec.hs | haskell | - snippet pcrefullinfo -
- /snippet pcrefullinfo -
- snippet captured -
- /snippet captured -
- snippet exectype -
- /snippet exectype -
- snippet matchtop -
- /snippet matchtop -
- snippet alloc -
- /snippet alloc -
- snippet results -
- /snippet results - |
- snippet pcreexec -
foreign import ccall "pcre.h pcre_exec"
c_pcre_exec :: Ptr PCRE
-> Ptr PCREExtra
-> Ptr Word8
-> CInt
-> CInt
-> PCREExecOption
-> Ptr CInt
-> CInt
... |
9c0aef6180c5461bc750a76a6d7ddac07b5b0695831a2075df034a6fba6c9e4c | jordanthayer/ocaml-search | tsp_optimistic_algs.ml | open Tsp_instances
open Tsp
open Tsp_algs
let make_wt c agg =
(c -. 1.) *. agg +. 1.
let aggressive_global c p lim =
unwrap_results (Clamped_aggressive.aggressive_global ~limit:lim
(Tsp.make_initial p.dists p.symmetric)
Tsp.goal_p
(Tsp.make_hd p.dists p.symmetric)
(Tsp.make_expand p.dists p.symmetric)
(... | null | https://raw.githubusercontent.com/jordanthayer/ocaml-search/57cfc85417aa97ee5d8fbcdb84c333aae148175f/tsp/tsp_optimistic_algs.ml | ocaml | * anytime A* * | open Tsp_instances
open Tsp
open Tsp_algs
let make_wt c agg =
(c -. 1.) *. agg +. 1.
let aggressive_global c p lim =
unwrap_results (Clamped_aggressive.aggressive_global ~limit:lim
(Tsp.make_initial p.dists p.symmetric)
Tsp.goal_p
(Tsp.make_hd p.dists p.symmetric)
(Tsp.make_expand p.dists p.symmetric)
(... |
45400c5d39a6af89d37a4ceb979bc12df1a2fe9731174402f35d6d3d01dd7858 | oscoin/oscoin | Handlers.hs | module Oscoin.API.HTTP.Handlers where
import Oscoin.Prelude
import Oscoin.API.HTTP.Internal
import Oscoin.API.Types
import Oscoin.Crypto.Blockchain (Height)
import Oscoin.Crypto.Blockchain.Block (BlockHash, SealedBlock)
import Oscoin.Crypto.Hash (hash)
impor... | null | https://raw.githubusercontent.com/oscoin/oscoin/2eb5652c9999dd0f30c70b3ba6b638156c74cdb1/src/Oscoin/API/HTTP/Handlers.hs | haskell | module Oscoin.API.HTTP.Handlers where
import Oscoin.Prelude
import Oscoin.API.HTTP.Internal
import Oscoin.API.Types
import Oscoin.Crypto.Blockchain (Height)
import Oscoin.Crypto.Blockchain.Block (BlockHash, SealedBlock)
import Oscoin.Crypto.Hash (hash)
impor... | |
0a55740c690a42ffb4ee1fc3185155149630ae0c43a7e002edbae8830ed313bf | helmutkian/cl-wasm-runtime | early-exit-example.lisp | (defvar *early-exit-wat*
"(module
(type $run_t (func (param i32 i32) (result i32)))
(type $early_exit_t (func (param) (result)))
(import \"env\" \"early_exit\" (func $early_exit (type $early_exit_t)))
(func $run (type $run_t) (param $x i32) (param $y i32) (result i32)
(call $early_exit)
... | null | https://raw.githubusercontent.com/helmutkian/cl-wasm-runtime/e6449be71ccf35c56b972f8ffa30d4f823bb1572/examples/early-exit-example.lisp | lisp | (defvar *early-exit-wat*
"(module
(type $run_t (func (param i32 i32) (result i32)))
(type $early_exit_t (func (param) (result)))
(import \"env\" \"early_exit\" (func $early_exit (type $early_exit_t)))
(func $run (type $run_t) (param $x i32) (param $y i32) (result i32)
(call $early_exit)
... | |
cb1d835799d87ddef1e115be1237e91b958a5e08cd5081f279453e6f591e0a18 | dmbaturin/otoml | testsuite_client_decoder.ml | This is a client executable for the -test TOML test suite .
Compile with : otoml , zarith , decimal , / testsuite_client_decoder.ml -o decoder
Compile with: ocamlfind ocamlopt -package otoml,zarith,decimal,yojson -linkpkg ./examples/testsuite_client_decoder.ml -o decoder
*)
No signature ascrip... | null | https://raw.githubusercontent.com/dmbaturin/otoml/4746a8cd483d6b1b1edfadef848b7373f3212897/examples/testsuite_client_decoder.ml | ocaml | Can't just reuse Decimal.to/of_string because their optional arguments
would cause a signature mismatch.
Not actually needed here since the testsuite runner
expects arrays and tables to become normal JSON lists and objects. | This is a client executable for the -test TOML test suite .
Compile with : otoml , zarith , decimal , / testsuite_client_decoder.ml -o decoder
Compile with: ocamlfind ocamlopt -package otoml,zarith,decimal,yojson -linkpkg ./examples/testsuite_client_decoder.ml -o decoder
*)
No signature ascrip... |
e3b7153cd2ebbe2c083590b1cb092dda9f66a03c629cf51eadd5e3642c8c5e2c | binsec/binsec | disasm_core.ml | (**************************************************************************)
This file is part of BINSEC .
(* *)
Copyright ( C ) 2016 - 2022
CEA ( Co... | null | https://raw.githubusercontent.com/binsec/binsec/22ee39aad58219e8837b6ba15f150ba04a498b63/src/disasm/disasm_core.ml | ocaml | ************************************************************************
alternatives)
you can redistribute it an... | This file is part of BINSEC .
Copyright ( C ) 2016 - 2022
CEA ( Commissariat à l'énergie atomique et aux énergies
Lesser General Public License as published by the Free Software
Foundation , ve... |
cdf04c995c4f41d89cf91891a1832396da2da30d34604ba4eb394a0ae7aef74c | janestreet/async_unix | unix_syscalls.mli | * [ Unix_syscalls ] provides an interface to many of the functions in 's standard
Unix module . It uses a deferred in the return type of functions that would block .
The idea is that in an Async program one does not use the standard Unix module , since
in doing so one could accidentally block the w... | null | https://raw.githubusercontent.com/janestreet/async_unix/e5d9e9d388a23237cec3bf42d7e310c459de4309/src/unix_syscalls.mli | ocaml | * [this_process_became_child_of_init] returns a deferred that becomes determined when
the current process becomes a child of [init(8)]. This is useful for determining
whether one's parent has died, because in that case [init] will become one's parent.
See [Linux_ext.pr_set_pdeathsig : Signal.t -> unit] fo... | * [ Unix_syscalls ] provides an interface to many of the functions in 's standard
Unix module . It uses a deferred in the return type of functions that would block .
The idea is that in an Async program one does not use the standard Unix module , since
in doing so one could accidentally block the w... |
50e616f9099d7d1849af1dde354054e55dd70fd718ae21adcfdfb58fc5cbb15d | returntocorp/semgrep | Hybrid_print.ml |
*
* Copyright ( C ) 2019 - 2022 r2c
*
* This library is free software ; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public License
* version 2.1 as published by the Free Software Foundation , with the
* special exception on linking described in file LICE... | null | https://raw.githubusercontent.com/returntocorp/semgrep/660ad4af824f84fd2d11f89e831495642792c191/src/fixing/Hybrid_print.ml | ocaml | ***************************************************************************
Prelude
***************************************************************************
***************************************************************************
Types
**************************************************************************... |
*
* Copyright ( C ) 2019 - 2022 r2c
*
* This library is free software ; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public License
* version 2.1 as published by the Free Software Foundation , with the
* special exception on linking described in file LICE... |
fb6288a83795f98f86fd9e03a7451f703b8b7e3e8deb1244c7058897791786a9 | unsplash/intlc | Prettify.hs | module Intlc.Prettify (prettify) where
import Intlc.Backend.ICU.Compiler (Formatting (..), compileMsg)
import qualified Intlc.ICU as ICU
import Intlc.Printer (IndentStyle)
import Prelude
prettify :: IndentStyle -> ICU.Message ICU.Node -> Text
prettify = comp... | null | https://raw.githubusercontent.com/unsplash/intlc/84b8cbceaa27abfd753abb647c3686231a24a495/lib/Intlc/Prettify.hs | haskell | module Intlc.Prettify (prettify) where
import Intlc.Backend.ICU.Compiler (Formatting (..), compileMsg)
import qualified Intlc.ICU as ICU
import Intlc.Printer (IndentStyle)
import Prelude
prettify :: IndentStyle -> ICU.Message ICU.Node -> Text
prettify = comp... | |
b083db3e52d5734071de909b773cf1bb9f8d44c987ed921e147bf0d877645a2f | erlangonrails/devdb | riak_kv_delete.erl | %% -------------------------------------------------------------------
%%
riak_delete : two - step object deletion
%%
Copyright ( c ) 2007 - 2010 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
... | null | https://raw.githubusercontent.com/erlangonrails/devdb/0e7eaa6bd810ec3892bfc3d933439560620d0941/dev/riak-0.11.0/apps/riak_kv/src/riak_kv_delete.erl | erlang | -------------------------------------------------------------------
Version 2.0 (the "License"); you may not use this file
a copy of the License at
-2.0
Unless required by applicable law or agreed to in writing,
KIND, either express or implied. See the License for the
specific language governing permissi... | riak_delete : two - step object deletion
Copyright ( c ) 2007 - 2010 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 ... |
5f39408a01a973f547d736726d8a0b386b733c185cf37934dc691a87bd237185 | patoline/patoline | Color.ml | type rgb =
{ red : float
; green : float
; blue : float
; alpha : float }
type color =
| RGB of rgb
Produce a color from RGB values between 0.0 and 1.0 .
let rgb red green blue = RGB { red ; green ; blue ; alpha = 1.0 }
Produce a color from RGBA values between 0.0 and 1.0 .
let rgba red green blue a... | null | https://raw.githubusercontent.com/patoline/patoline/3dcd41fdff64895d795d4a78baa27d572b161081/patoraw/Color.ml | ocaml | Read a color from a string with the format "#RRGGBB" in hexadecimal.
Sets the alpha channel of a color.
Get the alpha channel of a color.
Get the RGBA value of a color.
Some predifined colors. | type rgb =
{ red : float
; green : float
; blue : float
; alpha : float }
type color =
| RGB of rgb
Produce a color from RGB values between 0.0 and 1.0 .
let rgb red green blue = RGB { red ; green ; blue ; alpha = 1.0 }
Produce a color from RGBA values between 0.0 and 1.0 .
let rgba red green blue a... |
c9105b03fad3d14f6427329262d76e23f3282d26b1c9079270b44ee90197542b | rmloveland/scheme48-0.53 | display.scm | Copyright ( c ) 1994 by . See file COPYING .
; Data must be done last as it may contain references to the other stuff.
(define (display-forms-as-scheme forms out)
(receive (data other)
(partition-list (lambda (f)
(and (node? (form-value f))
(literal-node? (form-value f))))
forms)
... | null | https://raw.githubusercontent.com/rmloveland/scheme48-0.53/1ae4531fac7150bd2af42d124da9b50dd1b89ec1/ps-compiler/prescheme/display.scm | scheme | Data must be done last as it may contain references to the other stuff.
Rename things that have differ in Scheme and Pre-Scheme
Used for primitives in non-call position. The CDR of the form is a
variable that will be bound to the primitive's closed-compiled value.
non-call position
lambda, let-syntax, letrec-syn... | Copyright ( c ) 1994 by . See file COPYING .
(define (display-forms-as-scheme forms out)
(receive (data other)
(partition-list (lambda (f)
(and (node? (form-value f))
(literal-node? (form-value f))))
forms)
(for-each (lambda (f)
(display-form-as-scheme f (schemify (form-value f... |
6a38f5e0d19315b41a10f70d1f6e6b570614eb8176696d57b1238ab0d25496c8 | 3b/cl-opengl | interface.lisp | ;;; -*- Mode: Lisp; indent-tabs-mode: nil -*-
;;;
interface.lisp --- CLOS interface to the GLUT API .
;;;
Copyright ( c ) 2006 ,
;;; All rights reserved.
;;;
;;; Redistribution and use in source and binary forms, with or without
;;; modification, are permitted provided that the following conditions
;;; are m... | null | https://raw.githubusercontent.com/3b/cl-opengl/e2d83e0977b7e7ac3f3d348d8ccc7ccd04e74d59/glut/interface.lisp | lisp | -*- Mode: Lisp; indent-tabs-mode: nil -*-
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
o Redistributions of source code must retain the above copyright
notice, this list of conditions ... | interface.lisp --- CLOS interface to the GLUT API .
Copyright ( c ) 2006 ,
" AS IS " AND ANY EXPRESS OR IMPLIED WARRANTIES , INCLUDING , BUT NOT
OWNER OR ANY DIRECT , INDIRECT , INCIDENTAL ,
SPECIAL , EXEMPLARY , OR CONSEQUENTIAL DAMAGES ( INCLUDING , BUT NOT
THEORY OF LIABILITY , WHETHER IN CONTRA... |
26cc902baca3e23fa050fe206e1ac95f4ddc20d7b8e723df6e1254e8d43b43f0 | stevenvar/OMicroB | point.ml | class point (x:int) (y:int) =
object (self)
val mutable x = x
val mutable y = y
method get_x () = x
method get_y () = y
end
(* class bidule =
* object (self)
* end *)
(* let _ = *)
let b = new bidule in b
let _ =
let p1 = new point 3 4 in
p1#get_x
| null | https://raw.githubusercontent.com/stevenvar/OMicroB/e4324d0736ac677b3086741dfdefb0e46775642b/benchs/object/point.ml | ocaml | class bidule =
* object (self)
* end
let _ = | class point (x:int) (y:int) =
object (self)
val mutable x = x
val mutable y = y
method get_x () = x
method get_y () = y
end
let b = new bidule in b
let _ =
let p1 = new point 3 4 in
p1#get_x
|
7df4347f020e025ea6bb307d3b6a7af5a6ac9f06b939dfe13a4b6ae0d4de68ac | helium/router | router_no_channel.erl | %%%-------------------------------------------------------------------
%% @doc
%% == Router no Channel ==
%%
Reports packets to Console when no integrations
%% are configured for a device.
%%
%% @end
%%%-------------------------------------------------------------------
-module(router_no_channel).
-behaviour(gen_eve... | null | https://raw.githubusercontent.com/helium/router/ea330d2e3d32e2b4e45881203fad61a3428a2375/src/channels/router_no_channel.erl | erlang | -------------------------------------------------------------------
@doc
== Router no Channel ==
are configured for a device.
@end
-------------------------------------------------------------------
------------------------------------------------------------------
gen_event Function Exports
------------------... | Reports packets to Console when no integrations
-module(router_no_channel).
-behaviour(gen_event).
-export([
init/1,
handle_event/2,
handle_call/2,
handle_info/2,
terminate/2,
code_change/3
]).
-record(state, {channel :: router_channel:channel()}).
gen_server Function Definitions
init({[... |
e4043045d726acc36d1e211c37dfa5cd0e823b30d91639560861feb49ed98c9d | Vetd-Inc/vetd-app | stack_detail.cljs | (ns vetd-app.buyers.pages.stack-detail
(:require [vetd-app.buyers.components :as bc]
[vetd-app.common.components :as cc]
[vetd-app.ui :as ui]
[vetd-app.util :as util]
[vetd-app.docs :as docs]
[reagent.core :as r]
[re-frame.core :as rf]
... | null | https://raw.githubusercontent.com/Vetd-Inc/vetd-app/9b33b1443b9d84d39305a63fc58119f8e014cf11/src/cljs/app/vetd_app/buyers/pages/stack_detail.cljs | clojure | Subscriptions
Events
Components
TODO infinite scroll | (ns vetd-app.buyers.pages.stack-detail
(:require [vetd-app.buyers.components :as bc]
[vetd-app.common.components :as cc]
[vetd-app.ui :as ui]
[vetd-app.util :as util]
[vetd-app.docs :as docs]
[reagent.core :as r]
[re-frame.core :as rf]
... |
eabdba6355557a903af998416f095c4ab1a3cd524adae769d1c773eb2790a0f6 | mbenke/zpf2013 | PlusMinus2c.hs | import MyParsec2c
import Data.Char(digitToInt)
import Criterion.Main
gen 0 = "1"
gen n = ('1':'+':'1':'-':gen (n-1))
pNum :: Parser Int
pNum = fmap digitToInt digit
pExp = pNum `chainl1` addop
addop = do{ char '+'; return (+) }
<|> do{ char '-'; return (-) }
test n = parse pExp "gen" (gen n)
main = ... | null | https://raw.githubusercontent.com/mbenke/zpf2013/85f32747e17f07a74e1c3cb064b1d6acaca3f2f0/Code/Parse1/PlusMinus2c.hs | haskell | import MyParsec2c
import Data.Char(digitToInt)
import Criterion.Main
gen 0 = "1"
gen n = ('1':'+':'1':'-':gen (n-1))
pNum :: Parser Int
pNum = fmap digitToInt digit
pExp = pNum `chainl1` addop
addop = do{ char '+'; return (+) }
<|> do{ char '-'; return (-) }
test n = parse pExp "gen" (gen n)
main = ... | |
4b39d5f0743c4ffb4ad08a0a33f3a4c9e2da4b393431fc33d9379af493d699fe | goldfirere/video-resources | Prelim.hs | {- *********************************************************************
* *
Preliminaries
* *
********************************************************************... | null | https://raw.githubusercontent.com/goldfirere/video-resources/083a657022bbf009d0ae98f24656a36306ea156a/2021-06-01-plugins/Prelim.hs | haskell | *********************************************************************
* *
Preliminaries
* *
********************************************************************* ... |
# LANGUAGE TypeOperators , TypeFamilies , StandaloneKindSignatures ,
DataKinds #
DataKinds #-}
module Prelim
( Ty
, Nat(..), type (+), type (-)
) where
import qualified Data.Kind as Kind
import Data.Type.Equality ( (:~:)(..) )
import Unsafe.Coerce ( unsafeCoerce )
type Ty = Kind.Ty... |
74384b6fe4074b51ddeff6ae570d4081c444dadf44238d10f78c86f028d9b5c9 | spurious/sagittarius-scheme-mirror | txpath-parser.scm | -*- mode : scheme ; coding : utf-8 -*-
#!nobacktrace
(library (text sxml txpath-parser)
(export txp:param-value
txp:parameterize-parser
txp:resolve-ns-prefix
sxml:parse-number
sxml:parse-literal
sxml:parse-natural
sxml:parse-qname
sxml:parse-name
sxml:parse-ncname
sxml... | null | https://raw.githubusercontent.com/spurious/sagittarius-scheme-mirror/53f104188934109227c01b1e9a9af5312f9ce997/sitelib/text/sxml/txpath-parser.scm | scheme | coding : utf-8 -*-
This software is in Public Domain.
Please send bug reports and comments to:
Dmitry Lizorkin
=========================================================================
be parameterized
txp-param ::= (list param-name param-value [parameterized-func] )
parameterized-func is optional
... | #!nobacktrace
(library (text sxml txpath-parser)
(export txp:param-value
txp:parameterize-parser
txp:resolve-ns-prefix
sxml:parse-number
sxml:parse-literal
sxml:parse-natural
sxml:parse-qname
sxml:parse-name
sxml:parse-ncname
sxml:parse-assert
sxml:parse-check-seque... |
26aa19ef64c0438167b396a9686a4789188b29315f2a1c0877d4854b1c52054b | lesguillemets/sicp-haskell | 2.2.2.hs | module HierarchicalStructures where
data TList a = Nil | Cons (TList a) (TList a) | V a deriving (Show)
We should probably doing this with Cons [ TList a ] | V a
-- Note that his allows lists that does not terminate with Nil, like
Cons ( V 2 ) ( V 1 )
list :: [TList a] -> TList a
list = foldr Cons Nil
fromList ::... | null | https://raw.githubusercontent.com/lesguillemets/sicp-haskell/df524a1e28c45fb16a56f539cad8babc881d0431/text/chap02/sect2/2.2.2.hs | haskell | Note that his allows lists that does not terminate with Nil, like
|
|
>>> l | module HierarchicalStructures where
data TList a = Nil | Cons (TList a) (TList a) | V a deriving (Show)
We should probably doing this with Cons [ TList a ] | V a
Cons ( V 2 ) ( V 1 )
list :: [TList a] -> TList a
list = foldr Cons Nil
fromList :: [a] -> TList a
fromList = list . map V
car :: TList a -> TList a
ca... |
62052f34da343fa81a5f1e0b20e7307e25864b60211477d969148a4c27e925b1 | facebookarchive/duckling_old | finance.clj | (
{}
"$10"
"10$"
"dez dolares"
(money 10 "$")
"$10.000"
"10K$"
"$10k"
(money 10000 "$")
"USD1,23"
(money 1.23 "USD")
"20€"
"20 euros"
"20 Euro"
"20 Euros"
"EUR 20"
(money 20 "EUR")
"EUR29,99"
(money 29.99 "EUR")
"3 balles"
(money 3) ; unknown unit
"£9"
"nove libras"
(money 9 "£")
"GBP3,01"
"GBP 3,01"
(money 3.... | null | https://raw.githubusercontent.com/facebookarchive/duckling_old/bf5bb9758c36313b56e136a28ba401696eeff10b/resources/languages/pt/corpus/finance.clj | clojure | unknown unit | (
{}
"$10"
"10$"
"dez dolares"
(money 10 "$")
"$10.000"
"10K$"
"$10k"
(money 10000 "$")
"USD1,23"
(money 1.23 "USD")
"20€"
"20 euros"
"20 Euro"
"20 Euros"
"EUR 20"
(money 20 "EUR")
"EUR29,99"
(money 29.99 "EUR")
"3 balles"
"£9"
"nove libras"
(money 9 "£")
"GBP3,01"
"GBP 3,01"
(money 3.01 "GBP")
"15 Pt"
"15pta... |
aefa479efbcd7057cc7b9b0c88f722f9c33a624294274fb1f098b2caed75d933 | GaloisInc/ivory | String.hs | {-# LANGUAGE OverloadedStrings #-}
# LANGUAGE DataKinds #
# LANGUAGE TypeOperators #
module String where
import Ivory.Language
import Ivory.Compile.C.CmdlineFrontend
printf :: Def ('[IString] ':-> Sint32)
printf = importProc "printf" "stdio.h"
printf2 :: Def ('[IString,Sint32] ':-> Sint32)
printf2 = importProc "p... | null | https://raw.githubusercontent.com/GaloisInc/ivory/53a0795b4fbeb0b7da0f6cdaccdde18849a78cd6/ivory-examples/examples/String.hs | haskell | # LANGUAGE OverloadedStrings # | # LANGUAGE DataKinds #
# LANGUAGE TypeOperators #
module String where
import Ivory.Language
import Ivory.Compile.C.CmdlineFrontend
printf :: Def ('[IString] ':-> Sint32)
printf = importProc "printf" "stdio.h"
printf2 :: Def ('[IString,Sint32] ':-> Sint32)
printf2 = importProc "printf" "stdio.h"
test :: Def ('[] ... |
a03c232c9bdea5e9d4972025683e0456ddb5a95f01a6a8e026b9896c6e5094fa | perttikellomaki/psd | instrum.scm | ;;;;
$ I d : instrum.scm , v 1.7 1993/10/04 13:43:33 pk Exp $
;;;;
psd -- a portable Scheme debugger , version 1.1
Copyright ( C ) 1992 Pertti Kellomaki ,
Written by ,
;;;; This file contains the actual instrumentation code. For each
;;;; syntactic form X to be instrumented, there is a corresponding
;;;... | null | https://raw.githubusercontent.com/perttikellomaki/psd/965fdb7fc9cb0025c1f3a87435d21c832c085bb6/instrum.scm | scheme |
This file contains the actual instrumentation code. For each
syntactic form X to be instrumented, there is a corresponding
procedure instrument-X. In addition, there are a few helpful
procedures for instrumenting expression sequences etc. The
normal car, cdr etc., but they operate on pexps, which are sexps
wit... | $ I d : instrum.scm , v 1.7 1993/10/04 13:43:33 pk Exp $
psd -- a portable Scheme debugger , version 1.1
Copyright ( C ) 1992 Pertti Kellomaki ,
Written by ,
procedures psd - car , etc . that are used here work just like
instrument - expr now handles the first expression of a procedure body
spec... |
6aed8c16ab02c4f2a5470e4df54bf7ec3b93b8028cc9434822bbc3e938e4d37f | royneary/mod_push | mod_push_gcm.erl | %%%----------------------------------------------------------------------
File :
Author : < >
%%% Purpose : Send push notifications to the Google Cloud Messaging service
Created : 01 Jun 2015 by < >
%%%
%%%
Copyright ( C ) 2015
%%%
%%% This program is free software; you can redistribute it and/... | null | https://raw.githubusercontent.com/royneary/mod_push/d43e9c6efd6a9f5eda691ca4aac0577eeb6413e3/src/mod_push_gcm.erl | erlang | ----------------------------------------------------------------------
Purpose : Send push notifications to the Google Cloud Messaging service
This program is free software; you can redistribute it and/or
License, or (at your option) any later version.
This program is distributed in the hope that it will be use... | File :
Author : < >
Created : 01 Jun 2015 by < >
Copyright ( C ) 2015
modify it under the terms of the GNU General Public License as
published by the Free Software Foundation ; either version 2 of the
You should have received a copy of the GNU General Public License along
with this prog... |
36f05ca3189837568719f9fedd1dcf388b157316af9fcd1ddaa1e261f5598413 | fulcro-legacy/fulcro-datomic | generate_schema_spec.clj | (ns fulcro.datomic.schema.generate-schema-spec
(:require
[fulcro.datomic.schema :as schema]
[fulcro-spec.core :refer [specification assertions when-mocking component behavior]]
[fulcro.datomic.test-helpers :refer [with-db-fixture]]
[resources.datomic-schema.validation-schema.initial]
[resources.da... | null | https://raw.githubusercontent.com/fulcro-legacy/fulcro-datomic/262fb629fc250a8675afacf7b16ac876d47cb597/specs/fulcro/datomic/schema/generate_schema_spec.clj | clojure | (ns fulcro.datomic.schema.generate-schema-spec
(:require
[fulcro.datomic.schema :as schema]
[fulcro-spec.core :refer [specification assertions when-mocking component behavior]]
[fulcro.datomic.test-helpers :refer [with-db-fixture]]
[resources.datomic-schema.validation-schema.initial]
[resources.da... | |
40983f5b73863711bf0ddb13cb581a9ce654b9bf23af9157aa6e6dc85140ea44 | glguy/advent | 03.hs | {-# Language QuasiQuotes, ImportQualifiedPost #-}
|
Module : Main
Description : Day 3 solution
Copyright : ( c ) , 2018
License : ISC
Maintainer :
< >
Given a bunch of 2D regions find regions that do and do not overlap .
Module : Main
Description : Day 3 solution
Copyright ... | null | https://raw.githubusercontent.com/glguy/advent/b661d31c9578de03a72248112581287c5177c7b8/solutions/src/2018/03.hs | haskell | # Language QuasiQuotes, ImportQualifiedPost #
>>> :main
| Determine identifier of patch with no overlaps. | |
Module : Main
Description : Day 3 solution
Copyright : ( c ) , 2018
License : ISC
Maintainer :
< >
Given a bunch of 2D regions find regions that do and do not overlap .
Module : Main
Description : Day 3 solution
Copyright : (c) Eric Mertens, 2018
License : ISC
Maintai... |
5363af36133a9d87ae556f59bebf3f9de9a9af7c62072db66c84833ea22c5532 | bnoordhuis/chicken-core | compiler-syntax.scm | ;;;; compiler-syntax.scm - compiler syntax used internally
;
Copyright ( c ) 2009 - 2013 , The Chicken Team
; All rights reserved.
;
; Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following
; conditions are met:
;
; Redistributions of source code m... | null | https://raw.githubusercontent.com/bnoordhuis/chicken-core/56d30e3be095b6abe1bddcfe10505fa726a43bb5/compiler-syntax.scm | scheme | compiler-syntax.scm - compiler syntax used internally
All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following
conditions are met:
Redistributions of source code must retain the above copyright notice, this list of conditio... | Copyright ( c ) 2009 - 2013 , The Chicken Team
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS " AS IS " AND ANY EXPRESS
CONTRIBUTORS BE LIABLE FOR ANY DIRECT , INDIRECT , INCIDENTAL , SPECIAL , EXEMPLARY , OR
CONSEQUENTIAL DAMAGES ( INCLUDING , BUT NOT LIMITED TO , PROCUREMENT OF SUBSTITUTE... |
0622a71033c35ce7dcd96e4c6fd15cd1fdf586591a8442f54cd4969c999294f9 | myme/nixon | Fzf.hs | {-# OPTIONS_GHC -Wno-unrecognised-pragmas #-}
{-# HLINT ignore "Monoid law, right identity" #-}
{-# HLINT ignore "Monoid law, left identity" #-}
module Test.Nixon.Backend.Fzf where
import Data.Functor ((<&>))
import qualified Data.Text as T
import Nixon.Backend.Fzf (fzf, fzfExpect, fzfFilter, fzfProjects)
import qua... | null | https://raw.githubusercontent.com/myme/nixon/2c56086981ee0c0ad2d96eb5c7e478bb8c835426/test/Test/Nixon/Backend/Fzf.hs | haskell | # OPTIONS_GHC -Wno-unrecognised-pragmas #
# HLINT ignore "Monoid law, right identity" #
# HLINT ignore "Monoid law, left identity" # |
module Test.Nixon.Backend.Fzf where
import Data.Functor ((<&>))
import qualified Data.Text as T
import Nixon.Backend.Fzf (fzf, fzfExpect, fzfFilter, fzfProjects)
import qualified Nixon.Backend.Fzf as Fzf
import qualified Nixon.Command as Cmd
import Nixon.Prelude
import Nixon.Project (Project (..))
import Nixon.Selec... |
8122712d4e11e9af0d0eb22af982e8a7f394848ffd5733e6f480d27379678933 | Glue42/gateway-modules | t_factories.cljc | ;(ns gateway.domains.activity.t-factories)
(ns gateway.domains.activity.t-factories
(:require [clojure.test :refer :all]
[gateway.domains.activity.util :refer :all]
#?(:cljs [gateway.t-macros :refer-macros [spec-valid? just? error-msg?]])
#?(:clj [gateway.t-macros :refer [spec-val... | null | https://raw.githubusercontent.com/Glue42/gateway-modules/13bea1622bac9bd22a4fccb5ef4380a50d19fff3/activity-domain/test/gateway/domains/activity/t_factories.cljc | clojure | (ns gateway.domains.activity.t-factories)
(-> ready-state
(ready source {:peer_id created-id}))))) | (ns gateway.domains.activity.t-factories
(:require [clojure.test :refer :all]
[gateway.domains.activity.util :refer :all]
#?(:cljs [gateway.t-macros :refer-macros [spec-valid? just? error-msg?]])
#?(:clj [gateway.t-macros :refer [spec-valid? just? error-msg?]])
[gatew... |
cdf2b9062ea02f283f00a6fb5b314cd80e3f3dc0a96f0af0c94e0a6ea16c846b | janestreet/merlin-jst | issue864.ml | module X = struct
type t = { z : int }
end
let f1 _ (x : X.t) = x.z
let f2 (z : string) (x : X.t) = x.X.z
let f3 (z : string) (x : X.t) = x.z
| null | https://raw.githubusercontent.com/janestreet/merlin-jst/0152b4e8ef1b7cd0ddee2873aa1860a971585391/tests/test-dirs/type-enclosing/issue864.t/issue864.ml | ocaml | module X = struct
type t = { z : int }
end
let f1 _ (x : X.t) = x.z
let f2 (z : string) (x : X.t) = x.X.z
let f3 (z : string) (x : X.t) = x.z
| |
b423d6b16bf334eda03756c24c2e40d7e93f77d338aaf063e3b76d0f59113730 | racket/gui | wxitem.rkt | (module wxitem racket/base
(require racket/class
racket/function
(prefix-in wx: "kernel.rkt")
"lock.rkt"
"helper.rkt"
"const.rkt"
"wx.rkt"
"check.rkt"
"wxwindow.rkt")
(provide (protect-out make-item%
mak... | null | https://raw.githubusercontent.com/racket/gui/a6a87f7db0ceff5a6eb92ca3ffb68df4b743219e/gui-lib/mred/private/wxitem.rkt | racket | make-item%: creates items which are suitable for placing into
containers.
input: item%: a wx:item% descendant (but see below) from which the
new class will be derived.
stretch-x/stretch-y: booleans which specify the default
stretchability behavior for the new class.
returns: a class, de... | (module wxitem racket/base
(require racket/class
racket/function
(prefix-in wx: "kernel.rkt")
"lock.rkt"
"helper.rkt"
"const.rkt"
"wx.rkt"
"check.rkt"
"wxwindow.rkt")
(provide (protect-out make-item%
mak... |
5ce8446364885d16e03e0e569bb019bd6759c83448f20ea92985ff18b6dfade5 | OCamlPro/operf-macro | generate_table.ml | (* run with "ocaml generate_table.ml > t_table.ml" to update the tables *)
let () =
try Topdirs.dir_directory (Sys.getenv "OCAML_TOPLEVEL_PATH")
with Not_found -> ()
;;
#use "topfind";;
#require "gsl";;
let rec interval i j =
if i > j then []
else i :: (interval (i+1) j)
let probas =
[| 0.75; 0.80; 0.85; ... | null | https://raw.githubusercontent.com/OCamlPro/operf-macro/0701292ef2a77bb8e151e804fd25899e3403fbb9/lib/generate_table.ml | ocaml | run with "ocaml generate_table.ml > t_table.ml" to update the tables |
let () =
try Topdirs.dir_directory (Sys.getenv "OCAML_TOPLEVEL_PATH")
with Not_found -> ()
;;
#use "topfind";;
#require "gsl";;
let rec interval i j =
if i > j then []
else i :: (interval (i+1) j)
let probas =
[| 0.75; 0.80; 0.85; 0.90; 0.95; 0.975; 0.99; 0.995; 0.999 |]
let values = Array.of_list (inter... |
93cd1b609cc7dccea9d0c22cd7e6efe136d026aecf6f4b2a20a30423bda3ed82 | YoshikuniJujo/test_haskell | TryPango.hs | # , LambdaCase #
# LANGUAGE TypeApplications #
# LANGUAGE ViewPatterns #
# OPTIONS_GHC -Wall -fno - warn - tabs #
module Trial.TryPango where
import Foreign.C.Types
import Control.Arrow
import Control.Monad.Primitive
import Control.Monad.ST
import Data.Foldable
import Data.Color
import Data.CairoContext
import Gra... | null | https://raw.githubusercontent.com/YoshikuniJujo/test_haskell/065b4a2fd1dd0a570275f3c749bbd96189dd03d4/themes/gui/cairo/try-image-data/src/Trial/TryPango.hs | haskell | # , LambdaCase #
# LANGUAGE TypeApplications #
# LANGUAGE ViewPatterns #
# OPTIONS_GHC -Wall -fno - warn - tabs #
module Trial.TryPango where
import Foreign.C.Types
import Control.Arrow
import Control.Monad.Primitive
import Control.Monad.ST
import Data.Foldable
import Data.Color
import Data.CairoContext
import Gra... | |
ab8b0ffad045bcd2edad19f5dd614d3736a787aaf33f6969d52162d064ae7bba | arenadotio/pgx | row_desc.ml | open Sexplib0.Sexp_conv
type t =
{ name : string
; table : int32
; col : int
; oid : int32
; len : int
; modifier : int32
; format : int
}
[@@deriving sexp]
| null | https://raw.githubusercontent.com/arenadotio/pgx/8d5ca02213faa69e692c5d0dc3e81408db3774a1/pgx/src/row_desc.ml | ocaml | open Sexplib0.Sexp_conv
type t =
{ name : string
; table : int32
; col : int
; oid : int32
; len : int
; modifier : int32
; format : int
}
[@@deriving sexp]
| |
f867bfb16082b56ab703812dd7ac61394157e6b4a67903712068ee5843ae4c13 | dhess/sicp-solutions | ex2.49.scm | Requires the PLT DrScheme graphical environment . Set the language
;;; to "Module".
#lang scheme
(require (planet "sicp.ss" ("soegaard" "sicp.plt" 2 1)))
(define nil '())
;;; Coordinates of the unit frame. Note that the right- and upper-most
;;; coordinates are slightly less than 1 because sicp.plt doesn't
;;; alwa... | null | https://raw.githubusercontent.com/dhess/sicp-solutions/2cf78db98917e9cb1252efda76fddc8e45fe4140/chap2/ex2.49.scm | scheme | to "Module".
Coordinates of the unit frame. Note that the right- and upper-most
coordinates are slightly less than 1 because sicp.plt doesn't
always draw edges of the unit frame whose x- or y-coordinate are
Convenience function for drawing connected line
Draws the outline of the designated frame.
Draws an X.
Dr... | Requires the PLT DrScheme graphical environment . Set the language
#lang scheme
(require (planet "sicp.ss" ("soegaard" "sicp.plt" 2 1)))
(define nil '())
exactly 1 .
(define one 0.99)
(define origin (make-vect 0 0))
(define lower-right (make-vect one 0))
(define upper-left (make-vect 0 one))
(define upper-ri... |
07893603ee6793aa10388538a10414a17c217afcb51e9a56c7a25f1909d39910 | TrustInSoft/tis-kernel | vcontraction.ml | (**************************************************************************)
(* *)
This file is part of .
(* *)
Copyright ( C ) 2016 - 201... | null | https://raw.githubusercontent.com/TrustInSoft/tis-kernel/748d28baba90c03c0f5f4654d2e7bb47dfbe4e7d/src/libraries/utils/vcontraction.ml | ocaml | ************************************************************************
... | This file is part of .
Copyright ( C ) 2016 - 2017
is released under GPLv2
module type G = sig
type t
module V : Graph.Sig.COMPARABLE
type vertex = V.t
val is_directed : bool
val empty : unit -> t
val add_vertex : t -> V.t -> t
v... |
b00a01cd625042a1b9b3eefba1ba0dcd783441af6d21e7b9cd07d0ec3ec66337 | typeable/generic-arbitrary | Auxiliary.hs | module Auxiliary where
import Control.Exception
import Test.QuickCheck
failGeneration :: forall a. (Arbitrary a, Show a) => IO ()
failGeneration = do
try (generate (arbitrary :: Gen a) >>= print) >>= \case
Left (_ :: SomeException) -> pure ()
Right _ -> error "Error expected"
| null | https://raw.githubusercontent.com/typeable/generic-arbitrary/107426a603375b9326ce1f3d312afe6f4d9c5f2f/test/Auxiliary.hs | haskell | module Auxiliary where
import Control.Exception
import Test.QuickCheck
failGeneration :: forall a. (Arbitrary a, Show a) => IO ()
failGeneration = do
try (generate (arbitrary :: Gen a) >>= print) >>= \case
Left (_ :: SomeException) -> pure ()
Right _ -> error "Error expected"
| |
fe8b9b56ac1b4f158215b36f2fd9d91418186cfe1a4ffcf6cd1559a21d08fc44 | static-analysis-engineering/codehawk | tCHSpecification.mli | = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
CodeHawk Unit Testing Framework
Author : Adapted from : ( )
------------------------------------------------------------------------------
... | null | https://raw.githubusercontent.com/static-analysis-engineering/codehawk/a6cbbdc2da7f171e0879fb94fe707bb00c9293c6/CodeHawk/CHT/tchlib/tCHSpecification.mli | ocaml | tchlib
* Provides type definitions, base functions, and combinators allowing to
encode specifications
* [implies p1 p2] is equivalent to [{ precond = p1; postcond = p2 }].
* Shorthand for [implies].
* [implies' p1 p2] is a simplified version of [implies] where the predicate of
the postcondition is only app... | = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
CodeHawk Unit Testing Framework
Author : Adapted from : ( )
------------------------------------------------------------------------------
... |
071adca9f02a744c2c4eebbf97af852b111f4273a49d7a5beddc0c141c0f6ea7 | ocsigen/tyxml | html_sigs.mli | TyXML
*
* Copyright ( C ) 2011 ,
*
* This program is free software ; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation , with linking exception ;
* either version 2.1 of the License , or ( at you... | null | https://raw.githubusercontent.com/ocsigen/tyxml/a4a91e7d41a9343e20ea59735bb111c2ecbe7a8d/lib/html_sigs.mli | ocaml | * HTML signatures for the functorial interface.
* Signature of typesafe constructors for HTML documents.
* A complete HTML document.
* A nullary element is an element that doesn't have any children.
* Associated SVG module, for the {!svg} combinator.
* Various information about HTML, such as the doctype, ...
* {3... | TyXML
*
* Copyright ( C ) 2011 ,
*
* This program is free software ; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation , with linking exception ;
* either version 2.1 of the License , or ( at you... |
f2b52c3e6d71de19fa2cd0f1736b233ffd57a79e6de077845f62c8b17c3034b1 | vodori/chronology | utils.clj | (ns chronology.utils
(:require [clojure.core.async :as async]
[clj-time.core :as time]
[chime.core-async :as chime-async]
;Chime now uses java.time (:require chime.joda-time) to preserve backward compatibility
[chime.joda-time])
(:import (com.cronutils.model.time ExecutionTime)... | null | https://raw.githubusercontent.com/vodori/chronology/a0029ac7c3c49f5d564c46a7f1e7f4fbd9a45e6f/src/chronology/utils.clj | clojure | Chime now uses java.time (:require chime.joda-time) to preserve backward compatibility | (ns chronology.utils
(:require [clojure.core.async :as async]
[clj-time.core :as time]
[chime.core-async :as chime-async]
[chime.joda-time])
(:import (com.cronutils.model.time ExecutionTime)
(java.time ZonedDateTime)
(org.joda.time DateTime DateTimeZone)
... |
b2a85fd25d4742e159ef28ac6c2f6cdd34a11f763011469ee9fc36aad17f4e0a | mzp/coq-ruby | names.ml | (************************************************************************)
v * The Coq Proof Assistant / The Coq Development Team
< O _ _ _ , , * CNRS - Ecole Polytechnique - INRIA Futurs - Universite Paris Sud
\VV/ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *... | null | https://raw.githubusercontent.com/mzp/coq-ruby/99b9f87c4397f705d1210702416176b13f8769c1/kernel/names.ml | ocaml | **********************************************************************
// * This file is distributed under the terms of the
* GNU Lesser General Public License Version 2.1
**********************************************************************
s Identifiers
Hash-consing of iden... | v * The Coq Proof Assistant / The Coq Development Team
< O _ _ _ , , * CNRS - Ecole Polytechnique - INRIA Futurs - Universite Paris Sud
\VV/ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
$ I d : names.ml 11750 20... |
8a160593f74c535181b934af2be061646e078a1974ca43ff22557ebe0d8a1808 | facebook/pyre-check | timer.mli |
* Copyright ( c ) Meta Platforms , Inc. and affiliates .
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree .
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in t... | null | https://raw.githubusercontent.com/facebook/pyre-check/fd80f2553d3287af173b30a1fdc4b62fa47fd331/source/timer.mli | ocaml |
* Copyright ( c ) Meta Platforms , Inc. and affiliates .
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree .
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in t... | |
6c96c52fcec495bb113c1525b7d784855f8848def741734fbe191b82e1fccdb5 | tweag/ormolu | prelude4.hs | # RULES
" unpack " [ ~1 ] forall a . unpackCString # a = build ( unpackFoldrCString # a )
" unpack - list " [ 1 ] forall a . unpackFoldrCString # a ( :) [ ] = unpackCString # a
" unpack - append " forall a n . unpackFoldrCString # a ( :) n = unpackAppendCString # a n
-- The... | null | https://raw.githubusercontent.com/tweag/ormolu/34bdf62429768f24b70d0f8ba7730fc4d8ae73ba/data/examples/declaration/rewrite-rule/prelude4.hs | haskell | There 's a built - in rule ( in PrelRules.lhs ) for
unpackFoldr " foo " c ( unpackFoldr " baz " c n ) = unpackFoldr " foobaz " c n
There's a built-in rule (in PrelRules.lhs) for
unpackFoldr "foo" c (unpackFoldr "baz" c n) = unpackFoldr "foobaz" c n | # RULES
" unpack " [ ~1 ] forall a . unpackCString # a = build ( unpackFoldrCString # a )
" unpack - list " [ 1 ] forall a . unpackFoldrCString # a ( :) [ ] = unpackCString # a
" unpack - append " forall a n . unpackFoldrCString # a ( :) n = unpackAppendCString # a n
#
"... |
eae77d3ccfb4af2b6dd15d63284581a961f59930732f09d50473708883a84323 | erlangonrails/devdb | riak_client.erl | %% -------------------------------------------------------------------
%%
%% riak_client: object used for access into the riak system
%%
Copyright ( c ) 2007 - 2010 Basho Technologies , Inc. All Rights Reserved .
%%
This file is provided to you under the Apache License ,
%% Version 2.0 (the "License"); you may no... | null | https://raw.githubusercontent.com/erlangonrails/devdb/0e7eaa6bd810ec3892bfc3d933439560620d0941/dev/riak-0.11.0/apps/riak_kv/src/riak_client.erl | erlang | -------------------------------------------------------------------
riak_client: object used for access into the riak system
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... | Copyright ( c ) 2007 - 2010 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
... |
c071ca2ade978463ea9fd2038e136f293950c538ac2608a455cd1c7d22394afa | imandra-ai/ocaml-opentelemetry | common_.ml | open Lwt.Syntax
module Atomic = Opentelemetry_atomic.Atomic
let[@inline] ( let@ ) f x = f x
let spf = Printf.sprintf
let tid () = Thread.id @@ Thread.self ()
let debug_ =
ref
(match Sys.getenv_opt "OTEL_OCAML_DEBUG" with
| Some ("1" | "true") -> true
| _ -> false)
let default_url = ":4318"
let url =... | null | https://raw.githubusercontent.com/imandra-ai/ocaml-opentelemetry/9239dbe9340f595602e902a081296a124b871d9b/src/client-cohttp-lwt/common_.ml | ocaml | open Lwt.Syntax
module Atomic = Opentelemetry_atomic.Atomic
let[@inline] ( let@ ) f x = f x
let spf = Printf.sprintf
let tid () = Thread.id @@ Thread.self ()
let debug_ =
ref
(match Sys.getenv_opt "OTEL_OCAML_DEBUG" with
| Some ("1" | "true") -> true
| _ -> false)
let default_url = ":4318"
let url =... | |
d952069ac74b142e1a60e9e57f8ac79ec5fce0777215647e9b2ae2590c0780e8 | GOFAI/cl-tesseract | capi.lisp | (in-package :cl-tesseract)
Bindings for Tesseract OCR v.3.04.00 capi generated using SWIG
(cffi:defcenum TessOcrEngineMode
:OEM_TESSERACT_ONLY
:OEM_CUBE_ONLY
:OEM_TESSERACT_CUBE_COMBINED
:OEM_DEFAULT)
(cffi:defcenum TessPageSegMode
:PSM_OSD_ONLY
:PSM_AUTO_OSD
:PSM_AUTO_ONLY
:PSM_AUTO
:PSM_SINGLE_COLUMN
:... | null | https://raw.githubusercontent.com/GOFAI/cl-tesseract/24acb402890454a632c2f1f848dc72d33ed4770f/capi.lisp | lisp | (in-package :cl-tesseract)
Bindings for Tesseract OCR v.3.04.00 capi generated using SWIG
(cffi:defcenum TessOcrEngineMode
:OEM_TESSERACT_ONLY
:OEM_CUBE_ONLY
:OEM_TESSERACT_CUBE_COMBINED
:OEM_DEFAULT)
(cffi:defcenum TessPageSegMode
:PSM_OSD_ONLY
:PSM_AUTO_OSD
:PSM_AUTO_ONLY
:PSM_AUTO
:PSM_SINGLE_COLUMN
:... | |
b47d099b5fe8a0e4fbf1320c1f68933303e623a5e531bcade4ae22ce7e10bea5 | Shirakumo/kandria | diagnostics.lisp | (in-package #:org.shirakumo.fraf.kandria)
(defclass diagnostics-label (alloy:label)
())
(presentations:define-realization (ui diagnostics-label)
((:label simple:text)
(alloy:margins)
alloy:text
:pattern (colored:color 1 1 1)
:size (alloy:un 18)
:halign :start :valign :top
:font "NotoSansMono"))
... | null | https://raw.githubusercontent.com/Shirakumo/kandria/94fd727bd93e302c6a28fae33815043d486d794b/ui/diagnostics.lisp | lisp | (in-package #:org.shirakumo.fraf.kandria)
(defclass diagnostics-label (alloy:label)
())
(presentations:define-realization (ui diagnostics-label)
((:label simple:text)
(alloy:margins)
alloy:text
:pattern (colored:color 1 1 1)
:size (alloy:un 18)
:halign :start :valign :top
:font "NotoSansMono"))
... | |
e44e92910947d2b67960e86ae3a8cee1787942dd145fc094c378f8ac92bf442f | Eugleo/roguelike | flood-fill.rkt | #lang racket
(require racket/draw)
;; flood-fill: bitmap<%> number number color color -> void
;; An example of flood filling a bitmap.
;;
;; We'll use a raw, byte-oriented interface here for demonstration
;; purposes. Racket does provide get-pixel and set-pixel functions
;; which work on color% structures rather tha... | null | https://raw.githubusercontent.com/Eugleo/roguelike/72c6988d9a9f184077f80a07cb6f8fddda9f7ec5/flood-fill.rkt | racket | flood-fill: bitmap<%> number number color color -> void
An example of flood filling a bitmap.
We'll use a raw, byte-oriented interface here for demonstration
purposes. Racket does provide get-pixel and set-pixel functions
which work on color% structures rather than bytes, but it's useful
to see that the byte ap... | #lang racket
(require racket/draw)
(define (flood-fill bm start-x start-y target-color replacement-color)
(define (iter x y)
(when (and (in-bounds? x y) (target-color-at? x y))
(replace-color-at! x y)
(iter (add1 x) y)
(iter (sub1 x) y)
(iter x (add1 y))
(iter x (sub1 y))))
(def... |
f1a1b177a26f52cd965d8aded7a3d2d4513d1ce45b7a85a68428dbc5f176187a | reasonml/reason | migrate_parsetree_403_404_migrate.ml | (**************************************************************************)
(* *)
(* OCaml Migrate Parsetree *)
(* *)
... | null | https://raw.githubusercontent.com/reasonml/reason/4f6ff7616bfa699059d642a3d16d8905d83555f6/src/vendored-omp/src/migrate_parsetree_403_404_migrate.ml | ocaml | ************************************************************************
OCaml Migrate Parsetree
... |
, LexiFi
Copyright 2017 Institut National de Recherche en Informatique et
the GNU Lesser General Public License version 2.1 , with the
module From = Ast_403
module To = Ast_404
l... |
44b0decf98b0e52d98684bd1ecaaf63d26a3c03b10d0027b7caf1fb450bd6da5 | dnaeon/cl-migratum | pending.lisp | Copyright ( c ) 2020 - 2022 Nikolov < >
;; All rights reserved.
;;
;; Redistribution and use in source and binary forms, with or without
;; modification, are permitted provided that the following conditions
;; are met:
;;
1 . Redistributions of source code must retain the above copyright
;; notice, this lis... | null | https://raw.githubusercontent.com/dnaeon/cl-migratum/31ceaf4ff66ae3c124d95673bb0d5d61e87588ba/src/cli/pending.lisp | lisp | All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
notice, this list of conditions and the following disclaimer
in this position and unchanged.
notice, this list of conditions and the fo... | Copyright ( c ) 2020 - 2022 Nikolov < >
1 . Redistributions of source code must retain the above copyright
2 . Redistributions in binary form must reproduce the above copyright
THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S ) ` ` AS IS '' AND ANY EXPRESS OR
INCIDENTAL , SPECIAL , EXEMPLARY , OR CONSEQUENTIAL ... |
282785949f053b4c8b9a623d8e67b99838674592296d8c806383982d63270368 | ijvcms/chuanqi_dev | map_20101_back.erl | -module(map_20101).
-export([
range/0,
data/0
]).
range() -> {68, 36}.
data() ->
{
{1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,2,2,2,2,2,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1},
{1,1,1,1,1,1,1,1,1,1,2,2,2,0,0,2,2,1,1,1,1,1,1,1,1,1,1,1,1,1,2,2,2,2,2,2,0,0,0,0,0,2,2,2,2,2,2... | null | https://raw.githubusercontent.com/ijvcms/chuanqi_dev/7742184bded15f25be761c4f2d78834249d78097/server/trunk/server/map_20101_back.erl | erlang | -module(map_20101).
-export([
range/0,
data/0
]).
range() -> {68, 36}.
data() ->
{
{1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,2,2,2,2,2,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1},
{1,1,1,1,1,1,1,1,1,1,2,2,2,0,0,2,2,1,1,1,1,1,1,1,1,1,1,1,1,1,2,2,2,2,2,2,0,0,0,0,0,2,2,2,2,2,2... | |
9d69e0f2034eb0024e31976a8b25b5a96062ed9602327b89c7c2888527430c35 | bgamari/wavelet-tree | Binary.hs | module Data.Tree.Binary where
import Prelude hiding (concat, concatMap)
import Control.Applicative
import Data.Foldable
import Data.Traversable
import Data.Monoid
-- | A binary tree with labels on branches
data BiTree label a = Branch !label !(BiTree label a) !(BiTree label a)
| Leaf !a
... | null | https://raw.githubusercontent.com/bgamari/wavelet-tree/c0e43449f5fb831fb2b082bc6e5a2c37fcb0595b/Data/Tree/Binary.hs | haskell | | A binary tree with labels on branches
| Start at the leaves and transform the labels with a monoidal accumulator | module Data.Tree.Binary where
import Prelude hiding (concat, concatMap)
import Control.Applicative
import Data.Foldable
import Data.Traversable
import Data.Monoid
data BiTree label a = Branch !label !(BiTree label a) !(BiTree label a)
| Leaf !a
| Nil
deriving (Sho... |
8f42b57ec0b77d0f7981fb0369ba1e1a93784bd1c46d67ef277c366c0371efc3 | haskell-trasa/trasa | Lexer.hs | # LANGUAGE LambdaCase #
# LANGUAGE TypeFamilies #
{-# LANGUAGE ExplicitForAll #-}
{-# LANGUAGE MultiWayIf #-}
{-# LANGUAGE RankNTypes #-}
# LANGUAGE RecordWildCards #
# LANGUAGE GeneralizedNewtypeDeriving #
module Trasa.TH.Lexer
( ReservedChar(..)
, ReservedSymbol(..)
, Lexeme(..)
, Stream(..)
, stream ) whe... | null | https://raw.githubusercontent.com/haskell-trasa/trasa/bfc23d4fd5b895493ba650a7f607b5fa034179d7/trasa-th/src/Trasa/TH/Lexer.hs | haskell | # LANGUAGE ExplicitForAll #
# LANGUAGE MultiWayIf #
# LANGUAGE RankNTypes #
NOTE Do not eta-reduce these (breaks inlining)
^ How to split input stream at given offset
^ How to fold over input stream
^ How to convert chunk of input stream into a 'String'
^ Newline token and tab token
^ Offset to reach
^ Initial '... | # LANGUAGE LambdaCase #
# LANGUAGE TypeFamilies #
# LANGUAGE RecordWildCards #
# LANGUAGE GeneralizedNewtypeDeriving #
module Trasa.TH.Lexer
( ReservedChar(..)
, ReservedSymbol(..)
, Lexeme(..)
, Stream(..)
, stream ) where
import Data.Proxy (Proxy(..))
import Data.Semigroup ((<>))
import Data.Void (Void)
i... |
31b164a4bbd4453dd2654749462fc647af518ad45355ccc1cfc6a58fa6912da4 | dropbox/Dropline | Dropline.hs | module Main (main) where
import Dropline.Kismet (connect)
import Dropline.Tracker (track)
import Dropline.Server (serve)
main = do
signals <- connect
visible <- track signals
serve visible
| null | https://raw.githubusercontent.com/dropbox/Dropline/6d54a3fc7bf14cbf16a884257792fb9f92d1655f/src/Dropline.hs | haskell | module Main (main) where
import Dropline.Kismet (connect)
import Dropline.Tracker (track)
import Dropline.Server (serve)
main = do
signals <- connect
visible <- track signals
serve visible
| |
4c6cb45d92f8d01a3de136aefbb83fb6891eaffb2b80bc79e5dcd5f0cf30526e | exercism/clojure | meetup.clj | (ns meetup)
(defn meetup [] ;; <- arglist goes here
;; your code goes here
) | null | https://raw.githubusercontent.com/exercism/clojure/7ed96a5ae3c471c37db2602baf3db2be3b5a2d1a/exercises/practice/meetup/src/meetup.clj | clojure | <- arglist goes here
your code goes here | (ns meetup)
) |
5cee6c005234ac0a289803311757a2479ce702c680924fe5ebaff7dd02d817f8 | tud-fop/vanda-haskell | WTA.hs | -----------------------------------------------------------------------------
-- |
Copyright : ( c ) Technische Universität Dresden 2018
-- License : BSD-style
--
-- Stability : unknown
-- Portability : portable
-----------------------------------------------------------------------------
module Data.W... | null | https://raw.githubusercontent.com/tud-fop/vanda-haskell/3214966361b6dbf178155950c94423eee7f9453e/library/Data/WTA.hs | haskell | ---------------------------------------------------------------------------
|
License : BSD-style
Stability : unknown
Portability : portable
--------------------------------------------------------------------------- | Copyright : ( c ) Technische Universität Dresden 2018
module Data.WTA where
data WTA w v
= WTA { delta :: [v] -> [w] -> [(v, Double)],
nu :: v -> Double
}
class Functor s => State s where
mapState :: (v -> v') -> s v -> s v'
|
a6261e431bd14ee3ac10383c4c38f11dce753a3b6fba5a1edd9b224e3e8fc3e2 | openvstorage/alba | llio2.ml |
Copyright ( C ) iNuron -
This file is part of Open vStorage . For license information , see < LICENSE.txt >
Copyright (C) iNuron -
This file is part of Open vStorage. For license information, see <LICENSE.txt>
*)
open! Prelude
module ReadBuffer = struct
type t = { buf : Lwt_bytes.t;
... | null | https://raw.githubusercontent.com/openvstorage/alba/459bd459335138d6b282d332fcff53a1b4300c29/ocaml/src/tools/llio2.ml | ocaml |
Copyright ( C ) iNuron -
This file is part of Open vStorage . For license information , see < LICENSE.txt >
Copyright (C) iNuron -
This file is part of Open vStorage. For license information, see <LICENSE.txt>
*)
open! Prelude
module ReadBuffer = struct
type t = { buf : Lwt_bytes.t;
... | |
45abae7b16d812c8680bbdd61daa8cfaacef2d9f882c18992c5b7ddc8dc12573 | helvm/helms | MapList.hs | module HelVM.Common.Collections.MapList where
import HelVM.Common.Containers.LLIndexSafe
import HelVM.Common.Containers.LLInsertDef
import HelVM.Common.Control.Safe
import Data.Default
import qualified Data.IntMap as IntMap
import qualified Data.List.In... | null | https://raw.githubusercontent.com/helvm/helms/df44190e9ddc64037a6e58548f4a14c7214df7a3/hs/src/HelVM/Common/Collections/MapList.hs | haskell | | Construction
| DeConstruction
| Internal function
| Types
| Standard instances
| My instances
# OVERLAPPING #
| Internal functions | module HelVM.Common.Collections.MapList where
import HelVM.Common.Containers.LLIndexSafe
import HelVM.Common.Containers.LLInsertDef
import HelVM.Common.Control.Safe
import Data.Default
import qualified Data.IntMap as IntMap
import qualified Data.List.In... |
bfa6e7829d5feea1790a4a1f59d2ee01d84aa2741d09753721ebcc234b5cc1b5 | links-lang/links | lens_set.mli | module type OrderedShow = sig
type t [@@deriving show]
include Set.OrderedType with type t := t
end
module type S = Lens_set_intf.S
module Make (Ord : OrderedShow) : S with type elt = Ord.t
| null | https://raw.githubusercontent.com/links-lang/links/2923893c80677b67cacc6747a25b5bcd65c4c2b6/lens/lens_set.mli | ocaml | module type OrderedShow = sig
type t [@@deriving show]
include Set.OrderedType with type t := t
end
module type S = Lens_set_intf.S
module Make (Ord : OrderedShow) : S with type elt = Ord.t
| |
5b6e2df7d46d22d623bc0b464072ae4fe96194a51442e9972fca0cd0a0d337c8 | hasktorch/ffi-experimental | Main.hs | {-# LANGUAGE DeriveAnyClass #-}
# LANGUAGE DeriveGeneric #
{-# LANGUAGE OverloadedStrings #-}
module Main where
import qualified Options.Applicative as O
import qualified ParseFunctionSig as F
import qualified RenderDeclarations as RD
import qualified RenderTuples as RTL
import qualified RenderClass as RC
import qual... | null | https://raw.githubusercontent.com/hasktorch/ffi-experimental/54192297742221c4d50398586ba8d187451f9ee0/codegen/exe/Main.hs | haskell | # LANGUAGE DeriveAnyClass #
# LANGUAGE OverloadedStrings #
CLI options
RT.tensorBuilder | # LANGUAGE DeriveGeneric #
module Main where
import qualified Options.Applicative as O
import qualified ParseFunctionSig as F
import qualified RenderDeclarations as RD
import qualified RenderTuples as RTL
import qualified RenderClass as RC
import qualified RenderPure as RP
data Options = Options
{ specFileDL ::... |
bc0fa7ce33e1a6e21735e762d5a632ae00453965ae8cb7913ab6ead930609c73 | kyleburton/sandbox | test-runner.cljs | (ns mysterious_messages.test-runner
(:require
[cljs.test :refer-macros [run-tests]]
[mysterious_messages.core-test]))
(enable-console-print!)
(defn runner []
(if (cljs.test/successful?
(run-tests
'mysterious_messages.core-test))
0
1))
| null | https://raw.githubusercontent.com/kyleburton/sandbox/cccbcc9a97026336691063a0a7eb59293a35c31a/examples/clojure/mysterious-messages/test/cljs/mysterious_messages/test-runner.cljs | clojure | (ns mysterious_messages.test-runner
(:require
[cljs.test :refer-macros [run-tests]]
[mysterious_messages.core-test]))
(enable-console-print!)
(defn runner []
(if (cljs.test/successful?
(run-tests
'mysterious_messages.core-test))
0
1))
| |
46d30a57aee458f4ffe390b73ac9b45c5bdc374148539c8b3327325940582fc5 | HunterYIboHu/htdp2-solution | ex442-compart-sort-and-quick-sort.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 ex442-compart-sort-and-quick-sort) (read-case-sensitive #t) (teachpacks ()) (htdp-settings... | null | https://raw.githubusercontent.com/HunterYIboHu/htdp2-solution/6182b4c2ef650ac7059f3c143f639d09cd708516/Chapter5/Section26-design-algorithm/ex442-compart-sort-and-quick-sort.rkt | racket | about the language level of this file in a form that our tools can easily process.
check functions
functions
[List-of Number] -> [List-of Number]
produces a sorted version of alon.
[List-of Number] -> [List-of Number]
produces the numbers in the alon which is smaller than the given
pivot.
[List-of Number] -> [... | The first three lines of this file were inserted by . They record metadata
#reader(lib "htdp-intermediate-lambda-reader.ss" "lang")((modname ex442-compart-sort-and-quick-sort) (read-case-sensitive #t) (teachpacks ()) (htdp-settings #(#t constructor repeating-decimal #f #t none #f () #f)))
(define check-sort
(lambd... |
21201f3987578432ff5a88dd243564d4732f7b3f88c7ee43c4c1ad0d3a90aada | pjotrp/guix | bittorrent.scm | ;;; GNU Guix --- Functional package management for GNU
Copyright © 2014 / < >
Copyright © 2014 , 2015 < >
;;;
;;; This file is part of GNU Guix.
;;;
GNU is free software ; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foun... | null | https://raw.githubusercontent.com/pjotrp/guix/96250294012c2f1520b67f12ea80bfd6b98075a2/gnu/packages/bittorrent.scm | scheme | GNU Guix --- Functional package management for GNU
This file is part of GNU Guix.
you can redistribute it and/or modify it
either version 3 of the License , or ( at
your option) any later version.
GNU Guix is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied wa... | Copyright © 2014 / < >
Copyright © 2014 , 2015 < >
under the terms of the GNU General Public License as published by
You should have received a copy of the GNU General Public License
along with GNU . If not , see < / > .
(define-module (gnu packages bittorrent)
#:use-module (guix packages)
#:u... |
0b8e2b135268e5ce6e3cf00edecaa7be702910cf94a36c86c726f5e4ce238769 | maximedenes/native-coq | glob_term_to_relation.ml | open Printer
open Pp
open Names
open Term
open Glob_term
open Libnames
open Indfun_common
open Errors
open Util
open Glob_termops
let observe strm =
if do_observe ()
then Pp.msgnl strm
else ()
let observennl strm =
if do_observe ()
then Pp.msg strm
else ()
type binder_type =
| Lambda of name
| Prod o... | null | https://raw.githubusercontent.com/maximedenes/native-coq/3623a4d9fe95c165f02f7119c0e6564a83a9f4c9/plugins/funind/glob_term_to_relation.ml | ocaml |
The main part deals with building a list of globalized constructor expressions
from the rhs of a fixpoint equation.
the binding context of the result
The value
for each result in arg_res
we add it in each args_res
and then we flatten the map
The combination function for an argument with a list of ... | open Printer
open Pp
open Names
open Term
open Glob_term
open Libnames
open Indfun_common
open Errors
open Util
open Glob_termops
let observe strm =
if do_observe ()
then Pp.msgnl strm
else ()
let observennl strm =
if do_observe ()
then Pp.msg strm
else ()
type binder_type =
| Lambda of name
| Prod o... |
520680cf4501f89d9de74653ebbe4a216974501028a03054e18bfbe8db2662af | adamwalker/clash-utils | RegexSpec.hs | module RegexSpec where
import qualified Clash.Prelude as Clash
import Clash.Prelude (Signal, Vec(..), BitVector, Index, Signed, Unsigned, SFixed, Bit, SNat(..),
simulate, simulate_lazy, listToVecTH, KnownNat, pack, unpack, (++#), mealy, mux, bundle, unbundle,
HiddenClockRes... | null | https://raw.githubusercontent.com/adamwalker/clash-utils/cc4169a238e01d0ed9b7b7efce9fee29cb4c4876/tests/RegexSpec.hs | haskell | Compiled regular expression
Given a regex, generate an arbitrary string that matches it
Repeat everything to get around the absurd template haskell "stage restriction"
Test matching strings
Test strings that probably don't match | module RegexSpec where
import qualified Clash.Prelude as Clash
import Clash.Prelude (Signal, Vec(..), BitVector, Index, Signed, Unsigned, SFixed, Bit, SNat(..),
simulate, simulate_lazy, listToVecTH, KnownNat, pack, unpack, (++#), mealy, mux, bundle, unbundle,
HiddenClockRes... |
0a81e9dc35890489f0e86d81fcb4538b11c96f1971ad8b3a6dfe5959e34e67bf | input-output-hk/marlowe-cardano | MarloweUTxOSpec.hs | # LANGUAGE DataKinds #
{-# LANGUAGE GADTs #-}
# OPTIONS_GHC -Wno - orphans #
module Language.Marlowe.Runtime.Indexer.MarloweUTxOSpec
( spec
) where
import Cardano.Api
(CardanoMode, ConsensusMode(CardanoMode), EraHistory(EraHistory), SystemStart(SystemStart), hashScriptData)
import Control.Monad (guard, mfilter,... | null | https://raw.githubusercontent.com/input-output-hk/marlowe-cardano/2046f745974a648b7d0ef880a255530bb4144cac/marlowe-runtime/indexer-test/Language/Marlowe/Runtime/Indexer/MarloweUTxOSpec.hs | haskell | # LANGUAGE GADTs #
Mary lasted 1 ms
Babbage never ends
This conversion works because of the way the era history is setup in
try again because the contract had no valid inputs to produce
Should be let isClose = outContract == V1.Close but this seems to be
most. This simulates a transaction with a script output wel... | # LANGUAGE DataKinds #
# OPTIONS_GHC -Wno - orphans #
module Language.Marlowe.Runtime.Indexer.MarloweUTxOSpec
( spec
) where
import Cardano.Api
(CardanoMode, ConsensusMode(CardanoMode), EraHistory(EraHistory), SystemStart(SystemStart), hashScriptData)
import Control.Monad (guard, mfilter, zipWithM)
import Contr... |
189b44790839779ffd0c1550f1b7e60d7e06b2da2ef93c34fab9d0ad494fcf1a | rowangithub/DOrder | rulemine.ml | open Asttypes
open Typedtree
open Btype
open Types
open Frame
open Unix
exception MINEFAIL
(* A way to represent program positive samples *)
type value = Cell of int | Cells of (string * value) list list
type sample = (string, value) Hashtbl.t
(***********************************************)
(*************** Util F... | null | https://raw.githubusercontent.com/rowangithub/DOrder/e0d5efeb8853d2a51cc4796d7db0f8be3185d7df/liquid/rulemine.ml | ocaml | A way to represent program positive samples
*********************************************
************** Util Funcitons ***************
*********************************************
support
confidence
Must be for precedences
* Begin rule mining
0. Make sample complete
****** Util Function ******
* learning ru... | open Asttypes
open Typedtree
open Btype
open Types
open Frame
open Unix
exception MINEFAIL
type value = Cell of int | Cells of (string * value) list list
type sample = (string, value) Hashtbl.t
let remove_nth l indices =
fst (List.fold_left (fun (l',index) li ->
if (List.exists (fun i -> i = index) indices)
... |
e97a9bb4253d44a3a6831f4384c8180de87a6b1899eabc4ada3334779396a783 | jyh/metaprl | itt_pairwise.ml | doc <:doc<
@module[Itt_pointwise]
@parents
@docoff
----------------------------------------------------------------
@begin[license]
This file is part of MetaPRL, a modular, higher order
logical framework that provides a logical programming
environment for OCaml and other languages.
See the... | null | https://raw.githubusercontent.com/jyh/metaprl/51ba0bbbf409ecb7f96f5abbeb91902fdec47a19/theories/itt/core/itt_pairwise.ml | ocaml | ***********************************************************************
* RULES *
*********************************************************************** | doc <:doc<
@module[Itt_pointwise]
@parents
@docoff
----------------------------------------------------------------
@begin[license]
This file is part of MetaPRL, a modular, higher order
logical framework that provides a logical programming
environment for OCaml and other languages.
See the... |
2e78c1583360263db3ac5b7346e1f739b3e435d30621825840cbbe2eac4ac844 | repl-acement/repl-acement | data.cljc | (ns replacement.protocol.data
(:require [clojure.spec.alpha :as s]
#?(:clj [clojure.core.specs.alpha :as core-specs]
:cljs [replacement.protocol.cljs-fn-specs :as core-specs])
[clojure.spec.test.alpha :as stest]
[clojure.string :as string]
[replacement.p... | null | https://raw.githubusercontent.com/repl-acement/repl-acement/69b76f09d31f1fde6720d8fc682c79a7bf9fcbde/repl-shared/replacement/protocol/data.cljc | clojure | (ns replacement.protocol.data
(:require [clojure.spec.alpha :as s]
#?(:clj [clojure.core.specs.alpha :as core-specs]
:cljs [replacement.protocol.cljs-fn-specs :as core-specs])
[clojure.spec.test.alpha :as stest]
[clojure.string :as string]
[replacement.p... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.