_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 |
|---|---|---|---|---|---|---|---|---|
3a0b1137cf3e85460b3be9bf111afd62f74a8bedfc05b2e6d40a6bca065d0199 | tarides/dune-release | github.mli | ---------------------------------------------------------------------------
Copyright ( c ) 2016 . All rights reserved .
Distributed under the ISC license , see terms at the end of the file .
% % NAME%% % % ---------------------------------------------------------------------------
Copyright (c) ... | null | https://raw.githubusercontent.com/tarides/dune-release/6bfed0f299b82c0931c78d4e216fd0efedff0673/lib/github.mli | ocaml | * {1 Publish}
* [undraft_release] updates an existing release to undraft it and returns the
release archive download URL.
* [undraft_pr] updates an existing pull request to undraft it and returns the
pull request URL. | ---------------------------------------------------------------------------
Copyright ( c ) 2016 . All rights reserved .
Distributed under the ISC license , see terms at the end of the file .
% % NAME%% % % ---------------------------------------------------------------------------
Copyright (c) ... |
b8d5f45bbebca27cb1855f46647fea6cac890a0651e6db54764037cf96e3fe00 | MLstate/opalang | ocamldoc_plugin.ml |
Copyright © 2011 MLstate
This file is part of .
Permission is hereby granted , free of charge , to any person obtaining a copy of this software and associated documentation files ( the " Software " ) , to deal in the Software without restriction , including without limitation the rights to use , co... | null | https://raw.githubusercontent.com/MLstate/opalang/424b369160ce693406cece6ac033d75d85f5df4f/tools/utils/ocamldoc_plugin.ml | ocaml |
Copyright © 2011 MLstate
This file is part of .
Permission is hereby granted , free of charge , to any person obtaining a copy of this software and associated documentation files ( the " Software " ) , to deal in the Software without restriction , including without limitation the rights to use , co... | |
b223d9d2ec9640cdd464a0c620d61b2881994f2a7246c4eaadb58f9695e0c374 | xapi-project/xen-api | test_helpers.ml |
* Copyright ( C ) 2013 Citrix Systems Inc.
*
* This program is free software ; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published
* by the Free Software Foundation ; version 2.1 only . with the special
* exception on linking described in fi... | null | https://raw.githubusercontent.com/xapi-project/xen-api/47fae74032aa6ade0fc12e867c530eaf2a96bf75/ocaml/tests/test_helpers.ml | ocaml | The type of inputs to a system being tested.
The type of outputs from a system being tested.
Helper functions for printing error messages on test failure. |
* Copyright ( C ) 2013 Citrix Systems Inc.
*
* This program is free software ; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published
* by the Free Software Foundation ; version 2.1 only . with the special
* exception on linking described in fi... |
d16dfb47092c0bd275d7e5c67e14597a6eeb14776082dd6a3830dc41976c54b3 | askonomm/clarktown | quote_block.clj | (ns clarktown.matchers.quote-block
(:require
[clojure.string :as string]))
(defn match?
"Determines whether the given block is a quote block."
[block]
(-> (string/replace block #"\n" "")
string/trim
(string/starts-with? ">"))) | null | https://raw.githubusercontent.com/askonomm/clarktown/dcb21ec0104cdec3ca9976374868c5837ad9d0b9/src/clarktown/matchers/quote_block.clj | clojure | (ns clarktown.matchers.quote-block
(:require
[clojure.string :as string]))
(defn match?
"Determines whether the given block is a quote block."
[block]
(-> (string/replace block #"\n" "")
string/trim
(string/starts-with? ">"))) | |
92aadc2ce139e57b6cd2414c3dea604b01953c90e5e3320235b8a8c5d302442d | chpill/cljs-weight | using_core_async.cljs | (ns cljs-weight.using-core-async
(:require-macros [cljs.core.async.macros :refer [go]])
(:require [clojure.core.async :as async]))
(def the-only-channel (async/chan))
(defn init []
(go (js/alert (async/<! the-only-channel)))
(async/put! the-only-channel
"This message went through a channel befor... | null | https://raw.githubusercontent.com/chpill/cljs-weight/b470d159226345759cc67f1d4d0c2fc889b79ae0/src/cljs/cljs_weight/using_core_async.cljs | clojure | (ns cljs-weight.using-core-async
(:require-macros [cljs.core.async.macros :refer [go]])
(:require [clojure.core.async :as async]))
(def the-only-channel (async/chan))
(defn init []
(go (js/alert (async/<! the-only-channel)))
(async/put! the-only-channel
"This message went through a channel befor... | |
a4639cd785fff6279ea708b0ead15fdf089c471bcb0083aa8b4c9b521f89207c | YoshikuniJujo/test_haskell | Khr.hs | # LANGUAGE ImportQualifiedPost #
# , OverloadedStrings #
# LANGUAGE MonoLocalBinds #
# LANGUAGE FlexibleContexts , UndecidableInstances #
{-# LANGUAGE PatternSynonyms, ViewPatterns #-}
# LANGUAGE StandaloneDeriving #
# OPTIONS_GHC -Wall -fno - warn - tabs #
module Gpu.Vulkan.Khr where
import Foreign.Storable.PeekPo... | null | https://raw.githubusercontent.com/YoshikuniJujo/test_haskell/e5bad21f788a602c3d6e015c84162f848f0e8ee0/themes/gui/vulkan/try-my-vulkan-snd/src/Gpu/Vulkan/Khr.hs | haskell | # LANGUAGE PatternSynonyms, ViewPatterns # | # LANGUAGE ImportQualifiedPost #
# , OverloadedStrings #
# LANGUAGE MonoLocalBinds #
# LANGUAGE FlexibleContexts , UndecidableInstances #
# LANGUAGE StandaloneDeriving #
# OPTIONS_GHC -Wall -fno - warn - tabs #
module Gpu.Vulkan.Khr where
import Foreign.Storable.PeekPoke
import qualified Data.HeteroParList as Heter... |
63ac8a8dd9b8abe2f66332cbc3d9e24a036c3d43676e1f57f3a7f1883dc28d38 | clojusc/meson | scheduler.clj | (ns meson.records.scheduler
(:require [meson.records.base.mesos :as mesos]))
(defrecord Subscribe [
;; Required
an instance of the ` FrameworkInfo ` record
;; Optional
force ; bool
suppressed-roles ; a sequence of strings
])
(defrecord Call [
;; Optional
framework-id ; an instance of the `FrameworkI... | null | https://raw.githubusercontent.com/clojusc/meson/a690135bf64c967a70fd45e88bdfed1e7b847317/src/meson/records/scheduler.clj | clojure | Required
Optional
bool
a sequence of strings
Optional
an instance of the `FrameworkID` record
`ACCEPT_INVERSE_OFFERS`, `DECLINE_INVERSE_OFFERS`, `REVIVE`, `KILL`,
`SHUTDOWN`, `ACKNOWLEDGE`, `RECONCILE`, `MESSAGE`, `REQUEST`, or
`SUPPRESS`
an instance of the `Subscribe` record
Constructors ;;;;;;;;;;;;;;... | (ns meson.records.scheduler
(:require [meson.records.base.mesos :as mesos]))
(defrecord Subscribe [
an instance of the ` FrameworkInfo ` record
])
(defrecord Call [
one of ` UNKNOWN ` , ` SUBSCRIBE ` , ` TEARDOWN ` , ` ACCEPT ` , ` DECLINE ` ,
])
(defn create-subscribe
[args]
(->Subscribe
(mesos/c... |
9ff5830f3ae8290560c883c06f03c3301b441c9f2eef71358442670558122de5 | modular-macros/ocaml-macros | record_with.ml | A regression test for both PR#4141 and PR#5819 : when a recursive
variable is defined by a { record with ... } expression .
variable is defined by a { record with ... } expression.
*)
type t = {
self : t;
t0 : int;
t1 : int;
t2 : int;
t3 : int;
t4 : int;
};;
let rec t = {
self = t;
t0 = 42;... | null | https://raw.githubusercontent.com/modular-macros/ocaml-macros/05372c7248b5a7b1aa507b3c581f710380f17fcd/testsuite/tests/letrec/record_with.ml | ocaml | A regression test for both PR#4141 and PR#5819 : when a recursive
variable is defined by a { record with ... } expression .
variable is defined by a { record with ... } expression.
*)
type t = {
self : t;
t0 : int;
t1 : int;
t2 : int;
t3 : int;
t4 : int;
};;
let rec t = {
self = t;
t0 = 42;... | |
f9c56c64e99d1b31fe5fb817f79d559083c6f546cd891a9993017670b5911285 | tisnik/clojure-examples | core.clj | (ns carmine8.core
(:require [taoensso.carmine :as carmine :refer (wcar)]))
(def redis-connection {
:pool {}
:spec {
:uri "redis@127.0.0.1:6379"}})
(defmacro wcar*
[& body]
`(carmine/wcar redis-connection ~@body))
(defn -main
[& args]
(println "Working with two sets")
(println "Set s1")
(pri... | null | https://raw.githubusercontent.com/tisnik/clojure-examples/303b7784f9238309af9b9853b426a88accf042e4/carmine8/src/carmine8/core.clj | clojure | (ns carmine8.core
(:require [taoensso.carmine :as carmine :refer (wcar)]))
(def redis-connection {
:pool {}
:spec {
:uri "redis@127.0.0.1:6379"}})
(defmacro wcar*
[& body]
`(carmine/wcar redis-connection ~@body))
(defn -main
[& args]
(println "Working with two sets")
(println "Set s1")
(pri... | |
98ecfe1c544adba63e7e5348e6586c44aaeabb24303ff3828405438668833494 | NorfairKing/tickler | Import.hs | module Import
( module X,
)
where
import Control.Monad as X
import Control.Monad.IO.Class as X
import Data.ByteString as X (ByteString)
import Data.GenValidity.ByteString as X ()
import Data.GenValidity.Text as X
import Data.GenValidity.Time as X ()
import Data.List as X hiding (head, init, last, tail)
import Data... | null | https://raw.githubusercontent.com/NorfairKing/tickler/1b0c05dc1d32847596bd3ffe4f93d094e1f6382a/tickler-server-gen/src/Import.hs | haskell | module Import
( module X,
)
where
import Control.Monad as X
import Control.Monad.IO.Class as X
import Data.ByteString as X (ByteString)
import Data.GenValidity.ByteString as X ()
import Data.GenValidity.Text as X
import Data.GenValidity.Time as X ()
import Data.List as X hiding (head, init, last, tail)
import Data... | |
881af2073b13b7521b08bd27c7b7ede8c9437660b62c9950cc784ffc17adee15 | migamake/json-autotype | RunHaskellModule.hs | -- | Functions for running generated modules
--
# LANGUAGE LambdaCase #
# LANGUAGE RecordWildCards #
{-# LANGUAGE ScopedTypeVariables #-}
module Language.Haskell.RunHaskellModule
( RunOptions(..)
, compileHaskellModule
, compileHaskellModule'
, runHaskellModule
, runHaskellModule'
... | null | https://raw.githubusercontent.com/migamake/json-autotype/1a26a490e5ea618bdce8231ae5355771a362e703/run-haskell-module/src/Language/Haskell/RunHaskellModule.hs | haskell | | Functions for running generated modules
# LANGUAGE ScopedTypeVariables #
| Describes options required for run environment
^ Whether to show `stdout` for debugging
^ Packages to expose
| Call specified process with args and print its output when it fails.
| Splits commandline-like strings into "words", i.e.
... | # LANGUAGE LambdaCase #
# LANGUAGE RecordWildCards #
module Language.Haskell.RunHaskellModule
( RunOptions(..)
, compileHaskellModule
, compileHaskellModule'
, runHaskellModule
, runHaskellModule'
) where
import Control.Exception
import Control.Monad
import... |
92b97295ec5518128591188506c0750668780db1121784b671c9a3b3b6a9faa2 | dfinity-side-projects/winter | Spec.hs | {-# LANGUAGE OverloadedStrings #-}
# LANGUAGE TypeApplications #
module Spec (tests) where
import qualified Data.IntMap as IM
import qualified Data.Map as M
import Test.Tasty (TestTree, testGroup)
import Test.Tasty.HUnit (testCaseSteps, assertFailure)
import Wasm.Text.Wast (parseWastFil... | null | https://raw.githubusercontent.com/dfinity-side-projects/winter/2cc31576fe029d85c37d21fc9ea4902c5c64b5a9/test/Spec.hs | haskell | # LANGUAGE OverloadedStrings #
Note: we compare float values bitwise. This is more strict than necessary:
deterministic too. | # LANGUAGE TypeApplications #
module Spec (tests) where
import qualified Data.IntMap as IM
import qualified Data.Map as M
import Test.Tasty (TestTree, testGroup)
import Test.Tasty.HUnit (testCaseSteps, assertFailure)
import Wasm.Text.Wast (parseWastFile)
import Wasm.Text.Winte... |
fb79500fcad8b8382bdd0f60e79f887fbc906faa550a9e45afc6b7b4d95d7c94 | hipsleek/hipsleek | layout.ml | #include "xdebug.cppo"
open VarGen
open Globals
open Format
module P = Cpure
(* the formatter that fmt_ commands will use *)
let fmt = ref (std_formatter)
let fmt_string x = pp_print_string (!fmt) x
let fmt_space x = pp_print_space (!fmt) x
let fmt_break x = pp_print_break (!fmt) x
let fmt_cut x = pp_print_cut (!fmt... | null | https://raw.githubusercontent.com/hipsleek/hipsleek/596f7fa7f67444c8309da2ca86ba4c47d376618c/bef_indent/layout.ml | ocaml | the formatter that fmt_ commands will use
shorter op code used internally
op code that will be printed
this command will add a bracket around e if
is simple yields false
print op and a break after
print op and a break before
let pr_list x = pr_list_sep fmt_space x;;
let pr_list_comma x = pr_list_sep (... | #include "xdebug.cppo"
open VarGen
open Globals
open Format
module P = Cpure
let fmt = ref (std_formatter)
let fmt_string x = pp_print_string (!fmt) x
let fmt_space x = pp_print_space (!fmt) x
let fmt_break x = pp_print_break (!fmt) x
let fmt_cut x = pp_print_cut (!fmt) x
let fmt_open_box n = pp_open_box (!fmt) n
l... |
f5f5de17e351497672763b2fe83655dc932fdc92de39b831b5fa6660a8b24fc2 | bgusach/exercises-htdp2e | ex-224.rkt | #lang htdp/bsl+
(require 2htdp/image)
(require 2htdp/universe)
(require test-engine/racket-tests)
# # # Constants
(define BACKGROUND-W 500)
(define BACKGROUND-H 500)
(define GROUND-H (/ BACKGROUND-H 3))
(define GROUND (rectangle BACKGROUND-W GROUND-H "solid" "khaki"))
(define BACKGROUND
(overlay/align
"mi... | null | https://raw.githubusercontent.com/bgusach/exercises-htdp2e/c4fd33f28fb0427862a2777a1fde8bf6432a7690/ex-224.rkt | racket | sUFO is a Posn
interpretation (make-posn x y): UFO's location
a Tank is a structure: (make-tank Number Number)
interpretation (make-tank x dx):
position (x, BACKGROUND-H)
speed dx pixels/tick
where x, y are its coordinates
- '()
Interpretation: missiles in the air
the tank and the missiles in the air
S... | #lang htdp/bsl+
(require 2htdp/image)
(require 2htdp/universe)
(require test-engine/racket-tests)
# # # Constants
(define BACKGROUND-W 500)
(define BACKGROUND-H 500)
(define GROUND-H (/ BACKGROUND-H 3))
(define GROUND (rectangle BACKGROUND-W GROUND-H "solid" "khaki"))
(define BACKGROUND
(overlay/align
"mi... |
d45a40c78c3db3d1707a211a82ccbc9c67630944999b78d5c1addd3fd8d39f46 | xinhaoyuan/morpheus | sandbox_firedrill_test.erl | -module(sandbox_firedrill_test).
-include_lib("eunit/include/eunit.hrl").
-include_lib("firedrill/include/firedrill.hrl").
-compile(export_all).
all_test_() ->
[ ?_test( dummy )
, ?_test( t_basic() )
, ?_test( t_scoped_weight() )
, {timeout, 20, ?_test( t_bootstrap_with_rapos() )}
].
t_basic() -... | null | https://raw.githubusercontent.com/xinhaoyuan/morpheus/a402f816a33fb5020d56f3b3e708e3835bebf23a/test/sandbox_firedrill_test.erl | erlang | -module(sandbox_firedrill_test).
-include_lib("eunit/include/eunit.hrl").
-include_lib("firedrill/include/firedrill.hrl").
-compile(export_all).
all_test_() ->
[ ?_test( dummy )
, ?_test( t_basic() )
, ?_test( t_scoped_weight() )
, {timeout, 20, ?_test( t_bootstrap_with_rapos() )}
].
t_basic() -... | |
98e1ff4d692cc15fefe8b014c6ff335b95f94412c531ecd4be5e57b34be6c0df | jeanparpaillon/erlang-dbus | dbus_list_system_services.erl | %%
2006 - 2009
@author < >
%% @doc
%%
-module(dbus_list_system_services).
-include_lib("dbus/include/dbus.hrl").
-export([test/0]).
test() ->
test([""]).
test([Name]) ->
{ok, Bus} = dbus_bus_reg:get_bus(session),
true = link(Bus),
run_test(Bus, Name),
ok = dbus_bus_reg:release_bus(B... | null | https://raw.githubusercontent.com/jeanparpaillon/erlang-dbus/a1feab01d2cdf07baf09d3761ab1175a8ce56435/demo/src/dbus_list_system_services.erl | erlang |
@doc
| 2006 - 2009
@author < >
-module(dbus_list_system_services).
-include_lib("dbus/include/dbus.hrl").
-export([test/0]).
test() ->
test([""]).
test([Name]) ->
{ok, Bus} = dbus_bus_reg:get_bus(session),
true = link(Bus),
run_test(Bus, Name),
ok = dbus_bus_reg:release_bus(Bus).
run_test... |
b4e0439c8128768681cfe82127e2cd9a23d104d2ae0d1b4953b353f01e1410eb | YoshikuniJujo/test_haskell | makeEnumVkAttachmentDescriptionFlagBits.hs | # OPTIONS_GHC -Wall -fno - warn - tabs #
module Main where
import MakeEnum
main :: IO ()
main = makeEnum''
"/usr/include/vulkan/vulkan_core.h" ["Data.Bits"]
"AttachmentDescriptionFlagBits" "VkAttachmentDescriptionFlagBits"
[("AttachmentDescriptionFlagsZero", Int 0)]
["Show", "Eq", "Storable", "Bits"]
$ "type At... | null | https://raw.githubusercontent.com/YoshikuniJujo/test_haskell/d6786680872dd8041d7994640f65449a9a6eb771/themes/gui/vulkan/try-my-vulkan/tools/makeEnumVkAttachmentDescriptionFlagBits.hs | haskell | # OPTIONS_GHC -Wall -fno - warn - tabs #
module Main where
import MakeEnum
main :: IO ()
main = makeEnum''
"/usr/include/vulkan/vulkan_core.h" ["Data.Bits"]
"AttachmentDescriptionFlagBits" "VkAttachmentDescriptionFlagBits"
[("AttachmentDescriptionFlagsZero", Int 0)]
["Show", "Eq", "Storable", "Bits"]
$ "type At... | |
dac321bda339ed3e97973084da0712dbef39283f97a0246956f20918b8667dff | VisionsGlobalEmpowerment/webchange | state.cljs | (ns webchange.admin.pages.course-view.state
(:require
[re-frame.core :as re-frame]
[re-frame.std-interceptors :as i]
[webchange.admin.routes :as routes]
[webchange.state.warehouse :as warehouse]))
(def path-to-db :course-view)
(re-frame/reg-sub
path-to-db
(fn [db]
(get db path-to-db)))
(re-... | null | https://raw.githubusercontent.com/VisionsGlobalEmpowerment/webchange/9e5cee6b88013b184cde6d53f128666b7ea895ed/src/cljs/webchange/admin/pages/course_view/state.cljs | clojure | Remove
Archive | (ns webchange.admin.pages.course-view.state
(:require
[re-frame.core :as re-frame]
[re-frame.std-interceptors :as i]
[webchange.admin.routes :as routes]
[webchange.state.warehouse :as warehouse]))
(def path-to-db :course-view)
(re-frame/reg-sub
path-to-db
(fn [db]
(get db path-to-db)))
(re-... |
486c24a48fdaf75611e60feafba1defb78b357554bb655674d7cd59b278e2d02 | lagenorhynque/clj-rest-api-and-cljs-spa-example | events.cljs | (ns todo-app.events
(:require [ajax.core :as ajax]
[day8.re-frame.http-fx]
[re-frame.core :as re-frame]
[todo-app.config :as config]
[todo-app.db :as db]
[todo-app.fx :as fx]))
(def request-defaults
{:timeout 6000
:response-format (ajax/json-response-f... | null | https://raw.githubusercontent.com/lagenorhynque/clj-rest-api-and-cljs-spa-example/d3932f89490ecdc6cae14098e91b5f4bffa07ecb/todo-app/src/main/todo_app/events.cljs | clojure | (ns todo-app.events
(:require [ajax.core :as ajax]
[day8.re-frame.http-fx]
[re-frame.core :as re-frame]
[todo-app.config :as config]
[todo-app.db :as db]
[todo-app.fx :as fx]))
(def request-defaults
{:timeout 6000
:response-format (ajax/json-response-f... | |
b977116bed75d6cad34caf397a3de0b23ebba71a46a90029fcfe7685f9ec0dce | thomasvergne/love | Types.hs | module Core.Closure.Types (module Types) where
import Core.Closure.Types.Closure as Types
import Core.Closure.Types.Pretty as Types | null | https://raw.githubusercontent.com/thomasvergne/love/4c5bd28e67567d2f1d15ec1a10864ef47af1bbd8/app/Core/Closure/Types.hs | haskell | module Core.Closure.Types (module Types) where
import Core.Closure.Types.Closure as Types
import Core.Closure.Types.Pretty as Types | |
3a4ae546b500fe0dbc7d849d56d11a1c606edd901ffe0d9bfeb0bc6423cc8564 | reasonml/reason | ocaml_identifiers.ml | (* Type names (supported with PR#2342) *)
module T = struct
type pub = unit
end
(* Value names (already supported) *)
module V = struct
let method_ = ()
end
(* Record fields *)
module R = struct
type r = { mutable method_ : int }
let foo = { method_ = 4 }
let x = foo.method_
let () = foo.method_ <- 42
... | null | https://raw.githubusercontent.com/reasonml/reason/daa11255cb4716ce1c370925251021bd6e3bd974/formatTest/unit_tests/input/ocaml_identifiers.ml | ocaml | Type names (supported with PR#2342)
Value names (already supported)
Record fields
Class names and instance variables
Class types
Virtual
Object methods
Function parameter labels
Module types
Polymorphic variants (probably ok as-is?)
Not an identifier test, but this is testing OCaml -> RE | module T = struct
type pub = unit
end
module V = struct
let method_ = ()
end
module R = struct
type r = { mutable method_ : int }
let foo = { method_ = 4 }
let x = foo.method_
let () = foo.method_ <- 42
let y = match foo with {method_} -> method_
let z = match foo with {method_=12} -> 21
end
mod... |
8fb012381a417aceed5f37651c348ca3d3f8bdef7abc55aae5bc91e40f884a52 | BoeingX/haskell-programming-from-first-principles | ShortExerciseSpec.hs | module Reader.Reader.ShortExerciseSpec where
import Test.Hspec
import Reader.Reader.ShortExercise
spec :: Spec
spec = do
describe "Test composed and fmapped" $ do
it "composed \"Julie\"" $ do
composed "Julie" `shouldBe` "EILUJ"
it "fmapped \"Chris\"" $ do
fmapped "Chris" `s... | null | https://raw.githubusercontent.com/BoeingX/haskell-programming-from-first-principles/ffb637f536597f552a4e4567fee848ed27f3ba74/test/Reader/Reader/ShortExerciseSpec.hs | haskell | module Reader.Reader.ShortExerciseSpec where
import Test.Hspec
import Reader.Reader.ShortExercise
spec :: Spec
spec = do
describe "Test composed and fmapped" $ do
it "composed \"Julie\"" $ do
composed "Julie" `shouldBe` "EILUJ"
it "fmapped \"Chris\"" $ do
fmapped "Chris" `s... | |
f0d09226bda0fbe1551e385f25a40dd934680c0458aaa83d78c9126acd747c7a | koji-kojiro/lem-pygments-colorthemes | monokai.lisp | (in-package :lem-user)
(define-color-theme "monokai" ()
(foreground "#eeeeee")
(background "#262626")
(cursor :foreground "#262626" :background "#eeeeee")
(syntax-warning-attribute :foreground "#87005f" :background "#262626")
(syntax-string-attribute :foreground "#d7d787" :background "#262626")
(syntax-com... | null | https://raw.githubusercontent.com/koji-kojiro/lem-pygments-colorthemes/f7de93ca7a68be7fb99ec48cc571e132292a6712/themes/monokai.lisp | lisp | (in-package :lem-user)
(define-color-theme "monokai" ()
(foreground "#eeeeee")
(background "#262626")
(cursor :foreground "#262626" :background "#eeeeee")
(syntax-warning-attribute :foreground "#87005f" :background "#262626")
(syntax-string-attribute :foreground "#d7d787" :background "#262626")
(syntax-com... | |
047d27197f8be8b60b9a005a33613089f46fe8e5635c5137d963404ef4592b3a | Frama-C/Frama-C-snapshot | wbox.mli | (**************************************************************************)
(* *)
This file is part of Frama - C.
(* *)
Copyright ... | null | https://raw.githubusercontent.com/Frama-C/Frama-C-snapshot/639a3647736bf8ac127d00ebe4c4c259f75f9b87/src/plugins/gui/wbox.mli | ocaml | ************************************************************************
alternatives)
... | This file is part of Frama - C.
Copyright ( C ) 2007 - 2019
CEA ( Commissariat à l'énergie atomique et aux énergies
Lesser General Public License as published by the Free Software
Foundation , v... |
cb2f3dc01255e0863210c8cea17548088e3bd85c288c888d746a74cc93763a39 | chapmanb/r-var | core.clj | (comment "
Base server class providing web routing details.
")
(ns rvar.core
(:use [compojure.core]
[hiccup.core]
[ring.util.servlet]
[rvar.templates]
[rvar.variant]
[rvar.upload]
[appengine-magic.multipart-params :only [wrap-multipart-params]])
(:require [compojure... | null | https://raw.githubusercontent.com/chapmanb/r-var/6fce17dd0460c78c3a210a95f16aacbdd70ccf0a/src/rvar/core.clj | clojure | (comment "
Base server class providing web routing details.
")
(ns rvar.core
(:use [compojure.core]
[hiccup.core]
[ring.util.servlet]
[rvar.templates]
[rvar.variant]
[rvar.upload]
[appengine-magic.multipart-params :only [wrap-multipart-params]])
(:require [compojure... | |
0e2c702f1210fad0e27aafd33bb9eb34f1ba458e41f862b0d038173d97a6eda9 | conjure-cp/conjure | Occurrence.hs | # LANGUAGE QuasiQuotes #
module Conjure.Representations.MSet.Occurrence ( msetOccurrence ) where
-- conjure
import Conjure.Prelude
import Conjure.Language
import Conjure.Representations.Internal
import Conjure.Representations.Common
msetOccurrence :: forall m . (MonadFailDoc m, NameGen m) => Representation m
msetOc... | null | https://raw.githubusercontent.com/conjure-cp/conjure/dd5a27df138af2ccbbb970274c2b8f22ac6b26a0/src/Conjure/Representations/MSet/Occurrence.hs | haskell | conjure | # LANGUAGE QuasiQuotes #
module Conjure.Representations.MSet.Occurrence ( msetOccurrence ) where
import Conjure.Prelude
import Conjure.Language
import Conjure.Representations.Internal
import Conjure.Representations.Common
msetOccurrence :: forall m . (MonadFailDoc m, NameGen m) => Representation m
msetOccurrence = ... |
04ac7b39ede480a68eb36892a9e2a5dcb31e5318fdfe818ad2a1fda5d2b72212 | Mathnerd314/stroscot | Options.hs | {-# LANGUAGE DeriveDataTypeable, PatternGuards #-}
-- | Types exposed to the user
module Development.Shake.Internal.Options(
Progress(..), Verbosity(..), Rebuild(..), Lint(..), Change(..),
ShakeOptions(..), shakeOptions,
-- Internal stuff
shakeRebuildApply, shakeAbbreviationsApply, shakeOptionsFields
... | null | https://raw.githubusercontent.com/Mathnerd314/stroscot/08b4cb638369a71e1e52fce5710a11e235e9e120/src/shake/Options.hs | haskell | # LANGUAGE DeriveDataTypeable, PatternGuards #
| Types exposed to the user
Internal stuff
allow the end user to specify that any rules run are either to be treated as clean, or as
dirty, regardless of what the build system thinks.
These assumptions only operate on files reached by the current 'Development.S... |
module Development.Shake.Internal.Options(
Progress(..), Verbosity(..), Rebuild(..), Lint(..), Change(..),
ShakeOptions(..), shakeOptions,
shakeRebuildApply, shakeAbbreviationsApply, shakeOptionsFields
) where
import Data.Data
import Data.List.Extra
import Data.Tuple.Extra
import Data.Maybe
import Dat... |
aa0a325419755ab396a0e0d002311623f2b5a23e89d9f66cc19a15503ab8a47d | realworldocaml/book | attrs.ml | open! Base
open! Ppxlib
module To_lift = struct
type 'a t = { to_lift : 'a } [@@unboxed]
end
open To_lift
let default =
Attribute.declare
"sexp.default"
Attribute.Context.label_declaration
Ast_pattern.(pstr (pstr_eval __ nil ^:: nil))
(fun x -> { to_lift = x })
;;
let drop_default =
Attribute.... | null | https://raw.githubusercontent.com/realworldocaml/book/d822fd065f19dbb6324bf83e0143bc73fd77dbf9/duniverse/ppx_sexp_conv/expander/attrs.ml | ocaml | open! Base
open! Ppxlib
module To_lift = struct
type 'a t = { to_lift : 'a } [@@unboxed]
end
open To_lift
let default =
Attribute.declare
"sexp.default"
Attribute.Context.label_declaration
Ast_pattern.(pstr (pstr_eval __ nil ^:: nil))
(fun x -> { to_lift = x })
;;
let drop_default =
Attribute.... | |
8c823a3da42dca4bad180a3996502a61c3b6905c45b8b31ce8407e26a9b9a5b8 | avh4/elm-format | FileTree.hs | module Data.FileTree
( FileTree, read, write
, doesFileExist, doesDirectoryExist
, listDirectory
) where
import Prelude hiding (read)
import Data.List.Split (splitOn)
import Data.Map.Strict (Map)
import qualified Data.Map.Strict as Map
import System.FilePath (pathSeparator, normalise)
data FileTree'... | null | https://raw.githubusercontent.com/avh4/elm-format/57f77ee0a667869ceed3a61a0f4eeaca56a3964f/elm-format-test-lib/src/Data/FileTree.hs | haskell | path descends through a file
not a directory | module Data.FileTree
( FileTree, read, write
, doesFileExist, doesDirectoryExist
, listDirectory
) where
import Prelude hiding (read)
import Data.List.Split (splitOn)
import Data.Map.Strict (Map)
import qualified Data.Map.Strict as Map
import System.FilePath (pathSeparator, normalise)
data FileTree'... |
67fac4db9a8dbc3af64a54a20c70255ff3b1841489accaeafcad9c0d5ed9db0c | mokus0/polynomial | Pretty.hs | module Bench.Pretty where
import Criterion
prettyTests :: [Benchmark]
prettyTests = []
| null | https://raw.githubusercontent.com/mokus0/polynomial/42fde2c9a72f449eeda4d534acfe64b8e92b5c27/bench/src/Bench/Pretty.hs | haskell | module Bench.Pretty where
import Criterion
prettyTests :: [Benchmark]
prettyTests = []
| |
03c87ce173bdc06f8037e140214fbf1b87f6c4b7e8006dce76d8dd7965986dec | abarbu/matplotlib-haskell | Internal.hs | # LANGUAGE FlexibleInstances , ScopedTypeVariables , FlexibleContexts , ExtendedDefaultRules , ExistentialQuantification , CPP #
-- |
Internal representations of the data . These are not API - stable
-- and may change. You can easily extend the provided bindings without relying
-- on the internals exposed here but t... | null | https://raw.githubusercontent.com/abarbu/matplotlib-haskell/5c186cb5b9e80212c92c72a68e9ebbc260d413a8/src/Graphics/Matplotlib/Internal.hs | haskell | |
and may change. You can easily extend the provided bindings without relying
on the internals exposed here but they are provided just in case.
| A handy miscellaneous function to linearly map over a range of numbers in a given number of steps
$ Basics
| The wrapper type for a matplotlib computation.
^ Resolved ... | # LANGUAGE FlexibleInstances , ScopedTypeVariables , FlexibleContexts , ExtendedDefaultRules , ExistentialQuantification , CPP #
Internal representations of the data . These are not API - stable
module Graphics.Matplotlib.Internal where
import System.IO.Temp
import System.Process
import Data.Aeson
import Control.Mon... |
5ed4068197561b239f136a692d7b8dedd6f7df53d7f9eefa23334381e3650f8e | OCamlPro/drom | main.ml | (**************************************************************************)
(* *)
Copyright ( c ) 2022 OCamlPro SAS & Origin Labs SAS
(* *)
(* All right... | null | https://raw.githubusercontent.com/OCamlPro/drom/dbbb5f9225df65c589e6f307ac28be4c408b9cae/src/toml.7.1.0/main.ml | ocaml | ************************************************************************
All rights reserved.
This file is distributed u... | Copyright ( c ) 2022 OCamlPro SAS & Origin Labs SAS
Public License version 2.1 , with the special exception on linking
let main () = Printf.printf "Hello world!\n"
|
6ff502df8ab2d45b1e8deeaeca88cec049efb5f0db88c37076b61ccac1d059ec | faylang/fay | case.hs | module Case where
main = putStrLn (case True of
True -> "Hello!"
False -> "Ney!")
| null | https://raw.githubusercontent.com/faylang/fay/8455d975f9f0db2ecc922410e43e484fbd134699/tests/case.hs | haskell | module Case where
main = putStrLn (case True of
True -> "Hello!"
False -> "Ney!")
| |
10536f2916aeb773dee1c4a766a81cb97cd7c03243ef87a49bf1f6e04459de16 | kmi/ocml | xsd-to-ocml.lisp | (in-package :ocml)
(defparameter *producer*
"<?xml version=\"1.0\" encoding=\"UTF-8\"?>
<schema xmlns=\"\" xmlns:tns=\":8080/ProducerXMLSchema\" targetNamespace=\":8080/ProducerXMLSchema\">
<complexType name=\"ProductConfirmation\">
<sequence>
<element name=\"theConfirmation\" type=\"int\"/>
<element name=... | null | https://raw.githubusercontent.com/kmi/ocml/90b0b173f588c580c26393c94f9970282c640f4d/tests/xsd-to-ocml.lisp | lisp | (in-package :ocml)
(defparameter *producer*
"<?xml version=\"1.0\" encoding=\"UTF-8\"?>
<schema xmlns=\"\" xmlns:tns=\":8080/ProducerXMLSchema\" targetNamespace=\":8080/ProducerXMLSchema\">
<complexType name=\"ProductConfirmation\">
<sequence>
<element name=\"theConfirmation\" type=\"int\"/>
<element name=... | |
14362226882273c32c4ecdc96862562232fa7606757ee1d65eff77ffa2a161cc | andorp/bead | Page.hs | {-# LANGUAGE OverloadedStrings #-}
module Bead.View.Content.Submission.Page (
submission
, resolveStatus
) where
import Control.Monad
import Control.Monad.IO.Class
import Control.Monad.Trans.Class
import qualified Data.ByteString.Char8 as B
import Data.List (intersperse,... | null | https://raw.githubusercontent.com/andorp/bead/280dc9c3d5cfe1b9aac0f2f802c705ae65f02ac2/src/Bead/View/Content/Submission/Page.hs | haskell | # LANGUAGE OverloadedStrings #
TODO: Refactor use guards
GUARD
Assignment is for the user
Password-protected assignment
Passwords do match
Passwords do not match
Non password protected assignment
Informational table on the page | module Bead.View.Content.Submission.Page (
submission
, resolveStatus
) where
import Control.Monad
import Control.Monad.IO.Class
import Control.Monad.Trans.Class
import qualified Data.ByteString.Char8 as B
import Data.List (intersperse, partition)
import Data.M... |
0419e858c3d37547b4220d0512274c15e5bd99700da97a9a94ef1c93cb17079d | dbenoit17/dynamic-ffi | typedef-struct.rkt | #lang at-exp racket/base
(require "../unsafe.rkt")
@define-inline-ffi[struct-test]{
#include <stdlib.h>
#include <stdio.h>
#include <stdint.h>
typedef struct {
char *name;
uint64_t value;
} number;
char* names[] = {"zero", "one", "two", "three", "four", "five", "six"
"seven", "ei... | null | https://raw.githubusercontent.com/dbenoit17/dynamic-ffi/c82f5cb25932e9cab31844569b1364e23a02f205/test/typedef-struct.rkt | racket |
demonstrate using _list-structs | #lang at-exp racket/base
(require "../unsafe.rkt")
@define-inline-ffi[struct-test]{
#include <stdlib.h>
#include <stdio.h>
#include <stdint.h>
typedef struct {
char* names[] = {"zero", "one", "two", "three", "four", "five", "six"
number add(number a, number b) {
if (c.value >12) {
}
}
}
(def... |
4fff656162697bdb0c2b12118f50997e9f5a6d955d96fac31ea131e6bd2f2d53 | timbertson/passe | static.ml | open Passe
open Lwt
open Rresult
open Common
open Astring
module Log = (val Logging.log_module "static")
module type Sig = sig
type t
type key
val key : string list -> (key, Error.t) result
val read_s : t -> key
-> ((string, Error.t) result Lwt_stream.t -> ('a, Error.t) result Lwt.t)
-> ('a option, Error.t) r... | null | https://raw.githubusercontent.com/timbertson/passe/a0aa00695022657a222ea06a4796da36141aaa1a/src/server/static.ml | ocaml | open Passe
open Lwt
open Rresult
open Common
open Astring
module Log = (val Logging.log_module "static")
module type Sig = sig
type t
type key
val key : string list -> (key, Error.t) result
val read_s : t -> key
-> ((string, Error.t) result Lwt_stream.t -> ('a, Error.t) result Lwt.t)
-> ('a option, Error.t) r... | |
0839eb5bd9d389145141b4c552a60d1a3fe888b1478e048fc39dd928d43f4ceb | dalaing/websockets-reflex | Main.hs | {-# LANGUAGE RankNTypes #-}
# LANGUAGE TypeFamilies #
# LANGUAGE FlexibleContexts #
# LANGUAGE RecursiveDo #
{-# LANGUAGE OverloadedStrings #-}
module Main where
import Control.Monad (void)
import Control.Monad.Trans (MonadIO, liftIO)
import Network.WebSockets
import Control.Concurrent.STM
import qualified Data.Byt... | null | https://raw.githubusercontent.com/dalaing/websockets-reflex/65bee7560442f5aae96f6f64fb12abeb501f5427/other-example/server/Main.hs | haskell | # LANGUAGE RankNTypes #
# LANGUAGE OverloadedStrings # | # LANGUAGE TypeFamilies #
# LANGUAGE FlexibleContexts #
# LANGUAGE RecursiveDo #
module Main where
import Control.Monad (void)
import Control.Monad.Trans (MonadIO, liftIO)
import Network.WebSockets
import Control.Concurrent.STM
import qualified Data.ByteString as B
import qualified Data.ByteString.Char8 as BC
impo... |
9dab75f72009971e76fe7e0ac02ab6a6af8d27061d10c9048a8c3726ab3cb86b | ecraven/r7rs-benchmarks | tak.scm | TAK -- A vanilla version of the TAKeuchi function .
(import (scheme base) (scheme read) (scheme write) (scheme time))
(define (tak x y z)
(if (not (< y x))
z
(tak (tak (- x 1) y z)
(tak (- y 1) z x)
(tak (- z 1) x y))))
(define (run-benchmark)
(let* ((count (read))
(i... | null | https://raw.githubusercontent.com/ecraven/r7rs-benchmarks/b0910c4759629fcd2fb84a323a4eeef3b6ffc6bf/src/tak.scm | scheme | TAK -- A vanilla version of the TAKeuchi function .
(import (scheme base) (scheme read) (scheme write) (scheme time))
(define (tak x y z)
(if (not (< y x))
z
(tak (tak (- x 1) y z)
(tak (- y 1) z x)
(tak (- z 1) x y))))
(define (run-benchmark)
(let* ((count (read))
(i... | |
aaa4971b675332edeb0bcd0c3235654119eda44f524b50be2f26bbf8a453603e | vikram/lisplibraries | html.lisp | -*- Mode : LISP ; Syntax : COMMON - LISP ; Package : TBNL ; Base : 10 -*-
$ Header : /usr / local / cvsrep / tbnl / html.lisp , v 1.31 2006/09/20 19:37:45 edi Exp $
Copyright ( c ) 2004 - 2006 , Dr. . All rights reserved .
;;; Redistribution and use in source and binary forms, with or without
;;; modification... | null | https://raw.githubusercontent.com/vikram/lisplibraries/105e3ef2d165275eb78f36f5090c9e2cdd0754dd/site/tbnl-0.11.4/html.lisp | lisp | Syntax : COMMON - LISP ; Package : TBNL ; Base : 10 -*-
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 conditions and the foll... | $ Header : /usr / local / cvsrep / tbnl / html.lisp , v 1.31 2006/09/20 19:37:45 edi Exp $
Copyright ( c ) 2004 - 2006 , Dr. . All rights reserved .
DIRECT , INDIRECT , INCIDENTAL , SPECIAL , EXEMPLARY , OR CONSEQUENTIAL
INTERRUPTION ) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY ,
(in-package #:tbnl)
... |
489693d9d54605114514f0f588395c13727b116a815c3de0ab81d599c4a44406 | kadena-io/chainweaver | Password.hs | # LANGUAGE DataKinds #
# LANGUAGE FlexibleContexts #
# LANGUAGE GeneralizedNewtypeDeriving #
# LANGUAGE LambdaCase #
{-# LANGUAGE OverloadedStrings #-}
# LANGUAGE RecursiveDo #
# LANGUAGE ScopedTypeVariables #
# LANGUAGE TypeApplications #
# LANGUAGE TypeFamilies #
module Frontend.Setup.Password where
import Reflex.D... | null | https://raw.githubusercontent.com/kadena-io/chainweaver/228e28e314f015c2eda662faf795d95e170c2b4c/frontend/src/Frontend/Setup/Password.hs | haskell | # LANGUAGE OverloadedStrings # | # LANGUAGE DataKinds #
# LANGUAGE FlexibleContexts #
# LANGUAGE GeneralizedNewtypeDeriving #
# LANGUAGE LambdaCase #
# LANGUAGE RecursiveDo #
# LANGUAGE ScopedTypeVariables #
# LANGUAGE TypeApplications #
# LANGUAGE TypeFamilies #
module Frontend.Setup.Password where
import Reflex.Dom.Core
import Reflex.Dom.Core
impo... |
111dd509143169663da3d759491ad86ddf97672fa5a70197e645a50e402e1f4f | flybot-sg/Pastoral | db.cljc | Copyright ( c ) 2018 Flybot Pte Ltd , Singapore .
;;
This file is distributed under the Eclipse Public License , the same as
Clojure .
(ns pastoral.db)
;; -- Application State --------------------------------------------------------------------------
;;
;; Should not be accessed directly by application code.
;... | null | https://raw.githubusercontent.com/flybot-sg/Pastoral/c0bfb0e083e7fee22cb242d03768fc8a72598683/src/pastoral/db.cljc | clojure |
-- Application State --------------------------------------------------------------------------
Should not be accessed directly by application code.
Read access goes through reconciler.
Updates via event handlers. | Copyright ( c ) 2018 Flybot Pte Ltd , Singapore .
This file is distributed under the Eclipse Public License , the same as
Clojure .
(ns pastoral.db)
(def app-db (atom {}))
|
bc822b1602909588691917fe32f2b61ca20ef11c77e6a61b808e65ea0eadda86 | txyyss/Project-Euler | Euler075.hs | It turns out that 12 cm is the smallest length of wire that can be
bent to form an integer sided right angle triangle in exactly one
-- way, but there are many more examples.
12 cm : ( 3,4,5 )
24 cm : ( 6,8,10 )
30 cm : ( 5,12,13 )
36 cm : ( 9,12,15 )
40 cm : ( 8,15,17 )
48 cm : ( 12,16,20 )
In cont... | null | https://raw.githubusercontent.com/txyyss/Project-Euler/d2f41dad429013868445c1c9c1c270b951550ee9/Euler075.hs | haskell | way, but there are many more examples.
form an integer sided right angle triangle, and other lengths allow
triangles.
formed? | It turns out that 12 cm is the smallest length of wire that can be
bent to form an integer sided right angle triangle in exactly one
12 cm : ( 3,4,5 )
24 cm : ( 6,8,10 )
30 cm : ( 5,12,13 )
36 cm : ( 9,12,15 )
40 cm : ( 8,15,17 )
48 cm : ( 12,16,20 )
In contrast , some lengths of wire , like 20 cm ,... |
081e30d71a577e00eb2705453eeb995177817cc0b5e6afcde1b77caf1b2830db | victorvianna/mini-gcc | parser.mli |
(* The type of tokens. *)
type token =
| WHILE
| VERTICALBARVERTICALBAR
| STRUCT
| STAR
| SLASH
| SIZEOF
| SEMICOLON
| RPAR
| RETURN
| RBRACE
| PLUS
| MINUS
| LPAR
| LBRACE
| INTEGER of (int32)
| INT
| IF
| IDENT of (string)
| EQOP of (Ptree.binop)
| EQ
| EOF
| ELSE
| COM... | null | https://raw.githubusercontent.com/victorvianna/mini-gcc/04659816d0a1097ae12b57243572fff9e91c0b13/parser.mli | ocaml | The type of tokens.
This exception is raised by the monolithic API functions.
The monolithic API. |
type token =
| WHILE
| VERTICALBARVERTICALBAR
| STRUCT
| STAR
| SLASH
| SIZEOF
| SEMICOLON
| RPAR
| RETURN
| RBRACE
| PLUS
| MINUS
| LPAR
| LBRACE
| INTEGER of (int32)
| INT
| IF
| IDENT of (string)
| EQOP of (Ptree.binop)
| EQ
| EOF
| ELSE
| COMP of (Ptree.binop)
| COM... |
35953aada27cf81f0f03e3040dc05604bd24af8e8ed25f26275a516d266a90b6 | cbaggers/rtg-math | docs.lisp | (in-package :rtg-math.polar)
;;----------------------------------------------------------------
(docs:define-docs
(defun cartesian->polar
"Takes a cartesian `vec2` and converts it to a polar coord vector with the layout (θ r).
Notes:
r - length of υ
θ - angle between υ and y axis
θ>0 means counter-clockwise ... | null | https://raw.githubusercontent.com/cbaggers/rtg-math/29fc5b3d0028a4a11a82355ecc8cca62662c69e0/polar-coords/docs.lisp | lisp | ---------------------------------------------------------------- | (in-package :rtg-math.polar)
(docs:define-docs
(defun cartesian->polar
"Takes a cartesian `vec2` and converts it to a polar coord vector with the layout (θ r).
Notes:
r - length of υ
θ - angle between υ and y axis
θ>0 means counter-clockwise rotation
")
(defun cartesian->polar
"
Takes a polar coord v... |
4aeff136b45fe1bab019e768fe79fb4cf83732450fe2b18f605e57345f6044f4 | viercc/kitchen-sink-hs | Queue.hs | # LANGUAGE DeriveFunctor #
{-# LANGUAGE RankNTypes #-}
{-# LANGUAGE BangPatterns #-}
module Control.Monad.Queue(
Queue(),
getLength,
offer,
offer1,
poll,
poll1,
peek,
traceQueue,
evalQueue,
execQueue,
runQueue
) where
import Data.Foldable
import Data.Functor.Identity
import... | null | https://raw.githubusercontent.com/viercc/kitchen-sink-hs/5038b17a39e4e6f19e6fb4779a7c8aaddf64d922/monads-collection/src/Control/Monad/Queue.hs | haskell | # LANGUAGE RankNTypes #
# LANGUAGE BangPatterns #
| Get the current length of the queue.
| Add items to the right side of the queue.
then return removed items in order.
If the length of the queue is smaller than @m@, it removes
all remaining items.
without removing them.
If the length of the queue is s... | # LANGUAGE DeriveFunctor #
module Control.Monad.Queue(
Queue(),
getLength,
offer,
offer1,
poll,
poll1,
peek,
traceQueue,
evalQueue,
execQueue,
runQueue
) where
import Data.Foldable
import Data.Functor.Identity
import Control.Monad
newtype Queue c a =
Queue { unQueue ::... |
0b370758a7e1ffac2ba3e2631d10a9ef058cb2b88537638d339d208baa0a4d46 | isovector/algebra-driven-design | Efficient.hs | # LANGUAGE BangPatterns #
# LANGUAGE DeriveFunctor #
{-# LANGUAGE DerivingVia #-}
{-# LANGUAGE FlexibleContexts #-}
# LANGUAGE GADTs #
# LANGUAGE MonoLocalBinds #
{-# LANGUAGE PatternSynonyms #-}
# LANGUAGE QuantifiedConstraints #
{-# LANGUAGE TypeSynonym... | null | https://raw.githubusercontent.com/isovector/algebra-driven-design/eeab5a07cf0ef8f816c9f88aeb6ca5cabc12bd18/code/Tiles/Efficient.hs | haskell | # LANGUAGE DerivingVia #
# LANGUAGE FlexibleContexts #
# LANGUAGE PatternSynonyms #
# LANGUAGE TypeSynonymInstances #
----------------------------------------------------------------------------
# COMPLETE Color #
# ArbitraryTile
-------------------------------------------------------------------... | # LANGUAGE BangPatterns #
# LANGUAGE DeriveFunctor #
# LANGUAGE GADTs #
# LANGUAGE MonoLocalBinds #
# LANGUAGE QuantifiedConstraints #
# OPTIONS_GHC -fno - warn - orphans #
module Tiles.Efficient where
import qualified Codec.Picture.Metadata as MD
import Codec.P... |
6bf040c6fa78c021f4be96e2b0a368b10c2fab218d08e062965e7bb33d6dd6fa | abdulapopoola/SICPBook | Ex1.35.scm | #lang planet neil/sicp
;; x -> 1 + 1/x is equivalent to
;; x^2 -> x + 1 which is the golden ratio
(define tolerance 0.00001)
(define (fixed-point f first-guess)
(define (close-enough? v1 v2)
(< (abs (- v1 v2)) tolerance))
(define (try guess)
(let ((next (f guess)))
(if (close-enough? next guess)
... | null | https://raw.githubusercontent.com/abdulapopoola/SICPBook/c8a0228ebf66d9c1ddc5ef1fcc1d05d8684f090a/Chapter%201/1.3/Ex1.35.scm | scheme | x -> 1 + 1/x is equivalent to
x^2 -> x + 1 which is the golden ratio | #lang planet neil/sicp
(define tolerance 0.00001)
(define (fixed-point f first-guess)
(define (close-enough? v1 v2)
(< (abs (- v1 v2)) tolerance))
(define (try guess)
(let ((next (f guess)))
(if (close-enough? next guess)
next
(try next))))
(try first-guess))
(fixed-point (la... |
c2d418d25d471eba0ee14660e11ab40eab597eb234034167f3fe9d25d3727973 | Plutonomicon/plutarch-plutus | Reducible.hs | # LANGUAGE UndecidableInstances #
FIXME : This should be its own package as it 's not related to Plutarch at all .
module Plutarch.Reducible (Reduce, NoReduce (..), reduce) where
import Data.Coerce (Coercible, coerce)
import Data.Kind (Type)
import GHC.Generics (C1, D1, Rec0, Rep, S1, pattern MetaData)
import Pluta... | null | https://raw.githubusercontent.com/Plutonomicon/plutarch-plutus/d3df05ce67d8b5a3d2ca851a6e5a1b8ff8cb358f/Plutarch/Reducible.hs | haskell | newtype
data | # LANGUAGE UndecidableInstances #
FIXME : This should be its own package as it 's not related to Plutarch at all .
module Plutarch.Reducible (Reduce, NoReduce (..), reduce) where
import Data.Coerce (Coercible, coerce)
import Data.Kind (Type)
import GHC.Generics (C1, D1, Rec0, Rep, S1, pattern MetaData)
import Pluta... |
faf5ac4c86db21d0aa9ccd3451d405b638ac12c74ccd753cf8831bfe357ab220 | maxigit/sql-fragment | SQLFragment.hs | | SQLFragment is a type safe SQL combinator based on the idea that , a SQL query
* is a monoid
* joins can be deduced automatically from an join graph .
SQLFragment main intent is to allow to build easily complex query by reusing and combining pre - made fragments ( which can be typed or typeless ) .
This is... | null | https://raw.githubusercontent.com/maxigit/sql-fragment/01b91ac3bdbbf437d43018b0d68fd9428d6239fd/src/Database/SQLFragment.hs | haskell | * Example
$example
* Documentation | | SQLFragment is a type safe SQL combinator based on the idea that , a SQL query
* is a monoid
* joins can be deduced automatically from an join graph .
SQLFragment main intent is to allow to build easily complex query by reusing and combining pre - made fragments ( which can be typed or typeless ) .
This is... |
9f0ab24317bc0f8bbce0030b49424a2ce9329886d0ae170cef38f67ac4bfc0cf | pjstadig/assertions | assertions.clj | Copyright © 2013 . All rights reserved .
;;;;
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 /.
;;;;
This Source Code Form is " Incompatible With Secondary Licenses " , as defined
by the... | null | https://raw.githubusercontent.com/pjstadig/assertions/796ca4c6b8c3002f73607783a0e136f14cdf17b5/src/pjstadig/assertions.clj | clojure | Copyright © 2013 . All rights reserved .
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 /.
This Source Code Form is " Incompatible With Secondary Licenses " , as defined
by the Mozilla P... | |
7b5e66874c94013607ec6967728e40f40dcc0cfa9bf86bad6df8fa846139ad4e | autotaker/smopeck | ParserSpec.hs | # LANGUAGE DataKinds #
module Smopeck.Spec.ParserSpec where
import Smopeck.Spec.Lexer
import Smopeck.Spec.Parser
import qualified Smopeck.Spec.Syntax as Syntax
import Smopeck.Spec.Syntax hiding (And, Eq, Gt, Lt, Match, Or)
import qualified Smopeck.Spec.TypeExp as T
import Test... | null | https://raw.githubusercontent.com/autotaker/smopeck/d68a16e413a836c62a85d0f55707ef228c9d17ab/test/Smopeck/Spec/ParserSpec.hs | haskell | type Sample = String
endpoint "/" GET {}
str(x)
Json { name : String }
Json { Name: String }
Json { 'Content-Type' : String }
String [ . =~ r'[a-z]*' ] | # LANGUAGE DataKinds #
module Smopeck.Spec.ParserSpec where
import Smopeck.Spec.Lexer
import Smopeck.Spec.Parser
import qualified Smopeck.Spec.Syntax as Syntax
import Smopeck.Spec.Syntax hiding (And, Eq, Gt, Lt, Match, Or)
import qualified Smopeck.Spec.TypeExp as T
import Test... |
978fdf7bb71027f4796bfd4c65e6fd3fe79cc03b3eedd4992c22bae544108928 | awslabs/s2n-bignum | bignum_neg_sm2.ml |
* Copyright Amazon.com , Inc. or its affiliates . All Rights Reserved .
* SPDX - License - Identifier : Apache-2.0 OR ISC
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0 OR ISC
*)
(* =================================================================... | null | https://raw.githubusercontent.com/awslabs/s2n-bignum/6b53f075a0e28e6b89db12301de5f59ec788855c/arm/proofs/bignum_neg_sm2.ml | ocaml | =========================================================================
Negation mod p_sm2, field characteristic for CC SM2 curve.
=========================================================================
*** print_literal_from_elf "arm/sm2/bignum_neg_sm2.o";;
***
arm_CSETM X2 Condition_NE
--... |
* Copyright Amazon.com , Inc. or its affiliates . All Rights Reserved .
* SPDX - License - Identifier : Apache-2.0 OR ISC
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0 OR ISC
*)
let bignum_neg_sm2_mc = define_assert_from_elf "bignum_neg_sm2_mc"... |
3d4dd043ab8d01a2373e03e11de19b80dd0907dc61deffb4fe70d3818088ba66 | kaos/ecapnp | ecapnp_get.erl | %%
Copyright 2013 , < >
%%
Licensed under the Apache License , Version 2.0 ( the " License " ) ;
%% you may not use this file except in compliance with the License.
%% You may obtain a copy of the License at
%%
%% -2.0
%%
%% Unless required by applicable law or agreed to in writing, software
dis... | null | https://raw.githubusercontent.com/kaos/ecapnp/f351c07730ba134b41b137dd6a6b93069a0908fc/src/ecapnp_get.erl | erlang |
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
-2.0
Unless required by applicable law or agreed to in writing, software
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language gov... | Copyright 2013 , < >
Licensed under the Apache License , Version 2.0 ( the " License " ) ;
distributed under the License is distributed on an " AS IS " BASIS ,
2013 ,
@author < >
-module(ecapnp_get).
-author("Andreas Stenius <>").
-export([root/2, root/3, field/2, union/1, ref_data/2, ref_dat... |
c0bce62ec862493053ddd218d11af04220849d8c60a3c784864096846da9a545 | mabragor/cg-llvm | types-macros.lisp |
(in-package #:cg-llvm)
(enable-read-macro-tokens)
(define-esrap-env cg-llvm)
| null | https://raw.githubusercontent.com/mabragor/cg-llvm/4a8375316d8ebf36125929c5d1a872721099d29c/src/types-macros.lisp | lisp |
(in-package #:cg-llvm)
(enable-read-macro-tokens)
(define-esrap-env cg-llvm)
| |
b1c6c2c3f32fa231d42935a586dc6c74f3ec14db1202c4af882a93949dbcbc0a | composewell/streamly | StreamDK.hs | # OPTIONS_GHC -Wno - deprecations #
-- |
Module : Streamly . Benchmark . Data . Stream . StreamDK
Copyright : ( c ) 2018 Composewell Technologies
--
-- License : BSD3
-- Maintainer :
# LANGUAGE FlexibleContexts #
# LANGUAGE ScopedTypeVariables #
module Main (main) where
import Control . ( when... | null | https://raw.githubusercontent.com/composewell/streamly/5327f181db2cf956461b74ed50720eebf119f25a/benchmark/Streamly/Benchmark/Data/Stream/StreamDK.hs | haskell | |
License : BSD3
Maintainer :
import qualified Data.List as List
value2, value3, value16, maxValue :: Int
value2 = round (P.fromIntegral value**(1/2::P.Double)) -- double nested loop
value3 = round (P.fromIntegral value**(1/3::P.Double)) -- triple nested loop
value16 = round (P.fromIntegral value**(1/16::P.... | # OPTIONS_GHC -Wno - deprecations #
Module : Streamly . Benchmark . Data . Stream . StreamDK
Copyright : ( c ) 2018 Composewell Technologies
# LANGUAGE FlexibleContexts #
# LANGUAGE ScopedTypeVariables #
module Main (main) where
import Control . ( when )
import Data . Maybe ( isJust )
import Prelu... |
dc2cc1daa74221292f9f2e1ccc7dedfa1478db659c09d9df384efdd48518144a | digitallyinduced/ihp-forum | Index.hs | module Admin.View.UserBadges.Index where
import Admin.View.Prelude
import Application.Helper.View
data IndexView = IndexView { userBadges :: [Include "userId" UserBadge] }
instance View IndexView where
html IndexView { .. } = [hsx|
<nav>
<ol class="breadcrumb">
<li class="bread... | null | https://raw.githubusercontent.com/digitallyinduced/ihp-forum/d71975ffd0439d27a69acb184431fb1b48796b15/Admin/View/UserBadges/Index.hs | haskell | module Admin.View.UserBadges.Index where
import Admin.View.Prelude
import Application.Helper.View
data IndexView = IndexView { userBadges :: [Include "userId" UserBadge] }
instance View IndexView where
html IndexView { .. } = [hsx|
<nav>
<ol class="breadcrumb">
<li class="bread... | |
0e6f27a80fbad9dfb04fa661c42054edb64719997125745efa3dfeb5d2f28dbb | Dlackware/dlackware | Process.hs | module Slackware.Process
( outErrProcess
, runSlackBuild
) where
import Conduit (ConduitM, (.|), runConduit, sourceHandle)
import Control.Monad.IO.Class (liftIO)
import Data.ByteString.Char8 as C8
import Data.Void (Void)
import GHC.IO.Handle (Handle, hClose)
import System.Environment (getEnvironment)
impor... | null | https://raw.githubusercontent.com/Dlackware/dlackware/aa81eec441ad639c930ad96e02e6daf625153b38/src/Slackware/Process.hs | haskell | module Slackware.Process
( outErrProcess
, runSlackBuild
) where
import Conduit (ConduitM, (.|), runConduit, sourceHandle)
import Control.Monad.IO.Class (liftIO)
import Data.ByteString.Char8 as C8
import Data.Void (Void)
import GHC.IO.Handle (Handle, hClose)
import System.Environment (getEnvironment)
impor... | |
4a4ba31ff1b9b09b17f84667a5164ecfb09f0f801235615ca1f43c1f35c61d81 | BranchTaken/Hemlock | containerIntf.ml | (** Container functor signatures. *)
open RudimentsInt0
(** Folding functor input interface for monomorphic containers, e.g. {!type:string}. *)
module type IMonoFold = sig
type t
(** Container type. *)
type elm
(** Element type. *)
val fold_until: init:'accum -> f:('accum -> elm -> 'accum * bool) -> t -> ... | null | https://raw.githubusercontent.com/BranchTaken/Hemlock/7a3facdc0a30fa72bc4c95f3abed6117c30de497/bootstrap/src/basis/containerIntf.ml | ocaml | * Container functor signatures.
* Folding functor input interface for monomorphic containers, e.g. {!type:string}.
* Container type.
* Element type.
* Iterating functor input interface for monomorphic containers, e.g. {!type:string}.
* Container type.
* Element type.
* Indexing functor input interface for monomo... |
open RudimentsInt0
module type IMonoFold = sig
type t
type elm
val fold_until: init:'accum -> f:('accum -> elm -> 'accum * bool) -> t -> 'accum
* [ fold_until ~init ~f t ] folds [ t ] from left to right , using [ init ] as the initial accumulator
value , continuing until [ f ] returns [ accum , true ]... |
12909214c1198de1dfed83d97e2e3078cfdec39d661defb6cbb638683cf62c33 | Chream/mockingbird | methods.lisp | ;;;; mockingbird/src/with-methods.lisp
(in-package :cl-user)
(uiop:define-package :mockingbird/src/methods
(:use :closer-common-lisp)
(:mix :fare-utils
:uiop
:alexandria)
(:import-from :closer-mop
:compute-applicable-methods-using-classes
:method-specializers)
... | null | https://raw.githubusercontent.com/Chream/mockingbird/bf56e15faf8684fb96bd8094bd76c2d1b966c0ae/src/methods.lisp | lisp | mockingbird/src/with-methods.lisp
Mop extensions
; ;
Remove originals.
Add stub methods.
Remove stub methods.
Add original methods.
; ;
; ;
unsafe?
Conditions. ;;;
|
(in-package :cl-user)
(uiop:define-package :mockingbird/src/methods
(:use :closer-common-lisp)
(:mix :fare-utils
:uiop
:alexandria)
(:import-from :closer-mop
:compute-applicable-methods-using-classes
:method-specializers)
(:import-from :mockingbird/src/functio... |
3210a9ce035410f9d27dd5f8d8ad5f0068bfb977578916071974473e54405ac1 | ammarhakim/gkylcas | basisTensor1x2v.lisp | ;;; -*- Mode: LISP; package:maxima; syntax:common-lisp; -*-
(in-package :maxima)
(DSKSETQ |$varsC| '((MLIST SIMP) $X))
(ADD2LNC '|$varsC| $VALUES)
(DSKSETQ |$varsP| '((MLIST SIMP) $X $VX $VY))
(ADD2LNC '|$varsP| $VALUES)
(DSKSETQ |$basisC|
'((MLIST SIMP
(10.
"/Users/JunoRavin/gkyl... | null | https://raw.githubusercontent.com/ammarhakim/gkylcas/1f8adad4f344ce8e3663451e16fdf1c32107ceed/maxima/g2/basis-precalc/basisTensor1x2v.lisp | lisp | -*- Mode: LISP; package:maxima; syntax:common-lisp; -*- | (in-package :maxima)
(DSKSETQ |$varsC| '((MLIST SIMP) $X))
(ADD2LNC '|$varsC| $VALUES)
(DSKSETQ |$varsP| '((MLIST SIMP) $X $VX $VY))
(ADD2LNC '|$varsP| $VALUES)
(DSKSETQ |$basisC|
'((MLIST SIMP
(10.
"/Users/JunoRavin/gkyl/cas-scripts/basis-precalc/basis-pre-calc.mac"
S... |
a3fe92dfb2c82b5a303b93933641f5c5f053ef5f026dc15913c9c107513d36d4 | fractalide/fractalide | load-graph.rkt | #lang racket/base
(require racket/list)
(require fractalide/modules/rkt/rkt-fbp/agent)
(require fractalide/modules/rkt/rkt-fbp/graph)
; (-> agent graph)
(define (get-graph agent input output)
(send (output "ask-graph") agent)
(recv (input "ask-graph")))
( - ( Listof agent ) graph String graph )
(define (flat-g... | null | https://raw.githubusercontent.com/fractalide/fractalide/9c54ec2615fcc2a1f3363292d4eed2a0fcb9c3a5/modules/rkt/rkt-fbp/agents/fvm/load-graph.rkt | racket | (-> agent graph)
True -> End of the flat part
False -> Visit the next node
It's a sub-graph. Get the new graph, add the nodes in not-visited, save the virtual port and save the rest of the graph
Add the agents in the not-visited list
add the virtual port
add the edges
It's a normal agent, do nothing and go for ... | #lang racket/base
(require racket/list)
(require fractalide/modules/rkt/rkt-fbp/agent)
(require fractalide/modules/rkt/rkt-fbp/graph)
(define (get-graph agent input output)
(send (output "ask-graph") agent)
(recv (input "ask-graph")))
( - ( Listof agent ) graph String graph )
(define (flat-graph actual-graph i... |
3130685ada8452681d8e08402bc2ac270e82fe6f8d3c22260621c2daaed49ca1 | peti/funcmp | Picture.hs | |
Module : FMP.Picture
Copyright : ( c ) 2003 - 2010 ( c ) 2002 - 2003 ( c ) 2002 - 2003 Meik Hellmund
( c ) 1998 - 2002 ( c ) 1998 - 2002 Joachim Korittky
( c ) 1998 - 2002
License :
Maintainer :
Stability : pr... | null | https://raw.githubusercontent.com/peti/funcmp/1f6713a273b57b8b60b19958420748daf65d35af/FMP/Picture.hs | haskell | .),
.
----------------- Picture ---------------------
---------------------------------------------------------------
---- Transformations ---------
--- Paths -----
----Arrows -----------------
---------------------
------------------ Pfade --------------
------------------------
------------------------
--------------... | |
Module : FMP.Picture
Copyright : ( c ) 2003 - 2010 ( c ) 2002 - 2003 ( c ) 2002 - 2003 Meik Hellmund
( c ) 1998 - 2002 ( c ) 1998 - 2002 Joachim Korittky
( c ) 1998 - 2002
License :
Maintainer :
Stability : pr... |
f58ecf98ea860e917a260d5b1153e344eabb9a2fcb7334986a258d4a782c111c | openmusic-project/openmusic | pack-om.lisp | ;=========================================================================
OpenMusic : Visual Programming Language for Music Composition
;
Copyright ( c ) 1997- ... IRCAM - Centre , Paris , France .
;
This file is part of the OpenMusic environment sources
;
OpenMusic is free software : you can redist... | null | https://raw.githubusercontent.com/openmusic-project/openmusic/9560c064512a1598cd57bcc9f0151c0815178e6f/OPENMUSIC/build/pack-om.lisp | lisp | =========================================================================
(at your option) any later version.
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
=================... | OpenMusic : Visual Programming Language for Music Composition
Copyright ( c ) 1997- ... IRCAM - Centre , Paris , France .
This file is part of the OpenMusic environment sources
OpenMusic is free software : you can redistribute it and/or modify
it under the terms of the GNU General Public License ... |
1a5bd1f104f189e1671218e36b6a4fc713d93aff4c45db3105d55eff027265ca | HealthSamurai/stresty | gen.clj | (ns stresty.operations.gen
(:require [clojure.string :as str])
(:import
(java.io File)
(java.nio.file Files Path Paths OpenOption FileVisitOption LinkOption)
(java.nio.file.attribute FileAttribute)
(java.net URI)))
(set! *warn-on-reflection* true)
(defn get-path [ns]
(->> (str/split ns #"\.")
... | null | https://raw.githubusercontent.com/HealthSamurai/stresty/f27934ec164a0d747306f15e28396b8105fabe20/src/stresty/operations/gen.clj | clojure | :basic-auth {:user \"user?\" :password \"password?\"}
:auth-token \"????\" | (ns stresty.operations.gen
(:require [clojure.string :as str])
(:import
(java.io File)
(java.nio.file Files Path Paths OpenOption FileVisitOption LinkOption)
(java.nio.file.attribute FileAttribute)
(java.net URI)))
(set! *warn-on-reflection* true)
(defn get-path [ns]
(->> (str/split ns #"\.")
... |
cd20fa986fd0df2e2eaf0c607b2cfbdb5c6aa68e35ed81d131e4fd51d44c3649 | qmuli/qmuli | Internal.hs | module Qi.Program.S3.Internal where
import Protolude
newtype ListToken = ListToken Text
deriving Eq
| null | https://raw.githubusercontent.com/qmuli/qmuli/6ca147f94642b81ab3978d502397efb60a50215b/library/Qi/Program/S3/Internal.hs | haskell | module Qi.Program.S3.Internal where
import Protolude
newtype ListToken = ListToken Text
deriving Eq
| |
656a949164059a9a6ddbf59516ada14a0d32ee624296eebb3fb2e31c86a4d104 | phronmophobic/membrane | paragraph.clj | (ns membrane.skia.paragraph
(:require [membrane.skia :as skia
:refer [defc
ffi-buf]]
[membrane.ui :as ui])
(:import com.sun.jna.Pointer
com.sun.jna.Memory
com.sun.jna.Native
com.sun.jna.ptr.IntByReference
com.phronemophobic.me... | null | https://raw.githubusercontent.com/phronmophobic/membrane/7ba1cbd8f48eadd4590b768552cfdd6a89be95a0/src/membrane/skia/paragraph.clj | clojure | `ref` is already taken
('#{SkString} type)
SkString* skia_make_skstring_utf8(char *s, int len)
SkColor skia_SkColor4f_make(float red, float green, float blue, float alpha)
don't garbage collect me please
else
// Returns a vector of bounding boxes that enclose all text between
// start and end glyph indexes, in... | (ns membrane.skia.paragraph
(:require [membrane.skia :as skia
:refer [defc
ffi-buf]]
[membrane.ui :as ui])
(:import com.sun.jna.Pointer
com.sun.jna.Memory
com.sun.jna.Native
com.sun.jna.ptr.IntByReference
com.phronemophobic.me... |
748fab756247bf69a21843be38dfd2804afb8a4ee88e65c776c13cae6ca5e07c | mroman42/vitrea | Categories.hs | # LANGUAGE AllowAmbiguousTypes #
{-# LANGUAGE ConstraintKinds #-}
# LANGUAGE DataKinds #
# LANGUAGE ExistentialQuantification #
# LANGUAGE FlexibleContexts #
# LANGUAGE FlexibleInstances #
# LANGUAGE FunctionalDependencies #
{-# LANGUAGE GADTs ... | null | https://raw.githubusercontent.com/mroman42/vitrea/8aed32a88dfc1df28460896a1a7f51166ed67dc7/source/Categories.hs | haskell | # LANGUAGE ConstraintKinds #
# LANGUAGE GADTs #
# LANGUAGE ImplicitParams #
# LANGUAGE KindSignatures #
# LANGUAGE LiberalTypeSynonyms #
# LANGUAGE RankNTypes #
# LANGUAGE ScopedTypeVariables #
# LANGUAGE TypeFamilies #
# LANGUA... | # LANGUAGE AllowAmbiguousTypes #
# LANGUAGE DataKinds #
# LANGUAGE ExistentialQuantification #
# LANGUAGE FlexibleContexts #
# LANGUAGE FlexibleInstances #
# LANGUAGE FunctionalDependencies #
# LANGUAGE IncoherentInstances #
# LANGUAGE MultiParamTypeClasses #
#... |
92d354e485e1ee9a2bcfd19a1632560cf43220a56708dc739b319e1b95c41dc7 | armedbear/abcl | map-into.lisp | ;;; map-into.lisp
;;;
Copyright ( C ) 2003
$ Id$
;;;
;;; This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation ; either version 2
of the License , or ( at your option ) any later version .
;;;
;;... | null | https://raw.githubusercontent.com/armedbear/abcl/0631ea551523bb93c06263e772fbe849008e2f68/src/org/armedbear/lisp/map-into.lisp | lisp | map-into.lisp
This program is free software; you can redistribute it and/or
either version 2
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License f... | Copyright ( C ) 2003
$ Id$
modify it under the terms of the GNU General Public License
of the License , or ( at your option ) any later version .
You should have received a copy of the GNU General Public License
Foundation , Inc. , 59 Temple Place - Suite 330 , Boston , MA 02111 - 1307 , USA .
(in-pack... |
018e4ee4d1891e44695d4b154a2a296d11b08083b73557ae725a27072d2c6c10 | nuvla/api-server | nuvlabox_0.clj | (ns sixsq.nuvla.server.resources.nuvlabox-0
"
The nuvlabox (version 0) contains attributes to describe and configure
a NuvlaBox.
"
(:require
[sixsq.nuvla.server.resources.common.std-crud :as std-crud]
[sixsq.nuvla.server.resources.common.utils :as u]
[sixsq.nuvla.server.resources.nuvlabox :as nb]
[s... | null | https://raw.githubusercontent.com/nuvla/api-server/a64a61b227733f1a0a945003edf5abaf5150a15c/code/src/sixsq/nuvla/server/resources/nuvlabox_0.clj | clojure |
multimethod for validation
multimethod for commission
initialization
| (ns sixsq.nuvla.server.resources.nuvlabox-0
"
The nuvlabox (version 0) contains attributes to describe and configure
a NuvlaBox.
"
(:require
[sixsq.nuvla.server.resources.common.std-crud :as std-crud]
[sixsq.nuvla.server.resources.common.utils :as u]
[sixsq.nuvla.server.resources.nuvlabox :as nb]
[s... |
ccbb2097674bf0fba3e3f07d55c147cc4bf88e5b05e99da34a7fe439da568abd | elastic/eui-cljs | keys.cljs | (ns eui.services.keys
(:require ["@elastic/eui/lib/services/keys.js" :as eui]))
(def HOME eui/HOME)
(def META eui/META)
(def CTRL eui/CTRL)
(def keys eui/keys)
(def ESCAPE eui/ESCAPE)
(def PAGE_DOWN eui/PAGE_DOWN)
(def ARROW_RIGHT eui/ARROW_RIGHT)
(def ARROW_LEFT eui/ARROW_LEFT)
(def BACKSPACE eui/BACKSPACE)... | null | https://raw.githubusercontent.com/elastic/eui-cljs/ad60b57470a2eb8db9bca050e02f52dd964d9f8e/src/eui/services/keys.cljs | clojure | (ns eui.services.keys
(:require ["@elastic/eui/lib/services/keys.js" :as eui]))
(def HOME eui/HOME)
(def META eui/META)
(def CTRL eui/CTRL)
(def keys eui/keys)
(def ESCAPE eui/ESCAPE)
(def PAGE_DOWN eui/PAGE_DOWN)
(def ARROW_RIGHT eui/ARROW_RIGHT)
(def ARROW_LEFT eui/ARROW_LEFT)
(def BACKSPACE eui/BACKSPACE)... | |
1e3e76282f8104600434776e280afa1ec0fbfe2355de17520e8863aeda21821f | SimulaVR/godot-haskell | Lib.hs | module Lib (exports) where
import Godot
import Project.Support
import Project.Requirements
import Game.RSSReader
exports :: GdnativeHandle -> IO ()
exports = registerAll' @Nodes @'[RSSReader]
| null | https://raw.githubusercontent.com/SimulaVR/godot-haskell/e8f2c45f1b9cc2f0586ebdc9ec6002c8c2d384ae/examples/rss-reader/src/Lib.hs | haskell | module Lib (exports) where
import Godot
import Project.Support
import Project.Requirements
import Game.RSSReader
exports :: GdnativeHandle -> IO ()
exports = registerAll' @Nodes @'[RSSReader]
| |
e4a79828fbaf47a8dca44585137ff95d70fad2e0ff301c5929638c7787bbf05f | jakemcc/sicp-study | deque.clj | Exercise 3.23
(ns deque)
(declare make-deque
empty-deque?
front-deque
rear-deque
front-insert-deque!
rear-insert-deque!
front-delete-deque!
rear-delete-deque!)
(defn make-deque []
(atom {:front :empty :rear :empty}))
(defn empty-deque? [d]
(and (= :empty (:front @d))
(= :empty (:rear @d)))... | null | https://raw.githubusercontent.com/jakemcc/sicp-study/3b9e3d6c8cc30ad92b0d9bbcbbbfe36a8413f89d/clojure/section3.3/src/deque.clj | clojure | Exercise 3.23
(ns deque)
(declare make-deque
empty-deque?
front-deque
rear-deque
front-insert-deque!
rear-insert-deque!
front-delete-deque!
rear-delete-deque!)
(defn make-deque []
(atom {:front :empty :rear :empty}))
(defn empty-deque? [d]
(and (= :empty (:front @d))
(= :empty (:rear @d)))... | |
dff78886b37dc55a59f7e4f8390f862d2b4a2d2bab7c26422aa9d14329ae15bc | ghcjs/ghcjs-dom | HTMLTitleElement.hs | # LANGUAGE PatternSynonyms #
# LANGUAGE ForeignFunctionInterface #
# LANGUAGE JavaScriptFFI #
-- For HasCallStack compatibility
{-# LANGUAGE ImplicitParams, ConstraintKinds, KindSignatures #-}
module GHCJS.DOM.JSFFI.Generated.HTMLTitleElement
(js_setText, setText, js_getText, getText, HTMLTitleElement(..),
... | null | https://raw.githubusercontent.com/ghcjs/ghcjs-dom/749963557d878d866be2d0184079836f367dd0ea/ghcjs-dom-jsffi/src/GHCJS/DOM/JSFFI/Generated/HTMLTitleElement.hs | haskell | For HasCallStack compatibility
# LANGUAGE ImplicitParams, ConstraintKinds, KindSignatures # | # LANGUAGE PatternSynonyms #
# LANGUAGE ForeignFunctionInterface #
# LANGUAGE JavaScriptFFI #
module GHCJS.DOM.JSFFI.Generated.HTMLTitleElement
(js_setText, setText, js_getText, getText, HTMLTitleElement(..),
gTypeHTMLTitleElement)
where
import Prelude ((.), (==), (>>=), return, IO, Int, Float, Do... |
73f142acdb86b343e95d901d173604923eca40c28070a3b63888298c6396a8bc | ptaoussanis/carmine | connections.clj | (ns taoensso.carmine.connections
"Handles socket connection lifecycle. Pool is implemented with Apache Commons
pool. Originally adapted from redis-clojure."
{:author "Peter Taoussanis"}
(:require [taoensso.encore :as enc]
[taoensso.carmine.protocol :as protocol])
(:import [java.net InetS... | null | https://raw.githubusercontent.com/ptaoussanis/carmine/4f13e08a5a41a81c745e4a82ea1c5c1a2223a3eb/src/taoensso/carmine/connections.clj | clojure | Outline/nomenclature
connection -> Connection object.
pool -> IConnectionPool implementer (for custom pool types, etc.).
conn spec -> map of processed options describing connection properties.
conn opts -> map of unprocessed options that'll be processed to create a spec.
pool opts -> map of options that'... | (ns taoensso.carmine.connections
"Handles socket connection lifecycle. Pool is implemented with Apache Commons
pool. Originally adapted from redis-clojure."
{:author "Peter Taoussanis"}
(:require [taoensso.encore :as enc]
[taoensso.carmine.protocol :as protocol])
(:import [java.net InetS... |
5c1e1e7c60214de969c5afe1ae978ca01b8d3892c7c8c79285d6927927042d8e | mirage/irmin | pack_index.ml |
* Copyright ( c ) 2018 - 2022 Tarides < >
*
* Permission to use , copy , modify , and distribute this software for any
* purpose with or without fee is hereby granted , provided that the above
* copyright notice and this permission notice appear in all copies .
*
* THE SOFTWARE IS PROVIDED " AS I... | null | https://raw.githubusercontent.com/mirage/irmin/9127c0c0ac3ee28563f55d9c2d8471919087e30c/src/irmin-pack/unix/pack_index.ml | ocaml | Happens when [fresh = true = readonly] |
* Copyright ( c ) 2018 - 2022 Tarides < >
*
* Permission to use , copy , modify , and distribute this software for any
* purpose with or without fee is hereby granted , provided that the above
* copyright notice and this permission notice appear in all copies .
*
* THE SOFTWARE IS PROVIDED " AS I... |
562411a983c0a71e34ee08ea33fd466c9baaee229a015dff778905d547543d38 | puppetlabs/puppetserver | legacy_routes.clj | (ns puppetlabs.services.protocols.legacy-routes)
(defprotocol LegacyRoutesService
"Marker protocol for the legacy routes service.")
| null | https://raw.githubusercontent.com/puppetlabs/puppetserver/2d6ca01b4b72716ca543b606f752261b969e401b/src/clj/puppetlabs/services/protocols/legacy_routes.clj | clojure | (ns puppetlabs.services.protocols.legacy-routes)
(defprotocol LegacyRoutesService
"Marker protocol for the legacy routes service.")
| |
c9224c71273a240d3c824eb9b522b7a424beaeca10673563a375b9ba06ef75cc | diffusionkinetics/open | PCA.hs | module Fuml.Base.PCA where
import Numeric.LinearAlgebra
import Data.List (foldl')
sumWith :: Num a => (Vector Double -> a) -> [Vector Double] -> a
sumWith f (v:vs) = foldl' (\acc v -> acc + f v) (f v) vs
meanVs :: [Vector Double] -> Vector Double
meanVs vecs = scale (recip $ realToFrac $ length vecs) $ sumWith id ve... | null | https://raw.githubusercontent.com/diffusionkinetics/open/673d9a4a099abd9035ccc21e37d8e614a45a1901/fuml/lib/Fuml/Base/PCA.hs | haskell | following | module Fuml.Base.PCA where
import Numeric.LinearAlgebra
import Data.List (foldl')
sumWith :: Num a => (Vector Double -> a) -> [Vector Double] -> a
sumWith f (v:vs) = foldl' (\acc v -> acc + f v) (f v) vs
meanVs :: [Vector Double] -> Vector Double
meanVs vecs = scale (recip $ realToFrac $ length vecs) $ sumWith id ve... |
35ec025baf52c2f6bd802908888dc74003f6263f7c4a52bf3a9bec11fca7d86f | rbuchmann/samak | state.cljs | (ns ui.state
(:require [reagent.core :as r]
[keybind.core :as k]
[samak.code-db :as db]
[samak.stdlib :as std]
[samak.core :as core]
[ui.modes :as modes]
[ui.transitions :as transitions]))
(defn make-initial-state []
{:mode ... | null | https://raw.githubusercontent.com/rbuchmann/samak/ab98d1a180ee02c6cd784962b3c03e473a6d481b/ui_src/ui/state.cljs | clojure | (ns ui.state
(:require [reagent.core :as r]
[keybind.core :as k]
[samak.code-db :as db]
[samak.stdlib :as std]
[samak.core :as core]
[ui.modes :as modes]
[ui.transitions :as transitions]))
(defn make-initial-state []
{:mode ... | |
d0927dbc2ce6ea915cf67d3027aaab7e475930cd72056f1a0d7013fabd22c6c8 | charlieg/Sparser | adjectives.lisp | ;;; -*- Mode:LISP; Syntax:Common-Lisp; Package:(SPARSER LISP) -*-
copyright ( c ) 1995 -- all rights reserved
;;;
;;; File: "adjectives"
;;; Module: "grammar;rules:words:"
version : April 1995
initiated in 1/9/95 . Redone in terms of fn words 4/12
(in-package :sparser)
(defun define-adjectiv... | null | https://raw.githubusercontent.com/charlieg/Sparser/b9bb7d01d2e40f783f3214fc104062db3d15e608/Sparser/code/s/grammar/rules/words/adjectives.lisp | lisp | -*- Mode:LISP; Syntax:Common-Lisp; Package:(SPARSER LISP) -*-
File: "adjectives"
Module: "grammar;rules:words:" | copyright ( c ) 1995 -- all rights reserved
version : April 1995
initiated in 1/9/95 . Redone in terms of fn words 4/12
(in-package :sparser)
(defun define-adjective (string)
(define-function-word string
:brackets '( ].phrase .[np )
:form (category-named 'adjective)))
|
b56a0a36a2ea74d59ef64c2b1a6de01777a8d85d7498c08c37574907956fdaef | jeffshrager/biobike | basicload.lisp | -*- Package : cl - user ; mode : lisp ; base : 10 ; Syntax : Common - Lisp ; -*-
(in-package :cl-user)
(defparameter *ppcre-subdir* "cl-ppcre-0.5.9/")
Bootstrap.lisp loads in the microloader .
(load (merge-pathnames "bootstrap.lisp" *load-truename*) :verbose t)
;;; Load libraries of utility functions we will ... | null | https://raw.githubusercontent.com/jeffshrager/biobike/5313ec1fe8e82c21430d645e848ecc0386436f57/BioLisp/basicload.lisp | lisp | mode : lisp ; base : 10 ; Syntax : Common - Lisp ; -*-
Load libraries of utility functions we will need. |
(in-package :cl-user)
(defparameter *ppcre-subdir* "cl-ppcre-0.5.9/")
Bootstrap.lisp loads in the microloader .
(load (merge-pathnames "bootstrap.lisp" *load-truename*) :verbose t)
(load
(merge-pathnames
(concatenate 'string "ppcre/" *ppcre-subdir* "load.lisp")
*load-truename*)
:verbose t)
(load (merg... |
70470ef8ab8fdd7a8ba81497f5f48dcd2d16cf01f7c4f5dfebeea15da4ba4fe6 | rtrusso/scp | bsearch.scm | ;; bsearch.scm
;;
;; An implementation of binary search.
(define (binary-search vector vector-ref vector-length less-than? value)
(define (iter low high)
(if (> low high)
#f
(let ((m (quotient (+ low high) 2)))
(cond ((less-than? (vector-ref vector m) value)
(... | null | https://raw.githubusercontent.com/rtrusso/scp/2051e76df14bd36aef81aba519ffafa62b260f5c/src/algo/bsearch.scm | scheme | bsearch.scm
An implementation of binary search.
|
(define (binary-search vector vector-ref vector-length less-than? value)
(define (iter low high)
(if (> low high)
#f
(let ((m (quotient (+ low high) 2)))
(cond ((less-than? (vector-ref vector m) value)
(iter (+ m 1) high))
((less-than? value (vec... |
08ae47bb657b12c9d4c88e6fb14f9e073d0ee30a6e2c2995b6d2e78a7c77d5dc | ocaml/ocaml-lsp | metrics.ml | open Import
open Fiber.O
let max_len = 1_000
type t = { events : Chrome_trace.Event.t Queue.t }
let t_var : t Fiber.Var.t = Fiber.Var.create ()
let get () = Fiber.Var.get_exn t_var
let report (event : Chrome_trace.Event.t) : unit Fiber.t =
let+ t = get () in
(if Queue.length t.events >= max_len then
let (_ ... | null | https://raw.githubusercontent.com/ocaml/ocaml-lsp/861514455e172acbed5cd6be54c350c073d38a86/ocaml-lsp-server/src/metrics.ml | ocaml | open Import
open Fiber.O
let max_len = 1_000
type t = { events : Chrome_trace.Event.t Queue.t }
let t_var : t Fiber.Var.t = Fiber.Var.create ()
let get () = Fiber.Var.get_exn t_var
let report (event : Chrome_trace.Event.t) : unit Fiber.t =
let+ t = get () in
(if Queue.length t.events >= max_len then
let (_ ... | |
72bc03dce8f0b70c98e7f10f1f680336f1a2260d157ca106c988fba10e43e454 | emilaxelsson/imperative-edsl | Tests.hs | import qualified Imperative
import qualified Concurrent
import qualified Demo
import qualified CExp
main = do
Imperative.testAll
Concurrent.testAll
Demo.testAll
CExp.main
| null | https://raw.githubusercontent.com/emilaxelsson/imperative-edsl/5561d7d0bcdb3de279478629a5493810c295e56d/tests/Tests.hs | haskell | import qualified Imperative
import qualified Concurrent
import qualified Demo
import qualified CExp
main = do
Imperative.testAll
Concurrent.testAll
Demo.testAll
CExp.main
| |
d40243dc068edef5e05c71d04407262b79d489fd3614bef39bceb979531f62b8 | sol/hpack | CabalFile.hs | # LANGUAGE LambdaCase #
# LANGUAGE RecordWildCards #
# LANGUAGE ViewPatterns #
module Hpack.CabalFile where
import Imports
import Data.Maybe
import Data.Version (Version(..))
import qualified Data.Version as Version
import Text.ParserCombinators.ReadP
import Hpack.Ut... | null | https://raw.githubusercontent.com/sol/hpack/f1aa0c48eb696d66be8c1bcf68528253eab09178/src/Hpack/CabalFile.hs | haskell | # LANGUAGE LambdaCase #
# LANGUAGE RecordWildCards #
# LANGUAGE ViewPatterns #
module Hpack.CabalFile where
import Imports
import Data.Maybe
import Data.Version (Version(..))
import qualified Data.Version as Version
import Text.ParserCombinators.ReadP
import Hpack.Ut... | |
a2dd8fbd17304a46473953440300f6072425f48ba9f24a7ef0c2c38fff8becfa | ghc/ghc | Graph.hs | {-# LANGUAGE LambdaCase #-}
# LANGUAGE RecordWildCards #
{-# LANGUAGE DeriveTraversable #-}
module GHC.Unit.Module.Graph
( ModuleGraph
, ModuleGraphNode(..)
, nodeDependencies
, emptyMG
, mkModuleGraph
, extendMG
, extendMGInst
, extendMG'
, unionMG
, isTemplateHaskellOrQQNonBoot
... | null | https://raw.githubusercontent.com/ghc/ghc/5640cb1d84d3cce4ce0a9e90d29b2b20d2b38c2f/compiler/GHC/Unit/Module/Graph.hs | haskell | # LANGUAGE LambdaCase #
# LANGUAGE DeriveTraversable #
Edges between nodes mark dependencies arising from module imports
and dependencies arising from backpack instantiations.
| Instantiation nodes track the instantiation of other units
(backpack dependencies) with the holes (signatures) of the current package... | # LANGUAGE RecordWildCards #
module GHC.Unit.Module.Graph
( ModuleGraph
, ModuleGraphNode(..)
, nodeDependencies
, emptyMG
, mkModuleGraph
, extendMG
, extendMGInst
, extendMG'
, unionMG
, isTemplateHaskellOrQQNonBoot
, filterToposortToModules
, mapMG
, mgModSummaries
, mgModS... |
cb56e1063cb3a636ef2b3cdd93290a543b25f99b9ea2e3afb7575e513d5fe795 | finnishtransportagency/harja | paallystys_indeksit.cljs | (ns harja.views.urakka.paallystys-indeksit
"Näkymä päällystysurakan indeksien valintaan ja tietojen näyttämiseen."
(:require [harja.ui.komponentti :as komp]
[harja.tiedot.urakka :as urakka]
[harja.tiedot.hallinta.indeksit :as indeksit]
[harja.domain.oikeudet :as oikeudet]
... | null | https://raw.githubusercontent.com/finnishtransportagency/harja/d2c3efc456f459e72943c97c369d5391b57f5536/src/cljs/harja/views/urakka/paallystys_indeksit.cljs | clojure | (ns harja.views.urakka.paallystys-indeksit
"Näkymä päällystysurakan indeksien valintaan ja tietojen näyttämiseen."
(:require [harja.ui.komponentti :as komp]
[harja.tiedot.urakka :as urakka]
[harja.tiedot.hallinta.indeksit :as indeksit]
[harja.domain.oikeudet :as oikeudet]
... | |
5eba7d3a6d3e113ce04fe9c0336022e797303f82d47207b031017f7390d4cae9 | dbuenzli/topkg | topkg_cmd.ml | ---------------------------------------------------------------------------
Copyright ( c ) 2016 . All rights reserved .
Distributed under the ISC license , see terms at the end of the file .
% % NAME%% % % ---------------------------------------------------------------------------
Copyright (c) ... | null | https://raw.githubusercontent.com/dbuenzli/topkg/ea1e0981a18ce4160ec21e8a73f67cb748059671/src/topkg_cmd.ml | ocaml | Command line fragments
Predicates and comparison
Conversions and pretty printing | ---------------------------------------------------------------------------
Copyright ( c ) 2016 . All rights reserved .
Distributed under the ISC license , see terms at the end of the file .
% % NAME%% % % ---------------------------------------------------------------------------
Copyright (c) ... |
3a5fcce5f0d70bc51299eacc03ba45753ab2cfd03a3c8de563d4ddfb0b746bb6 | PatrickMaier/HdpH | nbody.hs | -- N-body simulation; simple parallelisation of all pairs algorithm
--
Author :
-----------------------------------------------------------------------------
# LANGUAGE FlexibleInstances #
# LANGUAGE TemplateHaskell #
module Main where
import Prelude
import Control.Applicative ((<$>), (<*>))
import Control.Excep... | null | https://raw.githubusercontent.com/PatrickMaier/HdpH/e836a5bcf5a6c93239f9c0d0109d7b81b459897f/hdph/src/Test/HdpH/nbody.hs | haskell | N-body simulation; simple parallelisation of all pairs algorithm
---------------------------------------------------------------------------
---------------------------------------------------------------------------
3D vectors and scalars
# UNPACK #
# UNPACK #
# UNPACK #
vector sum and difference
# INLINE (.-.) #
... | Author :
# LANGUAGE FlexibleInstances #
# LANGUAGE TemplateHaskell #
module Main where
import Prelude
import Control.Applicative ((<$>), (<*>))
import Control.Exception (evaluate)
import Control.Monad (replicateM, when, (>=>))
import Control.DeepSeq (NFData(..), deepseq)
import Data.List (stripPrefix)
import Dat... |
f21af03c9f7a93a6fd9847725f922d30e1ec19998fe872c11463202fcaa74224 | marijnh/Postmodern | test-table-info.lisp | -*- Mode : LISP ; Syntax : Ansi - Common - Lisp ; Base : 10 ; Package : POSTMODERN - TESTS ; -*-
(in-package :postmodern-tests)
;; Adjust the above to some db/user/pass/host combination that refers
;; to a valid postgresql database in which no table named test_data
;; currently exists. Then after loading the file, r... | null | https://raw.githubusercontent.com/marijnh/Postmodern/d54e494000e1915a7046e8d825cb635555957e85/postmodern/tests/test-table-info.lisp | lisp | Syntax : Ansi - Common - Lisp ; Base : 10 ; Package : POSTMODERN - TESTS ; -*-
Adjust the above to some db/user/pass/host combination that refers
to a valid postgresql database in which no table named test_data
currently exists. Then after loading the file, run the tests with
(run! :postmodern)
"))
")
")
")
")
") | (in-package :postmodern-tests)
(def-suite :postmodern-table-info
:description "Test suite for postmodern table information functions"
:in :postmodern)
(in-suite :postmodern-table-info)
(defun create-products ()
(drop-table "products" :if-exists t :cascade t)
(query "CREATE TABLE products (
id SERIAL PRI... |
ad5c60ff2156c0813ed605098285813655e6e8494c709cd24dfefff12c84b46f | ocaml-sf/learn-ocaml-corpus | prelude.ml | The type of on - demand sequences . ( As of OCaml 4.07 , this type exists
in the standard library . )
in the standard library.) *)
module Seq = struct
type 'a t = unit -> 'a node
and +'a node =
| Nil
| Cons of 'a * 'a t
let rec map (f : 'a -> 'b) (xs : 'a t) : 'b t =
fun () ->
match xs... | null | https://raw.githubusercontent.com/ocaml-sf/learn-ocaml-corpus/7dcf4d72b49863a3e37e41b3c3097aa4c6101a69/exercises/fpottier/alpha_beta/prelude.ml | ocaml | --------------------------------------------------------------------------
All of the values that we consider lie in the range [bottom] to [top],
inclusive. Note that [bottom] is the opposite of [top].
We assume that, in every game configuration, a finite number of moves
are permitted, and that each of these... | The type of on - demand sequences . ( As of OCaml 4.07 , this type exists
in the standard library . )
in the standard library.) *)
module Seq = struct
type 'a t = unit -> 'a node
and +'a node =
| Nil
| Cons of 'a * 'a t
let rec map (f : 'a -> 'b) (xs : 'a t) : 'b t =
fun () ->
match xs... |
bd55184ab94e0ba90e612562fa90ead98a5d631e67cdbedec60b12e82e460af6 | obsidiansystems/beam-automigrate | Orphans.hs | |
Description :
Orphan Data instances for PostgresqlSyntax
These instances are being upstreamed < here > and , once they are , this module will be removed .
Description:
Orphan Data instances for PostgresqlSyntax
These instances are being upstreamed <here -volkov/postgresql-syntax/pull/6> and, once they ... | null | https://raw.githubusercontent.com/obsidiansystems/beam-automigrate/2eae891814b0523c6c839a666eed19218985a89f/integration-tests/PostgresqlSyntax/Data/Orphans.hs | haskell | # Language CPP #
# Language DeriveDataTypeable #
# Language StandaloneDeriving # | |
Description :
Orphan Data instances for PostgresqlSyntax
These instances are being upstreamed < here > and , once they are , this module will be removed .
Description:
Orphan Data instances for PostgresqlSyntax
These instances are being upstreamed <here -volkov/postgresql-syntax/pull/6> and, once they ... |
5993b49fbeb26f2ba5ebc191ee9f85da8e70df667b9cdb340bf5ba5f8b87478c | clojure-interop/aws-api | AbstractAWSGlue.clj | (ns com.amazonaws.services.glue.AbstractAWSGlue
"Abstract implementation of AWSGlue. Convenient method forms pass through to the corresponding overload that
takes a request object, which throws an UnsupportedOperationException."
(:refer-clojure :only [require comment defn ->])
(:import [com.amazonaws.services.g... | null | https://raw.githubusercontent.com/clojure-interop/aws-api/59249b43d3bfaff0a79f5f4f8b7bc22518a3bf14/com.amazonaws.services.glue/src/com/amazonaws/services/glue/AbstractAWSGlue.clj | clojure | (ns com.amazonaws.services.glue.AbstractAWSGlue
"Abstract implementation of AWSGlue. Convenient method forms pass through to the corresponding overload that
takes a request object, which throws an UnsupportedOperationException."
(:refer-clojure :only [require comment defn ->])
(:import [com.amazonaws.services.g... | |
521c57d28596075a4e239f26577d9404c993cde1ab1ba1490d089f937c307f8e | ocurrent/ocurrent | dyn.ml | type 'a t = ('a, Id.t * [`Active of Output.active | `Msg of string]) result
let return x = Ok x
let fail ~id msg = Error (id, `Msg msg)
let strip_id = function
| Ok x -> Ok x
| Error (_, e) -> Error e
let state x = Ok (strip_id x)
let catch = function
| Ok _ as x -> Ok x
| Error (_, (`Msg _ as x)) -> Ok (Er... | null | https://raw.githubusercontent.com/ocurrent/ocurrent/50389bb8ee1a21bfc773d16ee645aee76968cae0/lib_term/dyn.ml | ocaml | type 'a t = ('a, Id.t * [`Active of Output.active | `Msg of string]) result
let return x = Ok x
let fail ~id msg = Error (id, `Msg msg)
let strip_id = function
| Ok x -> Ok x
| Error (_, e) -> Error e
let state x = Ok (strip_id x)
let catch = function
| Ok _ as x -> Ok x
| Error (_, (`Msg _ as x)) -> Ok (Er... | |
dabdcc0fef170faeb1f2f156fac1e7a30fa162a19e3adb14a41b5d6f5aaf90e7 | uwplse/rake | cost-model.rkt | #lang rosette/safe
(require
rosette/lib/match
rake/hvx/ast/types
rake/hvx/ast/visitor)
(struct hvx-resource-usage (load shift permute mpy1 mpy2) #:transparent)
;; Computes a crude estimate of the cost by summing the cost of each individual
;; instruction in the expression. The cost of each instruction is speci... | null | https://raw.githubusercontent.com/uwplse/rake/0fb9b46ae8ac64f95a4c0e89060ffdb043229a5b/rake/hvx/cost-model.rkt | racket | Computes a crude estimate of the cost by summing the cost of each individual
instruction in the expression. The cost of each instruction is specified using
a weight function. By default, all instructions have an equal cost.
Constant weight function. Implements the crudest base-line cost model.
New instructions typ... | #lang rosette/safe
(require
rosette/lib/match
rake/hvx/ast/types
rake/hvx/ast/visitor)
(struct hvx-resource-usage (load shift permute mpy1 mpy2) #:transparent)
(define (basic-expr-cost p [weightf const-weight])
(define cost 0)
(define (update-cost instr [arg-pos -1])
(define offset 0)
(when (abstr-... |
cee02861b4845391a44d31cb9680495a34726014ab17111e2c7d032f2d98176e | SNePS/SNePS2 | fnode.lisp | -*- Mode : Lisp ; Syntax : Common - Lisp ; Package : SNIP ; Base : 10 -*-
Copyright ( C ) 1984 - -2013 Research Foundation of
;; State University of New York
Version : $ I d : fnode.lisp , v 1.2 2013/08/28 19:07:26 shapiro Exp $
;; This file is part of SNePS.
$ BEGIN LICENSE$
The... | null | https://raw.githubusercontent.com/SNePS/SNePS2/d3862108609b1879f2c546112072ad4caefc050d/snip/ds/fnode.lisp | lisp | Syntax : Common - Lisp ; Package : SNIP ; Base : 10 -*-
State University of New York
This file is part of SNePS.
you may
not use this file except in compliance with the License. You
may obtain a copy of the License at
. edu/sneps/Downloads/ubpl.pdf.
or implied. See the License for th... |
Copyright ( C ) 1984 - -2013 Research Foundation of
Version : $ I d : fnode.lisp , v 1.2 2013/08/28 19:07:26 shapiro Exp $
$ BEGIN LICENSE$
The contents of this file are subject to the University at
Software distributed under the License is distributed on an
" AS IS " basis , WITHOUT WARRANTY OF ANY KI... |
511343f4dafc6cf32653fdf01b0b42a97e499907b8cffa9db562f294e884d9e3 | mwand/5010-examples | 08-2-merge-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 08-2-merge-sort) (read-case-sensitive #t) (teachpacks ()) (htdp-settings #(#t construct... | null | https://raw.githubusercontent.com/mwand/5010-examples/ac24491ec2e533d048e11087ccc30ff1c087c218/08-2-merge-sort.rkt | racket | about the language level of this file in a form that our tools can easily process.
general-recursion for merge, merge-sort
STRATEGY: recur on either (rest lst1) or (rest lst2)
merge-sort : ListOfNumber -> SortedList
GIVEN: a list of numbers
RETURNS: a sorted version of the same list
EXAMPLE:
empty => emp... | The first three lines of this file were inserted by . They record metadata
#reader(lib "htdp-intermediate-lambda-reader.ss" "lang")((modname 08-2-merge-sort) (read-case-sensitive #t) (teachpacks ()) (htdp-settings #(#t constructor repeating-decimal #f #t none #f () #f)))
(require rackunit)
(require "extras.rkt... |
6187197d7f34d46778787c212bf0f879e042644c1981c77cd63f106b6afc4045 | babashka/sci | protocols.cljc | (ns sci.impl.protocols
{:no-doc true}
(:refer-clojure :exclude [defprotocol extend-protocol
extend extend-type reify satisfies?
extends? implements? type->str])
(:require
#?(:clj [sci.impl.interop :as interop])
[sci.impl.deftype]
[sci.impl.multimeth... | null | https://raw.githubusercontent.com/babashka/sci/8330cd8bee67dfbea2688643ec45406300ecb6ff/src/sci/impl/protocols.cljc | clojure | re-quote arglists
TODO: apply patches for default override for records
look for type specific method
in CLJS we currently don't support mixing "classes" and protocols,
the slower satisfies?
can be record that is implementing this protocol
NOTE: what if the protocol doesn't have any methods?
This probably needs ... | (ns sci.impl.protocols
{:no-doc true}
(:refer-clojure :exclude [defprotocol extend-protocol
extend extend-type reify satisfies?
extends? implements? type->str])
(:require
#?(:clj [sci.impl.interop :as interop])
[sci.impl.deftype]
[sci.impl.multimeth... |
84f9255c3c59f69d052f94e5311f5824b671dea818f9023b5a7b2ffb13ca2212 | PublicScan/LambdaCalculus | script.rkt | ((lambda (zero one add mul pow sub1 true false and or)
((lambda (sub not zero? two Y)
((lambda (less-equal? equal? three four)
;------------------------------
((lambda (for-each fib)
(for-each (lambda (i) (print (fib zero one zero i))) zero (mul four four))
)
... | null | https://raw.githubusercontent.com/PublicScan/LambdaCalculus/d609b7947b1204a43dab60ce8c4d7cdaed6988b9/script.rkt | racket | ------------------------------
------------------------------ | ((lambda (zero one add mul pow sub1 true false and or)
((lambda (sub not zero? two Y)
((lambda (less-equal? equal? three four)
((lambda (for-each fib)
(for-each (lambda (i) (print (fib zero one zero i))) zero (mul four four))
)
(Y
(lambda (self)
... |
0159d41ee4babcdbd751cc8d91e69e927291042612e00d1bc80116f27bd0a367 | mirage/irmin | metadata.mli |
* Copyright ( c ) 2013 - 2022 < >
*
* Permission to use , copy , modify , and distribute this software for any
* purpose with or without fee is hereby granted , provided that the above
* copyright notice and this permission notice appear in all copies .
*
* THE SOFTWARE IS PROVIDED " AS IS " AND... | null | https://raw.githubusercontent.com/mirage/irmin/abeee121a6db7b085b3c68af50ef24a8d8f9ed05/src/irmin/metadata.mli | ocaml |
* Copyright ( c ) 2013 - 2022 < >
*
* Permission to use , copy , modify , and distribute this software for any
* purpose with or without fee is hereby granted , provided that the above
* copyright notice and this permission notice appear in all copies .
*
* THE SOFTWARE IS PROVIDED " AS IS " AND... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.