_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 |
|---|---|---|---|---|---|---|---|---|
f0cab9e2a4a51a06f2740b6daa4c8a1a7641e87ee504e9f6c860bef2e0e6eaf0 | simplex-chat/simplex-chat | M20230117_fkey_indexes.hs | # LANGUAGE QuasiQuotes #
module Simplex.Chat.Migrations.M20230117_fkey_indexes where
import Database.SQLite.Simple (Query)
import Database.SQLite.Simple.QQ (sql)
-- .lint fkey-indexes
m20230117_fkey_indexes :: Query
m20230117_fkey_indexes =
[sql|
CREATE INDEX idx_calls_user_id ON calls(user_id);
CREATE INDEX idx_c... | null | https://raw.githubusercontent.com/simplex-chat/simplex-chat/c8fae0ec4390c40675ac9f9aa9924d5da87edbb2/src/Simplex/Chat/Migrations/M20230117_fkey_indexes.hs | haskell | .lint fkey-indexes | # LANGUAGE QuasiQuotes #
module Simplex.Chat.Migrations.M20230117_fkey_indexes where
import Database.SQLite.Simple (Query)
import Database.SQLite.Simple.QQ (sql)
m20230117_fkey_indexes :: Query
m20230117_fkey_indexes =
[sql|
CREATE INDEX idx_calls_user_id ON calls(user_id);
CREATE INDEX idx_calls_chat_item_id ON c... |
dfcdc75b3db92b244bcd3d021370176d8584c6e7429f0be5cbbbe87f4ce623bd | ndmitchell/supero | Firstify.hs |
module Firstify(firstify) where
import Yhc.Core hiding (collectAllVars,collectFreeVars,uniqueBoundVars,replaceFreeVars)
import Yhc.Core.FreeVar2
import Firstify.Template
import Firstify.Prepare
import Data.List
import Data.Char
import Data.Maybe
import Control.Monad.State
import qualified Data.Set as Set
import qu... | null | https://raw.githubusercontent.com/ndmitchell/supero/a8b16ea90862e2c021bb139d7a7e9a83700b43b2/Dead/Firstify.hs | haskell | -------------------------------------------------------------------
DRIVER
the list of items which are currently under evaluation
the functions which got finished
those which were asked for while in active
make sure that the templating is done
now try and do the transformation on it if required
now inline the fu... |
module Firstify(firstify) where
import Yhc.Core hiding (collectAllVars,collectFreeVars,uniqueBoundVars,replaceFreeVars)
import Yhc.Core.FreeVar2
import Firstify.Template
import Firstify.Prepare
import Data.List
import Data.Char
import Data.Maybe
import Control.Monad.State
import qualified Data.Set as Set
import qu... |
2082a9cb1bea4a162071904df53c9a65d1fa98d9b3cf113221641a7ff3af4f26 | danr/hipspec | Scope.hs | # LANGUAGE CPP #
module HipSpec.Sig.Scope where
import GHC hiding (Sig)
import Control.Applicative
import Data.Maybe
import DataCon
#if __GLASGOW_HASKELL__ >= 708
import ConLike
#endif
getIdsInScope :: (Id -> Id) -> Ghc [Id]
getIdsInScope fix_id = do
ns <- getNamesInScope
things <- catMaybes <$> mapM loo... | null | https://raw.githubusercontent.com/danr/hipspec/a114db84abd5fee8ce0b026abc5380da11147aa9/src/HipSpec/Sig/Scope.hs | haskell | # LANGUAGE CPP #
module HipSpec.Sig.Scope where
import GHC hiding (Sig)
import Control.Applicative
import Data.Maybe
import DataCon
#if __GLASGOW_HASKELL__ >= 708
import ConLike
#endif
getIdsInScope :: (Id -> Id) -> Ghc [Id]
getIdsInScope fix_id = do
ns <- getNamesInScope
things <- catMaybes <$> mapM loo... | |
7016a0e07be59a1b67541f28ed57178a730234d354096bbbd3d7bf3569ba5a3c | rowangithub/DOrder | ed_main.ml | (**************************************************************************)
(* *)
: a generic graph library for OCaml
Copyright ( C ) 2004 - 2007
, and
(* ... | null | https://raw.githubusercontent.com/rowangithub/DOrder/e0d5efeb8853d2a51cc4796d7db0f8be3185d7df/external/ocamlgraph/editor/ed_main.ml | ocaml | ************************************************************************
This software is free software; you can redistribute it and/or
described in file LICENSE.... | : a generic graph library for OCaml
Copyright ( C ) 2004 - 2007
, and
modify it under the terms of the GNU Library General Public
License version 2 , with the special exception on linking
This fi... |
19c82510ed86679dc8ec59162d7db0ac133c3010425e4f213c6bbe3087f82d33 | m0cchi/cl-slack | channels.lisp | (in-package :cl-slack.channels)
(defmethod archive ((client cl-slack.core:slack-client)
(channel string))
(cl-slack.core:send "channels.archive"
(format nil "?token=~A&channel=~A"
(cl-slack.core:token client)
chann... | null | https://raw.githubusercontent.com/m0cchi/cl-slack/019ecb3e9a1605a8671fab85b4e564a257f76a04/src/channels.lisp | lisp | (in-package :cl-slack.channels)
(defmethod archive ((client cl-slack.core:slack-client)
(channel string))
(cl-slack.core:send "channels.archive"
(format nil "?token=~A&channel=~A"
(cl-slack.core:token client)
chann... | |
fe79f9926cdea482dfea82a4f38972684a1dd0357f5ffc6324a2b10b1decbd31 | mzp/scheme-abc | node.mli | type 'a t = {
value: 'a;
filename: string;
lineno: int;
start_pos: int;
end_pos: int;
}
val of_string : string -> char t Stream.t
val of_file : string -> char t Stream.t
val of_channel : string -> in_channel -> char t Stream.t
val ghost : 'a -> 'a t
val value : 'a t -> 'a
val lift : ('a -> 'b) -... | null | https://raw.githubusercontent.com/mzp/scheme-abc/2cb541159bcc32ae4d033793dea6e6828566d503/scm/ast/node.mli | ocaml | type 'a t = {
value: 'a;
filename: string;
lineno: int;
start_pos: int;
end_pos: int;
}
val of_string : string -> char t Stream.t
val of_file : string -> char t Stream.t
val of_channel : string -> in_channel -> char t Stream.t
val ghost : 'a -> 'a t
val value : 'a t -> 'a
val lift : ('a -> 'b) -... | |
b73420478de36074205f58fdf3a6526ef923322be771d3c3dac2a1be3de53e2c | jserot/hocl | hcl.ml | (**********************************************************************)
(* *)
This file is part of the HOCL package
(* *)
Copyright ( c ) 2019 - prese... | null | https://raw.githubusercontent.com/jserot/hocl/7ab1dba918e64c3cdbc446e5f2c0cba37181bccf/tools/pi2hcl/hcl.ml | ocaml | ********************************************************************
All rights reserved.
... | This file is part of the HOCL package
Copyright ( c ) 2019 - present , ( ) .
HCL backend
open Printf
type hcl_config = {
mutable annot_file: string;
mutable default_param_type: string;
}
let cfg = {
annot_file = "";
default_param_type = "nat";
}
let collect_type... |
9f1e8689a5724d9030ee319c767e580e3945025dcf1d44ad19c1aca55b4aafa9 | Chris00/ocaml-gammu | read1sms.ml | Simple demo / test file that prints some informations and the first sms .
open Args_demo
open Utils_tests
open Printf
let () =
try
let s = Gammu.make () in
prepare_phone s;
while true do
print_string "Enter folder: ";
let folder = int_of_string (read_line ()) in
print_string "Enter m... | null | https://raw.githubusercontent.com/Chris00/ocaml-gammu/ad38c6aff25bda8aa6da1db5fdfe61a224b00250/demo/read1sms.ml | ocaml | Simple demo / test file that prints some informations and the first sms .
open Args_demo
open Utils_tests
open Printf
let () =
try
let s = Gammu.make () in
prepare_phone s;
while true do
print_string "Enter folder: ";
let folder = int_of_string (read_line ()) in
print_string "Enter m... | |
ae104fcecfb57b5097929f5d27f915f102e2305ce4973f56c0dc48440eb4578f | keechma/keechma-pipelines | runtime.cljs | (ns keechma.pipelines.runtime
(:require [promesa.core :as p]
[medley.core :refer [dissoc-in]]
[cljs.core.async :refer [chan put! <! close! alts!]])
(:require-macros [cljs.core.async.macros :refer [go-loop go]]))
(def ^:dynamic *pipeline-depth* 0)
(declare invoke-resumable)
(declare start-re... | null | https://raw.githubusercontent.com/keechma/keechma-pipelines/09ae26e5f435401e420c3869dec8e77da74ef7d0/src/keechma/pipelines/runtime.cljs | clojure | (ns keechma.pipelines.runtime
(:require [promesa.core :as p]
[medley.core :refer [dissoc-in]]
[cljs.core.async :refer [chan put! <! close! alts!]])
(:require-macros [cljs.core.async.macros :refer [go-loop go]]))
(def ^:dynamic *pipeline-depth* 0)
(declare invoke-resumable)
(declare start-re... | |
31f6aedda0e5a6ed9f9c7bb8fd42f2d2f7cdaf6c041b303f24a605d0d2228484 | gator1/jepsen | mv_test.clj | (ns cassandra.mv-test
(:require [clojure.test :refer :all]
[clojure.pprint :refer [pprint]]
[cassandra.mv :refer :all]
[cassandra.core-test :refer :all]
[jepsen [core :as jepsen]
[report :as report]]))
;; Steady state cluster tests
(deftest ^:mv ^:steady m... | null | https://raw.githubusercontent.com/gator1/jepsen/1932cbd72cbc1f6c2a27abe0fe347ea989f0cfbb/cassandra/test/cassandra/mv_test.clj | clojure | Steady state cluster tests
Bootstrapping tests
Decommission tests
Consistency delay test | (ns cassandra.mv-test
(:require [clojure.test :refer :all]
[clojure.pprint :refer [pprint]]
[cassandra.mv :refer :all]
[cassandra.core-test :refer :all]
[jepsen [core :as jepsen]
[report :as report]]))
(deftest ^:mv ^:steady mv-bridge
(run-test! bridge-t... |
69692208bb25e5e26923327aab5d4cfb294c046b77fb5f0efb0892d17d605b4a | psg-mit/marshall | marshall.ml | * The main program using [ ] dyadics .
module Marshall_bignum = Main.Make(Dyadic_mpfr)
| null | https://raw.githubusercontent.com/psg-mit/marshall/65f20ebe02ce71c306c4bb334d119d939f1afdf9/src/marshall.ml | ocaml | * The main program using [ ] dyadics .
module Marshall_bignum = Main.Make(Dyadic_mpfr)
| |
ca9df9ffc467434ea1cdf37b8189a3131ae939ca6397489f8ca158b2290babdf | teamwalnut/graphql-ppx | graphql_compiler.ml | module Generator_utils = Generator_utils
module Graphql_lexer = Graphql_lexer
module Graphql_parser = Graphql_parser
module Graphql_parser_document = Graphql_parser_document
module Log = Log
module Ppx_config = Ppx_config
module Read_schema = Read_schema
module Result_decoder = Result_decoder
module Result_structure = ... | null | https://raw.githubusercontent.com/teamwalnut/graphql-ppx/8276452ebe8d89a748b6b267afc94161650ab620/src/graphql_compiler/graphql_compiler.ml | ocaml | module Generator_utils = Generator_utils
module Graphql_lexer = Graphql_lexer
module Graphql_parser = Graphql_parser
module Graphql_parser_document = Graphql_parser_document
module Log = Log
module Ppx_config = Ppx_config
module Read_schema = Read_schema
module Result_decoder = Result_decoder
module Result_structure = ... | |
92fb0a0af29447ae728e677e9844e0bbebf376ea820de45fa78d9a6ccdbd973e | jesperes/aoc_erlang | aoc2019_day18.erl | Advent of Code solution for 2019 day 18 .
Created : 2019 - 12 - 18T18:36:27 + 00:00
-module(aoc2019_day18).
-include_lib("stdlib/include/assert.hrl").
-behavior(aoc_puzzle).
-export([parse/1, solve1/1, solve2/1, info/0]).
-include("aoc_puzzle.hrl").
-spec info() -> aoc_puzzle().
info() ->
#aoc_puzzle{modu... | null | https://raw.githubusercontent.com/jesperes/aoc_erlang/ec0786088fb9ab886ee57e17ea0149ba3e91810a/src/2019/aoc2019_day18.erl | erlang |
are no keys in that quadrant. When encountering such a door, the
bot will simply "wait" until the key is found by another bot. We
sum up the shortest paths.
... @#@
... @#@
Return a list of {Keys,Doors} in the given quadrant.
============================================================
Utility fun... | Advent of Code solution for 2019 day 18 .
Created : 2019 - 12 - 18T18:36:27 + 00:00
-module(aoc2019_day18).
-include_lib("stdlib/include/assert.hrl").
-behavior(aoc_puzzle).
-export([parse/1, solve1/1, solve2/1, info/0]).
-include("aoc_puzzle.hrl").
-spec info() -> aoc_puzzle().
info() ->
#aoc_puzzle{modu... |
3487a756d00c5ae0d3e3e6314829bac4f31347c641fc2d925de9b77fb0d821c8 | ruhatch/mirage-oram | oram_tests.ml | open Alcotest
open Core_kernel.Std
open Lwt
open Testable
open Generators
let oram_tests =
[
"OramFloorLog_One_Zero", `Quick,
(fun () ->
check int "" 0 (O.floor_log 1L));
"OramFloorLog_OneTwentySeven_Six", `Quick,
(fun () ->
check int "" 6 (O.floor_log 127L));
"OramFloorLog_OneTwentyE... | null | https://raw.githubusercontent.com/ruhatch/mirage-oram/533a7f7726c4a499b60c71ed627b730349a3816b/tests/oram_tests.ml | ocaml | open Alcotest
open Core_kernel.Std
open Lwt
open Testable
open Generators
let oram_tests =
[
"OramFloorLog_One_Zero", `Quick,
(fun () ->
check int "" 0 (O.floor_log 1L));
"OramFloorLog_OneTwentySeven_Six", `Quick,
(fun () ->
check int "" 6 (O.floor_log 127L));
"OramFloorLog_OneTwentyE... | |
23ae81307e88e944d010a5b8166b11a3732bbf043de4aa1a1016795e88aeb504 | bootstrapworld/curr | Game5.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-beginner-reader.ss" "lang")((modname Game5) (read-case-sensitive #t) (teachpacks ()) (htdp-settings #(#t constructor repeating-decimal #f ... | null | https://raw.githubusercontent.com/bootstrapworld/curr/443015255eacc1c902a29978df0e3e8e8f3b9430/courses/reactive/resources/source-files/Game5.rkt | racket | about the language level of this file in a form that our tools can easily process.
DATA:
a world is a string number number number number
STARTING WORLD
GRAPHICS
GRAPHICS FUNCTIONS:
draw-world: world -> Image
UPDATING FUNCTIONS:
update-world: world -> world
What does your update-world function do?
KEY EVEN... | The first three lines of this file were inserted by . They record metadata
#reader(lib "htdp-beginner-reader.ss" "lang")((modname Game5) (read-case-sensitive #t) (teachpacks ()) (htdp-settings #(#t constructor repeating-decimal #f #t none #f ())))
(require "Teachpacks/bootstrap-teachpack.rkt")
(define-struct world... |
88494a6f375cec96597ba014dd866adc6b16d0c0953af49062557e5bc664263d | gheber/kenzo | disk-pasting-test.lisp | -*- Mode : Lisp ; Syntax : ANSI - Common - Lisp ; Base : 10 - *
(in-package :kenzo-test-7)
(in-suite :kenzo-7)
(test disk-pasting-cmpr
(let* ((c (cat-7:delta 3))
(cmpr (cat-7:disk-pasting-cmpr (cat-7:cmpr c) 'new)))
(is (equal :equal (funcall cmpr 'new 'new)))
(is (equal :less (f... | null | https://raw.githubusercontent.com/gheber/kenzo/48e2ea398b80f39d3b5954157a7df57e07a362d7/test/kenzo-7/disk-pasting-test.lisp | lisp | Syntax : ANSI - Common - Lisp ; Base : 10 - * |
(in-package :kenzo-test-7)
(in-suite :kenzo-7)
(test disk-pasting-cmpr
(let* ((c (cat-7:delta 3))
(cmpr (cat-7:disk-pasting-cmpr (cat-7:cmpr c) 'new)))
(is (equal :equal (funcall cmpr 'new 'new)))
(is (equal :less (funcall cmpr 'new 5)))
(is (equal :greater (funcall cmpr 5 ... |
6ae5546d5622bf3f3cba522147bfd5ea7131d7a8b510856df635050aeed7c8c0 | coast-framework/db | helper_test.clj | (ns db.schema.helper-test
(:require [db.schema.helper :refer [version integer text create-table index foreign-key bool]]
[clojure.test :refer [deftest testing is]]))
(deftest version-test
(is (= {"account" {:column-names #{"id" "name" "email" "password"}
:columns [{:type :integer ... | null | https://raw.githubusercontent.com/coast-framework/db/e738cd6402a89c591363ac6f3e7a6e08bcc28a0e/test/db/schema/helper_test.clj | clojure | (ns db.schema.helper-test
(:require [db.schema.helper :refer [version integer text create-table index foreign-key bool]]
[clojure.test :refer [deftest testing is]]))
(deftest version-test
(is (= {"account" {:column-names #{"id" "name" "email" "password"}
:columns [{:type :integer ... | |
dda529c5811aff8207e6765b7bf13ce42725cea63f4457a0d582ba1bb2ceea93 | janestreet/core | univ_map_intf.ml | * Universal / heterogeneous maps , useful for storing values of arbitrary type in a single
map .
In order to recover a value , it must be looked up with exactly the [ Key.t ] it was
stored in . In other words , given different [ from the same [ string ] , one will
not be able to recover the ke... | null | https://raw.githubusercontent.com/janestreet/core/f382131ccdcb4a8cd21ebf9a49fa42dcf8183de6/univ_map/src/univ_map_intf.ml | ocaml | * For correct behavior of the map, [type_id] must return the same [Type_equal.Id] on
different calls on the same input.
* The ['s] parameter is shared across all values stored in the map.
* [to_alist t] returns all values in [t], in increasing order of key type-id name.
* This binding is convenient because exi... | * Universal / heterogeneous maps , useful for storing values of arbitrary type in a single
map .
In order to recover a value , it must be looked up with exactly the [ Key.t ] it was
stored in . In other words , given different [ from the same [ string ] , one will
not be able to recover the ke... |
3473497c6710b39062ae4d42e4c6a037cf17e1981d176c1445a73e62b4524e1b | mbj/stratosphere | JsonBodyProperty.hs | module Stratosphere.WAFv2.WebACL.JsonBodyProperty (
module Exports, JsonBodyProperty(..), mkJsonBodyProperty
) where
import qualified Data.Aeson as JSON
import qualified Stratosphere.Prelude as Prelude
import Stratosphere.Property
import {-# SOURCE #-} Stratosphere.WAFv2.WebACL.JsonMatchPatternProperty as E... | null | https://raw.githubusercontent.com/mbj/stratosphere/c70f301715425247efcda29af4f3fcf7ec04aa2f/services/wafv2/gen/Stratosphere/WAFv2/WebACL/JsonBodyProperty.hs | haskell | # SOURCE # | module Stratosphere.WAFv2.WebACL.JsonBodyProperty (
module Exports, JsonBodyProperty(..), mkJsonBodyProperty
) where
import qualified Data.Aeson as JSON
import qualified Stratosphere.Prelude as Prelude
import Stratosphere.Property
import Stratosphere.ResourceProperties
import Stratosphere.Value
data JsonBod... |
a963702ef8cefca08cc4a2db305ce42afbbc2b171531b4680b77e2663dd8fa33 | racket/db | connection.rkt | #lang racket/unit
(require (for-syntax racket/base)
racket/class
rackunit
"../config.rkt"
db/base
(only-in db/private/generic/common locking%))
(import config^ database^)
(export test^)
(define test
(test-suite "managing connections"
(test-case "connection?"
(ca... | null | https://raw.githubusercontent.com/racket/db/0336d2522a613e76ebf60705cea3be4c237c447e/db-test/tests/db/db/connection.rkt | racket | cx's ports (if applicable) are managed by c1
wire-based connection is disconnected; it had better know it
since otherwise we might get a cached answer
no need for sync here; cached and forwarded answers same
Check that kill-safe cx can tell it's disconnected even without
doing a query after custodian shutdown.
s... | #lang racket/unit
(require (for-syntax racket/base)
racket/class
rackunit
"../config.rkt"
db/base
(only-in db/private/generic/common locking%))
(import config^ database^)
(export test^)
(define test
(test-suite "managing connections"
(test-case "connection?"
(ca... |
114077d57c90896700748e0985a365f057b583f9b250b53c0b72ef1347486335 | YoshikuniJujo/funpaala | userId.hs | type Id = Either Int String
name :: Id -> [(Id, String)] -> Maybe String
name = lookup
users :: [(Id, String)]
users = [
(Right "yoshio", "Yoshio Yamada"),
(Right "yoshio2", "Yoshio Yamada"),
(Left 4492, "Tatsuya Yamashiro"),
(Right "keiko", "Keiko Koike"),
(Left 8855, "Satoru Hananakajima") ]
| null | https://raw.githubusercontent.com/YoshikuniJujo/funpaala/5366130826da0e6b1180992dfff94c4a634cda99/samples/22_adt_poly_rec/userId.hs | haskell | type Id = Either Int String
name :: Id -> [(Id, String)] -> Maybe String
name = lookup
users :: [(Id, String)]
users = [
(Right "yoshio", "Yoshio Yamada"),
(Right "yoshio2", "Yoshio Yamada"),
(Left 4492, "Tatsuya Yamashiro"),
(Right "keiko", "Keiko Koike"),
(Left 8855, "Satoru Hananakajima") ]
| |
5b81c950e659abbf2d95b3428aa9c9dfa97f52b9a4aa11a3d0afbbfe8a17befd | j0sh/ocaml-mqtt | test.ml | open OUnit
open Mqtt
open Subscriptions
let _ =
let tests = Mqtt.tests @ Subscriptions.tests in
let suite = "mqtt">:::tests in
run_test_tt_main suite
| null | https://raw.githubusercontent.com/j0sh/ocaml-mqtt/1bbad53afc86babd15d0925127124ff9793577b2/test/test.ml | ocaml | open OUnit
open Mqtt
open Subscriptions
let _ =
let tests = Mqtt.tests @ Subscriptions.tests in
let suite = "mqtt">:::tests in
run_test_tt_main suite
| |
4543ef34594a51b14c5f132e1c49bca86286fc02cdcb922c8a34f008e4304bd9 | s-expressionists/Eclector | client.lisp | (cl:in-package #:eclector.concrete-syntax-tree)
(defclass cst-client (eclector.parse-result:parse-result-client)
())
(defvar *cst-client* (make-instance 'cst-client))
(defmethod eclector.parse-result:make-expression-result
((client cst-client) expression children source)
(labels ((make-atom-cst (expression &... | null | https://raw.githubusercontent.com/s-expressionists/Eclector/acd141db4efdbd88d57a8fe4f258ffc18cc47baa/code/concrete-syntax-tree/client.lisp | lisp | List structure with corresponding elements.
Structure mismatch, try heuristic reconstruction.
We don't use
(cst:reconstruct expression children client)
because we want SOURCE for the outer CONS-CST but not
any of its children. | (cl:in-package #:eclector.concrete-syntax-tree)
(defclass cst-client (eclector.parse-result:parse-result-client)
())
(defvar *cst-client* (make-instance 'cst-client))
(defmethod eclector.parse-result:make-expression-result
((client cst-client) expression children source)
(labels ((make-atom-cst (expression &... |
57c92b68e5832f4ba16ccdef319839e7c0f79410adf2b0efc365a4039d3bdb40 | blamario/grampa | TH.hs | -- | This module exports the templates for automatic instance deriving of "Rank2" type classes. The most common way to
-- use it would be
--
> import qualified Rank2.TH
-- > data MyDataType f = ...
> $ ( Rank2.TH.deriveAll '' )
--
-- or, if you're picky, you can invoke only 'deriveFunctor' and whichever other inst... | null | https://raw.githubusercontent.com/blamario/grampa/cae7fc65d8d8ad2f54a070170896735c7518eed7/rank2classes/src/Rank2/TH.hs | haskell | | This module exports the templates for automatic instance deriving of "Rank2" type classes. The most common way to
use it would be
> data MyDataType f = ...
or, if you're picky, you can invoke only 'deriveFunctor' and whichever other instances you need instead.
# Language CPP #
# Language TemplateHaskell #
Adap... | > import qualified Rank2.TH
> $ ( Rank2.TH.deriveAll '' )
module Rank2.TH (deriveAll, deriveFunctor, deriveApply, unsafeDeriveApply, deriveApplicative,
deriveFoldable, deriveTraversable,
deriveDistributive, deriveDistributiveTraversable, deriveLogistic)
where
import Control.App... |
20c41d0c35dab5295098c54cfe13d84f30cff9e7d7c6c2f4ebe8030b9ecc3088 | paulgray/exml | exml.erl | %%%-------------------------------------------------------------------
@author < >
( C ) 2011 , Erlang Solutions Ltd.
%%% @doc
%%%
%%% @end
Created : 12 Jul 2011 by < >
%%%-------------------------------------------------------------------
-module(exml).
-include("exml_stream.hrl").
-export([parse/1]).
-... | null | https://raw.githubusercontent.com/paulgray/exml/d04d0dfc956bd2bf5d9629a7524c6840eb02df28/src/exml.erl | erlang | -------------------------------------------------------------------
@doc
@end
-------------------------------------------------------------------
ensure we return io*list*
ensure we return io*list*
by passing an empty string as `Indent', but that would be less efficient,
so let's leave the implementations separa... | @author < >
( C ) 2011 , Erlang Solutions Ltd.
Created : 12 Jul 2011 by < >
-module(exml).
-include("exml_stream.hrl").
-export([parse/1]).
-export([to_list/1, to_binary/1, to_iolist/1,
to_pretty_iolist/1, to_pretty_iolist/3]).
-export([to_list/2, to_binary/2, to_iolist/2,
to_pretty_iol... |
19a6db075756fd27a28448a5bfa9d2cc6577f11c59d80e9de2f320caaa6c5fce | sigscale/rim | im_server.erl | %%% im_server.erl
%%% vim: ts=3
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2018 - 2021 SigScale Global Inc.
%%% @end
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 cop... | null | https://raw.githubusercontent.com/sigscale/rim/f806a0c52430f86bf1d54324fd0b4b6e510aea43/src/im_server.erl | erlang | im_server.erl
vim: ts=3
@end
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 ... | 2018 - 2021 SigScale Global Inc.
Licensed under the Apache License , Version 2.0 ( the " License " ) ;
distributed under the License is distributed on an " AS IS " BASIS ,
-module(im_server).
-copyright('Copyright (c) 2018 - 2021 SigScale Global Inc.').
-behaviour(gen_server).
-export([]).
-export([init/1, ha... |
10c39e55443c5c2dd3785af09e1889591560def99aa69f1e3ecd9922fd024153 | robert-strandh/SICL | packages.lisp | (cl:in-package #:common-lisp-user)
(defpackage #:sicl-who-calls-visualizer
(:use #:common-lisp)
(:export #:visualize))
| null | https://raw.githubusercontent.com/robert-strandh/SICL/eee214bc9a8b9a74c2f0cf533f7c502a07df2ef3/Code/Who-calls-visualizer/packages.lisp | lisp | (cl:in-package #:common-lisp-user)
(defpackage #:sicl-who-calls-visualizer
(:use #:common-lisp)
(:export #:visualize))
| |
cbc88faa1755ff1151aa5bc7b97a7844b116ca3a423aefb1ac1fe2aca5f0e12f | rbkmoney/fistful-server | w2w_transfer_machine.erl | %%%
%%% w2w transfer machine
%%%
-module(w2w_transfer_machine).
-behaviour(machinery).
%% API
-type id() :: machinery:id().
-type change() :: w2w_transfer:event().
-type event() :: {integer(), ff_machine:timestamped_event(change())}.
-type st() :: ff_machine:st(w2w_transfer()).
-type w2w_transfer() :: w2w_transfer:... | null | https://raw.githubusercontent.com/rbkmoney/fistful-server/60b964d0e07f911c841903bc61d8d9fb20a32658/apps/w2w/src/w2w_transfer_machine.erl | erlang |
w2w transfer machine
API
API
Machinery
Internal types
API
Machinery
Internals |
-module(w2w_transfer_machine).
-behaviour(machinery).
-type id() :: machinery:id().
-type change() :: w2w_transfer:event().
-type event() :: {integer(), ff_machine:timestamped_event(change())}.
-type st() :: ff_machine:st(w2w_transfer()).
-type w2w_transfer() :: w2w_transfer:w2w_transfer_state().
-type external_id(... |
1fa20970b2221c0bc1109036b2452abbcd6be3e03e0eca6050c02e21cc1e32c1 | tonyg/kali-scheme | strong.scm | Copyright ( c ) 1993 , 1994 by and .
Copyright ( c ) 1996 by NEC Research Institute , Inc. See file COPYING .
; Code to find the strongly connected components of a graph.
; (TO <vertex>) are the vertices that have an edge to <vertex>.
( SLOT < vertex > ) and ( SET - SLOT ! < vertex > < value > ) is a se... | null | https://raw.githubusercontent.com/tonyg/kali-scheme/79bf76b4964729b63fce99c4d2149b32cb067ac0/scheme/big/strong.scm | scheme | Code to find the strongly connected components of a graph.
(TO <vertex>) are the vertices that have an edge to <vertex>.
used by the algorithm.
The components are returned in a backwards topologically sorted list.
user's data
list of vertices
next vertex on the stack
time at which this vertex was
reached in t... | Copyright ( c ) 1993 , 1994 by and .
Copyright ( c ) 1996 by NEC Research Institute , Inc. See file COPYING .
( SLOT < vertex > ) and ( SET - SLOT ! < vertex > < value > ) is a settable slot
(define (strongly-connected-components vertices to slot set-slot!)
(make-vertices vertices to slot set-slot!)
... |
979791286ed354fb806beadd42c426c467e897b0e1e275bb6f94ba08e17dc7b9 | rurban/clisp | clos-class6.lisp | Common Lisp Object System for CLISP
Class
Part n-1 : Generic functions specified in the MOP .
2004 - 05 - 25
2005 - 2008 , 2017
(in-package "CLOS")
;;; ===========================================================================
;; Make creation of <defined-class> instances customizable.
;; Installing... | null | https://raw.githubusercontent.com/rurban/clisp/75ed2995ff8f5364bcc18727cde9438cca4e7c2c/src/clos-class6.lisp | lisp | ===========================================================================
Make creation of <defined-class> instances customizable.
Installing the accessor methods can only be done after a class has been
initialized, but must be done in a _primary_ initialize-instance method,
so that it doesn't interfere with :af... | Common Lisp Object System for CLISP
Class
Part n-1 : Generic functions specified in the MOP .
2004 - 05 - 25
2005 - 2008 , 2017
(in-package "CLOS")
install . See MOP p. 60 .
(defmethod initialize-instance ((class defined-class) &rest args)
(declare (ignore args))
(install-class-direct-accessors... |
58a562baba90a82d07fd0014b8e6b978be9a9fe28312a192cef1a39ccd04ab0d | KarlHegbloom/zotero-texmacs-integration | builder.scm | coding : utf-8
;;; ¶
;;; (tm-zotero json builder) --- Guile JSON implementation.
Copyright ( C ) 2013 Flaque < >
;;
;; This file is part of guile-json.
;;
;; guile-json 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 Fr... | null | https://raw.githubusercontent.com/KarlHegbloom/zotero-texmacs-integration/39e5db5b22fefc3672b9e5c22b3035b500ffe5b5/progs/tm-zotero/json/builder.scm | scheme | ¶
(tm-zotero json builder) --- Guile JSON implementation.
This file is part of guile-json.
guile-json is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
either
guile-json is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; with... | coding : utf-8
Copyright ( C ) 2013 Flaque < >
version 3 of the License , or ( at your option ) any later version .
You should have received a copy of the GNU Lesser General Public
Foundation , Inc. , 51 Franklin Street , Fifth Floor , Boston , MA
02110 - 1301 USA
JSON module for
(define-module (... |
dd10a47e2655cc006418fabf7b553553e7abbff5dc4ada8ea2f1c786165a40a4 | thheller/shadow-cljs | resolve_check.cljs | (ns shadow.resolve-check
(:require
["enhanced-resolve" :as er]
["path" :as path]
["fs" :as fs]
[cljs.reader :as reader]
[cljs.pprint :refer (pprint)]))
(defn fail! [test err file]
(prn [:fail! test file])
(js/console.log err)
(js/process.exit 1))
(-> (.process processor "* org-mode exampl... | null | https://raw.githubusercontent.com/thheller/shadow-cljs/c89949557e1006df36d9ed2dbd4d479fbf19a580/src/dev/shadow/resolve_check.cljs | clojure | (ns shadow.resolve-check
(:require
["enhanced-resolve" :as er]
["path" :as path]
["fs" :as fs]
[cljs.reader :as reader]
[cljs.pprint :refer (pprint)]))
(defn fail! [test err file]
(prn [:fail! test file])
(js/console.log err)
(js/process.exit 1))
(-> (.process processor "* org-mode exampl... | |
12a3facb5dbccd8023ce1dfa094abcb6e619f9cb65834385526566a29dfb0b48 | OlivierSohn/hamazed | Sums.hs | # LANGUAGE NoImplicitPrelude #
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE BangPatterns #-}
module Test.Imj.Sums
( testSums
) where
import Imj.Prelude
import Control.Exception (evaluate)
import Data.List(foldl', length, replicate)
import qualified Data.Set as Set
i... | null | https://raw.githubusercontent.com/OlivierSohn/hamazed/6c2b20d839ede7b8651fb7b425cb27ea93808a4a/imj-base/test/Test/Imj/Sums.hs | haskell | # LANGUAGE OverloadedStrings #
# LANGUAGE BangPatterns #
verify all output lists are descending
Using different implementations to find the number
The fastest way is to use a 'StrictTree' ('mkSumsStrict').
trick to force a new evaluation
Note : reversed | # LANGUAGE NoImplicitPrelude #
module Test.Imj.Sums
( testSums
) where
import Imj.Prelude
import Control.Exception (evaluate)
import Data.List(foldl', length, replicate)
import qualified Data.Set as Set
import qualified Data.IntSet as ISet
import Data.Text(pa... |
7997e69438155205b38cc318c15a2c57adef37ebfb408f2ca39fab9a50c2c474 | amnh/poy5 | pdfcodec.mli | (** Encoding and decoding PDF streams *)
*
{ b Currently supported :}
- Decoders : ASCIIHexDecode , ASCII85Decode , FlateDecode ,
LZWDecode , RunLengthDecode .
- Encoders : ASCIIHexDecode , ASCII85Decode , FlateDecode , RunLengthDecode .
- Predictors : PNG ( all ) , TIFF ( 8 - bit only ) .
{b Currently su... | null | https://raw.githubusercontent.com/amnh/poy5/da563a2339d3fa9c0110ae86cc35fad576f728ab/src/camlpdf-0.3/pdfcodec.mli | ocaml | * Encoding and decoding PDF streams
* There was bad data.
* PdfCaml doesn't support this encoding or its predictor.
* Supported encodings.
* Encode a PDF stream with an encoding.
*/* |
*
{ b Currently supported :}
- Decoders : ASCIIHexDecode , ASCII85Decode , FlateDecode ,
LZWDecode , RunLengthDecode .
- Encoders : ASCIIHexDecode , ASCII85Decode , FlateDecode , RunLengthDecode .
- Predictors : PNG ( all ) , TIFF ( 8 - bit only ) .
{b Currently supported:}
- Decoders: ASCIIHexDecode, ASC... |
d7028ab04706d28999103eff0c253e9a783da7ff8883cfe962c1b988572fc4b5 | vvvvalvalval/scope-capture | logging.cljc | (ns sc.impl.logging)
(defmulti log-cs
(fn [logger-id cs-data] logger-id))
| null | https://raw.githubusercontent.com/vvvvalvalval/scope-capture/1214ff41459c41df57ef55b3fdf01d965ad611b2/src/sc/impl/logging.cljc | clojure | (ns sc.impl.logging)
(defmulti log-cs
(fn [logger-id cs-data] logger-id))
| |
ecf5cef6d98d0ef67aecf16d1a82b332524ce1460877c858a82bd9c83b8b0f97 | ocsigen/eliom | eliom_content.client.mli | Ocsigen
*
* Copyright ( C ) 2012 ,
*
* This program is free software ; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation , with linking exception ;
* either version 2.1 of the License , or ( at y... | null | https://raw.githubusercontent.com/ocsigen/eliom/c3e0eea5bef02e0af3942b6d27585add95d01d6c/src/lib/eliom_content.client.mli | ocaml | * Low-level XML manipulation.
* Building valid SVG .
* Creation of reactive content
* The function [node s] creates an SVG [elt] from a signal [s].
The resulting SVG [elt] can then be used like any other SVG
[elt].
* Creation of content from client-side values.
* Node identifiers
* The type of glo... | Ocsigen
*
* Copyright ( C ) 2012 ,
*
* This program is free software ; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation , with linking exception ;
* either version 2.1 of the License , or ( at y... |
cd1c2cb1ba96bd44dbec82fc5c655a9c921197bb8dade8e567ce9d888a9b761e | FranklinChen/hugs98-plus-Sep2006 | Texturing.hs | --------------------------------------------------------------------------------
-- |
-- Module : Graphics.Rendering.OpenGL.GL.Texturing
Copyright : ( c ) 2002 - 2005
-- License : BSD-style (see the file libraries/OpenGL/LICENSE)
--
-- Maintainer :
-- Stability : provisional
-- Portability : ... | null | https://raw.githubusercontent.com/FranklinChen/hugs98-plus-Sep2006/54ab69bd6313adbbed1d790b46aca2a0305ea67e/packages/OpenGL/Graphics/Rendering/OpenGL/GL/Texturing.hs | haskell | ------------------------------------------------------------------------------
|
Module : Graphics.Rendering.OpenGL.GL.Texturing
License : BSD-style (see the file libraries/OpenGL/LICENSE)
Maintainer :
Stability : provisional
Portability : portable
-------------------------------------------... | Copyright : ( c ) 2002 - 2005
This module corresponds to section 3.8 ( Texturing ) of the OpenGL 1.5 specs .
module Graphics.Rendering.OpenGL.GL.Texturing (
module Graphics.Rendering.OpenGL.GL.Texturing.Specification,
module Graphics.Rendering.OpenGL.GL.Texturing.Parameters,
module Graphics.Renderi... |
1c62603e76d00e7b549a9b96a89cfba67ffbbaa429e2b6de60c58c6d3caab118 | DaMSL/K3 | IndexedSet.hs | {-|
This module defines routines and utilities associated with the creation and
use of a data structure which is equivalent to a set but maintains a number of
indexes for quick containment checks. The containment checks must be
enumerated statically.
-}
module Language.K3.Utils.IndexedSet
( module X
) where
i... | null | https://raw.githubusercontent.com/DaMSL/K3/51749157844e76ae79dba619116fc5ad9d685643/src/Language/K3/Utils/IndexedSet.hs | haskell | |
This module defines routines and utilities associated with the creation and
use of a data structure which is equivalent to a set but maintains a number of
indexes for quick containment checks. The containment checks must be
enumerated statically.
| module Language.K3.Utils.IndexedSet
( module X
) where
import Language.K3.Utils.IndexedSet.Class as X
import Language.K3.Utils.IndexedSet.TemplateHaskell as X
|
52668ccfe107dce9783965dd780fd9f2926f00ebe9df72cef3fff228a8692a8a | ijvcms/chuanqi_dev | scene_pp.erl | %%%-------------------------------------------------------------------
@author zhengsiying
( C ) 2015 , < COMPANY >
%%% @doc
%%%
%%% @end
Created : 31 . 七月 2015 下午3:43
%%%-------------------------------------------------------------------
-module(scene_pp).
%%
-include("common.hrl").
-include("record.hrl").
-inc... | null | https://raw.githubusercontent.com/ijvcms/chuanqi_dev/7742184bded15f25be761c4f2d78834249d78097/server/trunk/server/src/business/scene/scene_pp.erl | erlang | -------------------------------------------------------------------
@doc
@end
-------------------------------------------------------------------
API
====================================================================
API functions
====================================================================
登陆游戏进入场景
... | @author zhengsiying
( C ) 2015 , < COMPANY >
Created : 31 . 七月 2015 下午3:43
-module(scene_pp).
-include("common.hrl").
-include("record.hrl").
-include("proto.hrl").
-include("config.hrl").
-include("cache.hrl").
-include("language_config.hrl").
-include("gameconfig_config.hrl").
-include("log_type_config.hrl").
... |
eaf4057b9abc6bfc255251d271948a15b93bbb7e42792c697c7de4d42c0da953 | kana-sama/sicp | 2.23 - for-each.scm | (define (for-each fn seq)
(let loop ((seq seq))
(if (null? seq)
#!unspecific
(begin
(fn (car seq))
(loop (cdr seq))))))
(print (for-each print (list 1 2 3)))
| null | https://raw.githubusercontent.com/kana-sama/sicp/fc637d4b057cfcae1bae3d72ebc08e1af52e619d/2/2.23%20-%20for-each.scm | scheme | (define (for-each fn seq)
(let loop ((seq seq))
(if (null? seq)
#!unspecific
(begin
(fn (car seq))
(loop (cdr seq))))))
(print (for-each print (list 1 2 3)))
| |
6bc8ea5ebbffb37882990c1423dd3e31a88d501a1e771aad9e170b00509440aa | dharmatech/abstracting | source.scm |
(case scheme-implementation
((ypsilon) (require-lib "glut/ypsilon"))
((larceny) (require-lib "glut/larceny"))
((ikarus) (require-lib "glut/ikarus"))
((chicken) (require-lib "glut/chicken"))
((gambit)
(load (string-append abstracting-root-directory "/support/gambit/glut/glut")))
)
| null | https://raw.githubusercontent.com/dharmatech/abstracting/9dc5d9f45a9de03c6ee379f1928ebb393dfafc52/ext/glut/source.scm | scheme |
(case scheme-implementation
((ypsilon) (require-lib "glut/ypsilon"))
((larceny) (require-lib "glut/larceny"))
((ikarus) (require-lib "glut/ikarus"))
((chicken) (require-lib "glut/chicken"))
((gambit)
(load (string-append abstracting-root-directory "/support/gambit/glut/glut")))
)
| |
7f88a4b29b1eeaf49b6272ff0bc9542cc2700c34df84b2cdb9330f42f4d57546 | deadpendency/deadpendency | StreamQueueMessagesRequest.hs | module SR.Effect.StreamQueueMessages.Model.StreamQueueMessagesRequest
( StreamQueueMessagesRequest (..),
)
where
data StreamQueueMessagesRequest = StreamQueueMessagesRequest
{ _pullDlqSubscriptionId :: Text,
_pullMainTopic :: Text
}
deriving stock (Eq, Show, Generic)
| null | https://raw.githubusercontent.com/deadpendency/deadpendency/170d6689658f81842168b90aa3d9e235d416c8bd/apps/script-runner/src/SR/Effect/StreamQueueMessages/Model/StreamQueueMessagesRequest.hs | haskell | module SR.Effect.StreamQueueMessages.Model.StreamQueueMessagesRequest
( StreamQueueMessagesRequest (..),
)
where
data StreamQueueMessagesRequest = StreamQueueMessagesRequest
{ _pullDlqSubscriptionId :: Text,
_pullMainTopic :: Text
}
deriving stock (Eq, Show, Generic)
| |
aeb19140a1c4ed2be6b4b15fb24016f4391fa2ec170f251cee859716dd047421 | michaxm/task-distribution | TaskDefinition.hs | # LANGUAGE DeriveDataTypeable , DeriveGeneric #
module Control.Distributed.Task.TaskSpawning.TaskDefinition where
import Control.Distributed.Process.Serializable (Serializable)
import Data.Binary (Binary)
import Data.ByteString.Lazy (ByteString)
import Data.Typeable (Typeable)
import GHC.Generics (Generic)
import Con... | null | https://raw.githubusercontent.com/michaxm/task-distribution/d0dee6a661390b7d1279389fa8c7b711309dab6a/src/Control/Distributed/Task/TaskSpawning/TaskDefinition.hs | haskell |
Where data comes from:
- hdfs data source
- very simple file format for testing purposes, files with numbers expected relative to work directory
Where calculation results go:
- simply respond the answer, aggregation happens on master application
- only num results: for testing/benchmarking purposes
| # LANGUAGE DeriveDataTypeable , DeriveGeneric #
module Control.Distributed.Task.TaskSpawning.TaskDefinition where
import Control.Distributed.Process.Serializable (Serializable)
import Data.Binary (Binary)
import Data.ByteString.Lazy (ByteString)
import Data.Typeable (Typeable)
import GHC.Generics (Generic)
import Con... |
53fd7caa42cd1c8853774eeb83c0160988fb4f6619ca26df42cca8bc0cf0ea3b | linuxscout/festival-tts-arabic-voices | clustergen.scm | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;; ;;
Carnegie Mellon University ; ;
Copyright ( c ) 2005 - 2011 ; ;
... | null | https://raw.githubusercontent.com/linuxscout/festival-tts-arabic-voices/ab9fe26120bf6cf3079afa2484b985cfd6ecd56a/voices/ara_norm_ziad_hts/festvox/clustergen.scm | scheme |
;;
;
;
;
;;
Permission is hereby granted, free of charge, to use and distribute ;;
this software and its documentation without restriction, including ;;
without limi... |
(defvar cluster_synth_pre_hooks nil)
(defvar cluster_synth_post_hooks nil)
(defvar clustergen_mcep_trees nil)
(defvar cg:initial_frame_offset 0.0)
(defvar cg:frame_shift 0.005)
(set! mlsa_beta_param 0.4)
(set! cg:mlsa_lpf t)
(set! framerate 16000)
(cond
((equal? framerate 8000) (set! mlsa_alpha_param 0.312))
((equa... |
361378d708f14c7b358e287ce29591c2dbcd9ba5f765c926f575e88ec4767077 | ruedigergad/bowerick | consumer.clj | (fn [m x] (println (type m) x))
| null | https://raw.githubusercontent.com/ruedigergad/bowerick/f57155f8d1fba9a66ffae7d69de9225f5dc81326/examples/consumer.clj | clojure | (fn [m x] (println (type m) x))
| |
e092110128109468eda429c9cf8345076ac51a64f0bc6e1a46f7b48808c44a5c | ghc/packages-dph | Prim.hs | {-# OPTIONS_HADDOCK hide #-}
|This modules defines the interface between the DPH libraries and the compiler . In particular ,
-- it exports exactly those definitions that are used by either the desugarer (to remove parallel
-- array syntax) or by the vectoriser (to generate vectorised code).
--
The DPH libraries... | null | https://raw.githubusercontent.com/ghc/packages-dph/64eca669f13f4d216af9024474a3fc73ce101793/dph-lifted-copy/Data/Array/Parallel/Prim.hs | haskell | # OPTIONS_HADDOCK hide #
it exports exactly those definitions that are used by either the desugarer (to remove parallel
array syntax) or by the vectoriser (to generate vectorised code).
same.
WARNING: All modules in this package that need to be vectorised (i.e., are compiled with
'-fvectorise' must dire... |
|This modules defines the interface between the DPH libraries and the compiler . In particular ,
The DPH libraries can evolve between compiler releases as long as this interface remains the
module Data.Array.Parallel.Prim (
PArray, PData, PDatas(..), PRepr, PA(..), PR(..),
replicatePD, emptyPD, packByTagPD,... |
7767af1714a3232789b8903a0ee9bc28e843195f755a500d3753ccff14a3a8a9 | gergoerdi/hm-compo | Parser.hs | # LANGUAGE RecordWildCards #
module Language.HM.Parser
( parseSource, Decl(..)
, SrcSpanInfo(..), SrcLoc(..), HSE.getPointLoc
) where
import Language.HM.Syntax
import Language.HM.Pretty
import Control.Unification
import Data.Functor.Fixedpoint
import Data.Map (Map)
import qualified Data.Map as Ma... | null | https://raw.githubusercontent.com/gergoerdi/hm-compo/386826e570fc6b6a078927bde85f3941e9a77e87/src/Language/HM/Parser.hs | haskell | # LANGUAGE RecordWildCards #
module Language.HM.Parser
( parseSource, Decl(..)
, SrcSpanInfo(..), SrcLoc(..), HSE.getPointLoc
) where
import Language.HM.Syntax
import Language.HM.Pretty
import Control.Unification
import Data.Functor.Fixedpoint
import Data.Map (Map)
import qualified Data.Map as Ma... | |
a63fce5b09406f21f9ba9b2fd53d6269b53050ef16a8cb03a81c8ee82fc01bd5 | exercism/clojure | octal.clj | (ns octal)
(defn to-decimal [] ;; <- arglist goes here
;; your code goes here
)
| null | https://raw.githubusercontent.com/exercism/clojure/7ed96a5ae3c471c37db2602baf3db2be3b5a2d1a/exercises/practice/octal/src/octal.clj | clojure | <- arglist goes here
your code goes here | (ns octal)
)
|
773675153d8bc9770c1eea212f38653b63c7835be19bf992aa6d0b069381baa6 | yallop/ocaml-ctypes | sigset.mli |
* Copyright ( c ) 2013 .
*
* This file is distributed under the terms of the MIT License .
* See the file LICENSE for details .
* Copyright (c) 2013 Jeremy Yallop.
*
* This file is distributed under the terms of the MIT License.
* See the file LICENSE for details.
*)
open PosixTypes
open Ctypes
... | null | https://raw.githubusercontent.com/yallop/ocaml-ctypes/52ff621f47dbc1ee5a90c30af0ae0474549946b4/examples/sigset/sigset.mli | ocaml |
* Copyright ( c ) 2013 .
*
* This file is distributed under the terms of the MIT License .
* See the file LICENSE for details .
* Copyright (c) 2013 Jeremy Yallop.
*
* This file is distributed under the terms of the MIT License.
* See the file LICENSE for details.
*)
open PosixTypes
open Ctypes
... | |
6330c30c51b6ff0536aa6cc336f7cf5f5fa353c20e5f6dae6704a5580040206f | haskell/lsp | ServerCapabilities.hs | {-# LANGUAGE TemplateHaskell #-}
{-# LANGUAGE TypeOperators #-}
# LANGUAGE DuplicateRecordFields #
module Language.LSP.Types.ServerCapabilities where
import Data.Aeson
import Data.Aeson.TH
import Data.Text (Text)
import Language.LSP.Types.CallHierarchy
import Language.LSP.Types.CodeAction
import Languag... | null | https://raw.githubusercontent.com/haskell/lsp/ce1a4538508b2c393e0f36a888717b7e5c7f08a9/lsp-types/src/Language/LSP/Types/ServerCapabilities.hs | haskell | # LANGUAGE TemplateHaskell #
# LANGUAGE TypeOperators #
---------------------------------------------------------------------
| The server has support for workspace folders
| Whether the server wants to receive workspace folder
change notifications.
If a strings is provided the string is treated as a... | # LANGUAGE DuplicateRecordFields #
module Language.LSP.Types.ServerCapabilities where
import Data.Aeson
import Data.Aeson.TH
import Data.Text (Text)
import Language.LSP.Types.CallHierarchy
import Language.LSP.Types.CodeAction
import Language.LSP.Types.CodeLens
import Language.LSP.Types.Command
import Language.LSP.Typ... |
bcf17fc4068802812dfd9694de8da5ae5e1770f4fb77b09772a8a54147612d8e | WorksHub/client | tracking_pixels.cljs | (ns wh.common.fx.tracking-pixels
(:require [re-frame.core :refer [reg-fx]]
[wh.common.tracking-pixels :as tracking-pixels]))
(reg-fx :tracking-pixels/init-application-pixels tracking-pixels/add-application-tracking-pixels)
(reg-fx :tracking-pixels/init-job-pixels tracking-pixels/add-job-tracking-pixels)
| null | https://raw.githubusercontent.com/WorksHub/client/04af27577b79bb2c50e203a58f5a602146a8ebc3/client/src/wh/common/fx/tracking_pixels.cljs | clojure | (ns wh.common.fx.tracking-pixels
(:require [re-frame.core :refer [reg-fx]]
[wh.common.tracking-pixels :as tracking-pixels]))
(reg-fx :tracking-pixels/init-application-pixels tracking-pixels/add-application-tracking-pixels)
(reg-fx :tracking-pixels/init-job-pixels tracking-pixels/add-job-tracking-pixels)
| |
f21a638f81a1410ba67355c2f64d78d2370bf52bf051417f6cb54105dde75d89 | haskell/hackage-security | Paths.hs | -- | Additional paths
module Hackage.Security.RepoTool.Paths (
-- * Repo
RepoLoc(..)
-- * Keys
, KeyRoot
, KeyPath
, KeysLoc(..)
) where
import Hackage.Security.Util.Path
import Hackage.Security.Util.Pretty
{-------------------------------------------------------------------------------
Repo
---... | null | https://raw.githubusercontent.com/haskell/hackage-security/048844cb006eb880e256d7393928d6fd422ab6dd/hackage-repo-tool/src/Hackage/Security/RepoTool/Paths.hs | haskell | | Additional paths
* Repo
* Keys
------------------------------------------------------------------------------
Repo
------------------------------------------------------------------------------
------------------------------------------------------------------------------
Keys
---------------------------------... | module Hackage.Security.RepoTool.Paths (
RepoLoc(..)
, KeyRoot
, KeyPath
, KeysLoc(..)
) where
import Hackage.Security.Util.Path
import Hackage.Security.Util.Pretty
newtype RepoLoc = RepoLoc { repoLocPath :: Path Absolute }
deriving Eq
data KeyRoot
type KeyPath = Path KeyRoot
instance Pretty (Path K... |
c525524ff9eb2bd28556dae9b4cd6646992c5d0c7887bad3b1116c6a58e2d3d8 | erlymon/erlymon | em_http_api_session_handler.erl | %%%-------------------------------------------------------------------
@author
( C ) 2015 , < >
%%% @doc
Erlymon is an open source GPS tracking system for various GPS tracking devices .
%%%
Copyright ( C ) 2015 , < > .
%%%
This file is part of Erlymon .
%%%
Erlymon is free software : yo... | null | https://raw.githubusercontent.com/erlymon/erlymon/2250619783d6da1e33a502911a8fa52ce016c094/apps/erlymon/src/em_http/handlers/em_http_api_session_handler.erl | erlang | -------------------------------------------------------------------
@doc
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
along with this program. If not, see </>.
@end
-------------------------------------------------------... | @author
( C ) 2015 , < >
Erlymon is an open source GPS tracking system for various GPS tracking devices .
Copyright ( C ) 2015 , < > .
This file is part of Erlymon .
Erlymon is free software : you can redistribute it and/or modify
it under the terms of the GNU Affero General Publ... |
2d4d7925f0f69587fe310416c5d5f65b9790bcf57da2cc26e09525b561ac310f | Ptival/chick | Utils.hs | module Utils
( extractApps,
extractLams,
extractPi,
extractPis,
extractSomeApps,
extractSomeLams,
extractSomePis,
foldlWith,
foldrWith,
isPi,
mapWithIndex,
mkApps,
mkLams,
mkPis,
orElse,
orElse',
splitList,
unzipMaybe,
withState,
)
where
impor... | null | https://raw.githubusercontent.com/Ptival/chick/a5ce39a842ff72348f1c9cea303997d5300163e2/backend/lib/Utils.hs | haskell | runSkipTrace :: Sem '[Trace] a -> IO a
runSkipTrace = return <$> skipTrace
skipTrace :: Sem '[Trace] a -> a
skipTrace (E u q) =
case extract u of
Trace _ -> skipTrace (qApp q ())
| `withState` localizes a modification of the state to a given effectful computation
| `f a b c` becomes `(f, [a, b, c])`
TOD... | module Utils
( extractApps,
extractLams,
extractPi,
extractPis,
extractSomeApps,
extractSomeLams,
extractSomePis,
foldlWith,
foldrWith,
isPi,
mapWithIndex,
mkApps,
mkLams,
mkPis,
orElse,
orElse',
splitList,
unzipMaybe,
withState,
)
where
impor... |
198734af3d754a32971b34a0c3f319622b826fb14f0f4de7adf3e1baa989aa79 | tud-fop/vanda-haskell | WTA_BHPS.hs | -----------------------------------------------------------------------------
-- |
Module : . Grammar . . WTA_BHPS
Copyright : ( c ) Technische Universität Dresden 2013
-- License : BSD-style
--
-- Maintainer :
-- Stability : unknown
-- Portability : portable
--
Queries an Automaton tha... | null | https://raw.githubusercontent.com/tud-fop/vanda-haskell/3214966361b6dbf178155950c94423eee7f9453e/library/Vanda/Grammar/NGrams/WTA_BHPS.hs | haskell | ---------------------------------------------------------------------------
|
License : BSD-style
Maintainer :
Stability : unknown
Portability : portable
early as possible to enable early pruning.
---------------------------------------------------------------------------
^ language model
^ relab... | Module : . Grammar . . WTA_BHPS
Copyright : ( c ) Technische Universität Dresden 2013
Queries an Automaton that represents an n - gram model . Assigns weights as
module Vanda.Grammar.NGrams.WTA_BHPS
( State'
, delta
, mapState
, makeWTA
) where
import Data.Hashable
import Data.WTA
impo... |
387235ab28dd45b2ff9541fba9665e0ace5297cf3384b29bfcec6823a7b5e608 | janestreet/jsonaf | jsonafable.mli | open! Base
include module type of Jsonaf_kernel.Jsonafable
module Of_jsonafable
(Jsonafable : S) (M : sig
type t
val of_jsonafable : Jsonafable.t -> t
val to_jsonafable : t -> Jsonafable.t
end) : S with type t := M.t
mo... | null | https://raw.githubusercontent.com/janestreet/jsonaf/9f8226165a329db47119f751d02449f2751d87c9/src/jsonafable.mli | ocaml | open! Base
include module type of Jsonaf_kernel.Jsonafable
module Of_jsonafable
(Jsonafable : S) (M : sig
type t
val of_jsonafable : Jsonafable.t -> t
val to_jsonafable : t -> Jsonafable.t
end) : S with type t := M.t
mo... | |
a2c8b684a725fde7b18a147ac534380f8a8ec58f46e2042ee81139aa0e035d4b | NorfairKing/smos | Clock.hs | {-# LANGUAGE OverloadedStrings #-}
# LANGUAGE RecordWildCards #
# LANGUAGE ScopedTypeVariables #
module Smos.Report.Clock
( module Smos.Report.Clock,
module Smos.Report.Clock.Types,
)
where
import Cursor.Simple.Forest
import Cursor.Simple.Tree
import Data.Function
import Data.List
import Data.List.NonEmpty (N... | null | https://raw.githubusercontent.com/NorfairKing/smos/4891d1c7a462040ac63771058ab35e35abb4e46d/smos-report/src/Smos/Report/Clock.hs | haskell | # LANGUAGE OverloadedStrings # | # LANGUAGE RecordWildCards #
# LANGUAGE ScopedTypeVariables #
module Smos.Report.Clock
( module Smos.Report.Clock,
module Smos.Report.Clock.Types,
)
where
import Cursor.Simple.Forest
import Cursor.Simple.Tree
import Data.Function
import Data.List
import Data.List.NonEmpty (NonEmpty (..))
import qualified Data... |
b54589e8fb67b6b70425572fc84bc48218d95ebc577f85209587f6b27352993e | bitwize/gamsock | gamsock.scm | Gamsock -- an enhanced socket library for Gambit built around the Scsh
; socket API.
Copyright ( c ) 2006 - 2007 by .
Scsh constant files copyright ( c ) 1993 - 1994 by and
Carlstrom .
; For redistribution conditions, please see the file COPYING.
(include "gamsock-headers.scm")
(c-declare "
#ifndef UNI... | null | https://raw.githubusercontent.com/bitwize/gamsock/a2ac717614cbf7b5d4a37a6208932f91221c32c3/gamsock.scm | scheme | socket API.
For redistribution conditions, please see the file COPYING.
This is the definition of the socket type. It should be treated as opaque.
This is the definition of the socket address type.
This is the definition of an internal type which holds
all of the data for an IPv6 address.
An exception that ... | Gamsock -- an enhanced socket library for Gambit built around the Scsh
Copyright ( c ) 2006 - 2007 by .
Scsh constant files copyright ( c ) 1993 - 1994 by and
Carlstrom .
(include "gamsock-headers.scm")
(c-declare "
#ifndef UNIX_PATH_MAX
#define UNIX_PATH_MAX 108
#endif
")
(define-macro (define-c-const... |
d632036157882acf4342f8cb01d9f4c7559c49b284ee9edb55d2955a9a645a16 | neongreen/haskell-ex | Main.hs | # LANGUAGE InstanceSigs #
--------------------------------------------------------------------------------
18 . Trie /{trie}/
--
Construct a trie from all words in a dictionary and implement search for
-- words by prefix. Here's an example of a trie for
-- /{cool, cat, coal, bet, bean}/:
--
-- b c
-- ... | null | https://raw.githubusercontent.com/neongreen/haskell-ex/345115444fdf370a43390fd942e2851b9b1963ad/week4/trie/stites/Main.hs | haskell | ------------------------------------------------------------------------------
words by prefix. Here's an example of a trie for
/{cool, cat, coal, bet, bean}/:
b c
/ / \
e a o
/ \ / / \
t a t a o
| | |
n l l
You... | # LANGUAGE InstanceSigs #
18 . Trie /{trie}/
Construct a trie from all words in a dictionary and implement search for
the trie ( e.g. in the sample one there are 13 nodes ) , and then answer user 's
Trie created . There are 13 nodes .
data Trie a = Empty | Node ( Map a ( Trie a ) )
module Main where
... |
b1e2e75962a936c8d1489b06599044bce6447f5f7ef5e6c42eaef76ea0c4903f | bortexz/tacos | tacos.clj | (ns bortexz.tacos
(:require [clojure.math.numeric-tower :as math-nt]
[bortexz.utils.math :as umath]
[bortexz.graphcom :as g]
[better-cond.core :as bc]
[bortexz.tacos.timeseries :as ts]))
(defn derived
"Creates a new derived timeseries node (a.k.a indicator) given the... | null | https://raw.githubusercontent.com/bortexz/tacos/5e3bdc828b54bb992bd48d21064e318ba3848404/src/bortexz/tacos.clj | clojure | uptrend
downtrend | (ns bortexz.tacos
(:require [clojure.math.numeric-tower :as math-nt]
[bortexz.utils.math :as umath]
[bortexz.graphcom :as g]
[better-cond.core :as bc]
[bortexz.tacos.timeseries :as ts]))
(defn derived
"Creates a new derived timeseries node (a.k.a indicator) given the... |
d63042b61a6322604a0308509839850cb9ca454155adf319ef1f1a250896d9ca | fulcrologic/fulcro-rad-datomic | indexed_access_spec.clj | (ns com.fulcrologic.rad.database-adapters.indexed-access-spec
(:require
[clojure.test :refer [use-fixtures]]
[com.fulcrologic.rad.database-adapters.datomic :as datomic]
[com.fulcrologic.rad.database-adapters.indexed-access-checks :refer [run-checks]]
[datomic.api :as d]
[fulcro-spec.core :refer [s... | null | https://raw.githubusercontent.com/fulcrologic/fulcro-rad-datomic/0234b6d15524a0e37e26cfd7b26aafda52b07265/src/test/com/fulcrologic/rad/database_adapters/indexed_access_spec.clj | clojure | (ns com.fulcrologic.rad.database-adapters.indexed-access-spec
(:require
[clojure.test :refer [use-fixtures]]
[com.fulcrologic.rad.database-adapters.datomic :as datomic]
[com.fulcrologic.rad.database-adapters.indexed-access-checks :refer [run-checks]]
[datomic.api :as d]
[fulcro-spec.core :refer [s... | |
ac5b3991bb71e5b472e15a68804897caffd0b27c3ab12ef331ed1d1589bbe3e1 | acieroid/scala-am | pcounter9.scm | (letrec ((counter (atom 0))
(thread (lambda (n)
(letrec ((old (deref counter))
(new (+ old 1)))
(if (compare-and-set! counter old new)
#t
(thread n)))))
(t1 (future (thread 1)))
(t2 (future... | null | https://raw.githubusercontent.com/acieroid/scala-am/13ef3befbfc664b77f31f56847c30d60f4ee7dfe/test/concurrentScheme/futures/variations/pcounter9.scm | scheme | (letrec ((counter (atom 0))
(thread (lambda (n)
(letrec ((old (deref counter))
(new (+ old 1)))
(if (compare-and-set! counter old new)
#t
(thread n)))))
(t1 (future (thread 1)))
(t2 (future... | |
bd05762e73bd4e275b5c18ed915873da823881ffe78e5f4627d70421aab8a9cf | mklinik/hmud | Test.hs | module Hmud.Test where
import Test.Hspec.HUnit
import Test.Hspec
import Test.HUnit
import Data.Maybe (fromJust, isNothing, isJust)
import Data.Either.Unwrap
import qualified Data.Map as Map
import Data.Map (Map)
import qualified Data.List as List
import System.IO
import qualified Control.Monad.State as State
import C... | null | https://raw.githubusercontent.com/mklinik/hmud/5ba32f29170a098e007d50688df32cf8919b6bf1/Hmud/Test.hs | haskell | Xmpp.Users
system tests, maps input messages to output messages | module Hmud.Test where
import Test.Hspec.HUnit
import Test.Hspec
import Test.HUnit
import Data.Maybe (fromJust, isNothing, isJust)
import Data.Either.Unwrap
import qualified Data.Map as Map
import Data.Map (Map)
import qualified Data.List as List
import System.IO
import qualified Control.Monad.State as State
import C... |
28c287a871876bd308798390e8cd87cdfd0262a059599706f49c553bd3c62066 | damienlepage/vhector | hector.clj | (ns vhector.internal.hector
(:use
[vhector.internal.util :only [single?]])
(:import
[me.prettyprint.hector.api.factory HFactory]
[me.prettyprint.cassandra.serializers BytesArraySerializer]
[me.prettyprint.cassandra.model CqlQuery]
[java.io DataOutputStream ByteArrayOutputStream DataInputStream ... | null | https://raw.githubusercontent.com/damienlepage/vhector/0cd9697ab0d3a1327a76b0f5c3ee7fa7b9309b0e/src/vhector/internal/hector.clj | clojure | make sure we don't overwrite due to typed-columns
consider that nil as stop means normal order
make sure typed cols are included in the
value is not used but must not be null
count(*) =>
keyword | (ns vhector.internal.hector
(:use
[vhector.internal.util :only [single?]])
(:import
[me.prettyprint.hector.api.factory HFactory]
[me.prettyprint.cassandra.serializers BytesArraySerializer]
[me.prettyprint.cassandra.model CqlQuery]
[java.io DataOutputStream ByteArrayOutputStream DataInputStream ... |
c215372f260e54ce130f1fbcb70d01250ee0d0706614a54ad207d6a0c31223f5 | REMath/mit_16.399 | symbol_Table.mli | (* symbol_Table.mli *)
type variable = int
(* symbol table *)
val init_symb_table : unit -> unit
val add_symb_table : string -> variable
(* variables *)
val number_of_variables : unit -> int
val for_all_variables : (variable -> 'a) -> unit
val print_variable : variable -> unit
val print_map_variables : (variabl... | null | https://raw.githubusercontent.com/REMath/mit_16.399/3f395d6a9dfa1ed232d307c3c542df3dbd5b614a/project/Generic-FW-Abstract-Interpreter/symbol_Table.mli | ocaml | symbol_Table.mli
symbol table
variables | type variable = int
val init_symb_table : unit -> unit
val add_symb_table : string -> variable
val number_of_variables : unit -> int
val for_all_variables : (variable -> 'a) -> unit
val print_variable : variable -> unit
val print_map_variables : (variable -> unit) -> unit
|
b0b66d58b718e6a148ea5d96084d719da715a26d2f78891b12252a65707d462f | krisajenkins/yesql | util.clj | (ns yesql.util
(:require [clojure.java.io :as io]
[clojure.string :as string]
[clojure.pprint :refer [pprint]])
(:import [java.io FileNotFoundException]))
(defn underscores-to-dashes
[string]
(when string
(string/replace string "_" "-")))
(defn str-non-nil
"Exactly like `clojure.... | null | https://raw.githubusercontent.com/krisajenkins/yesql/333750e5bc90aebba3a8578b744cfa146cf68ba9/src/yesql/util.clj | clojure | (ns yesql.util
(:require [clojure.java.io :as io]
[clojure.string :as string]
[clojure.pprint :refer [pprint]])
(:import [java.io FileNotFoundException]))
(defn underscores-to-dashes
[string]
(when string
(string/replace string "_" "-")))
(defn str-non-nil
"Exactly like `clojure.... | |
e2091f2ae1fdb9c587baf225aa47d7a951f29fc12cc1447cc1e9ed69f3d92750 | rd--/hsc3 | b_write.help.hs | Sound.Sc3.Lang.Help.viewServerHelp "/b_write"
| null | https://raw.githubusercontent.com/rd--/hsc3/024d45b6b5166e5cd3f0142fbf65aeb6ef642d46/Help/Server/b_write.help.hs | haskell | Sound.Sc3.Lang.Help.viewServerHelp "/b_write"
| |
fd3d996f215d1f2c0f99b56483cb90864ed305271e85f3f529e39d95180bad76 | pschachte/wybe | BodyBuilder.hs | -- File : BodyBuilder.hs
Author :
-- Purpose : A monad to build up a procedure Body, with copy propagation
Copyright : ( c ) 2015 . All rights reserved .
License : Licensed under terms of the MIT license . See the file
-- : LICENSE in the root directory of this project.
module B... | null | https://raw.githubusercontent.com/pschachte/wybe/7914ff3bd3649fb22b3e6d884f46ef95f6effb0d/src/BodyBuilder.hs | haskell | File : BodyBuilder.hs
Purpose : A monad to build up a procedure Body, with copy propagation
: LICENSE in the root directory of this project.
--------------------------------------------------------------
The BodyBuilder Monad
buildBody runs the monad, producing a ProcBody.
... | Author :
Copyright : ( c ) 2015 . All rights reserved .
License : Licensed under terms of the MIT license . See the file
module BodyBuilder (
BodyBuilder, buildBody, freshVarName, instr, buildFork, completeFork,
beginBranch, endBranch, definiteVariableValue, argExpandedPrim
) where
import... |
c3f4874d4e0f0d22100e6f7bf6b18a5eae70b510d4e7452d8f7f07e0e9df79b3 | mfikes/fifth-postulate | ns119.cljs | (ns fifth-postulate.ns119)
(defn solve-for01 [xs v]
(for [ndx0 (range 0 (- (count xs) 3))
ndx1 (range (inc ndx0) (- (count xs) 2))
ndx2 (range (inc ndx1) (- (count xs) 1))
ndx3 (range (inc ndx2) (count xs))
:when (= v (+ (xs ndx0) (xs ndx1) (xs ndx2) (xs ndx3)))]
(list (x... | null | https://raw.githubusercontent.com/mfikes/fifth-postulate/22cfd5f8c2b4a2dead1c15a96295bfeb4dba235e/src/fifth_postulate/ns119.cljs | clojure | (ns fifth-postulate.ns119)
(defn solve-for01 [xs v]
(for [ndx0 (range 0 (- (count xs) 3))
ndx1 (range (inc ndx0) (- (count xs) 2))
ndx2 (range (inc ndx1) (- (count xs) 1))
ndx3 (range (inc ndx2) (count xs))
:when (= v (+ (xs ndx0) (xs ndx1) (xs ndx2) (xs ndx3)))]
(list (x... | |
93dde6493d351ce51d3b8a32fc94531b39510430957574562179569f1c3d1a57 | cnuernber/dtype-next | ffi.clj | (ns tech.v3.datatype.ffi)
(defmacro define-library!
[lib-varname lib-fns _lib-symbols _error-checker]
(let [fn-defs (second lib-fns)]
`(do
(def ~lib-varname :ok)
~@(map (fn [[fn-name fn-data]]
(let [argvec (mapv first (:argtypes fn-data))]
`(defn ~(symbol (name ... | null | https://raw.githubusercontent.com/cnuernber/dtype-next/4e43212942aafa0145640cf6b655bb83855f567d/resources/clj-kondo.exports/cnuernber/dtype-next/tech/v3/datatype/ffi.clj | clojure | (ns tech.v3.datatype.ffi)
(defmacro define-library!
[lib-varname lib-fns _lib-symbols _error-checker]
(let [fn-defs (second lib-fns)]
`(do
(def ~lib-varname :ok)
~@(map (fn [[fn-name fn-data]]
(let [argvec (mapv first (:argtypes fn-data))]
`(defn ~(symbol (name ... | |
abe188fdb128522063c66580bf821526f6e49adcb608b1833853b3901089e280 | iij/lmq | lmq_hook_crash.erl | -module(lmq_hook_crash).
-export([init/0, hooks/0, activate/1, deactivate/1]).
-export([hook1/2]).
init() ->
ok.
hooks() ->
[hook1, hook2].
activate([N]) ->
{ok, N}.
deactivate(N) ->
N / 0.
hook1(N, State) ->
State / N.
| null | https://raw.githubusercontent.com/iij/lmq/3f01c555af973a07a3f2b22ff95a2bc1c7930bc2/test/lmq_hook_crash.erl | erlang | -module(lmq_hook_crash).
-export([init/0, hooks/0, activate/1, deactivate/1]).
-export([hook1/2]).
init() ->
ok.
hooks() ->
[hook1, hook2].
activate([N]) ->
{ok, N}.
deactivate(N) ->
N / 0.
hook1(N, State) ->
State / N.
| |
14323f34b3eed6793896f7143c3318fd0ccc4e71b8d9a99bae7fe6319073aaf0 | scarvalhojr/haskellbook | section24.11.hs |
import Data.Char (digitToInt)
import Control.Applicative ((<|>), (<*), (*>))
import Text.Parser.Char (char, oneOf)
import Text.Parser.Combinators (some)
import Text.Trifecta (Parser, parseString)
2 .
parseDigit :: Parser Char
parseDigit = oneOf ['0'..'9']
base10Integer :: Parser... | null | https://raw.githubusercontent.com/scarvalhojr/haskellbook/6016a5a78da3fc4a29f5ea68b239563895c448d5/chapter24/section24.11.hs | haskell |
import Data.Char (digitToInt)
import Control.Applicative ((<|>), (<*), (*>))
import Text.Parser.Char (char, oneOf)
import Text.Parser.Combinators (some)
import Text.Trifecta (Parser, parseString)
2 .
parseDigit :: Parser Char
parseDigit = oneOf ['0'..'9']
base10Integer :: Parser... | |
6bfb404e521f05cb46a11d126abf96ecadf9b63e9d3770aec0409012e97fde3d | derekmcloughlin/pearls | chap09e.hs | import System.IO
import Data.List
data Person = Person String |
Celebrity String
deriving (Show, Eq)
type Party = [Person]
knows :: Person -> Person -> Bool
knows (Person p) (Celebrity c) = True
knows (Celebrity c) (Person p) = False
knows (Celebrity c1) (Celebrity c2) = True
-- Most pe... | null | https://raw.githubusercontent.com/derekmcloughlin/pearls/42bc6ea0fecc105386a8b75789f563d44e05b772/chap09/chap09e.hs | haskell | Most people at the party don't know each other
Everyone knows themselves | import System.IO
import Data.List
data Person = Person String |
Celebrity String
deriving (Show, Eq)
type Party = [Person]
knows :: Person -> Person -> Bool
knows (Person p) (Celebrity c) = True
knows (Celebrity c) (Person p) = False
knows (Celebrity c1) (Celebrity c2) = True
except f... |
b318e016e8ce51dab5920c1d2ff3599b8d7e436f425446e181fc7e50bd0dd501 | lispgames/glop | glop.lisp | -*- Mode : Lisp ; Syntax : ANSI - Common - Lisp ; Base : 10 ; indent - tabs - mode : nil -*-
(in-package #:glop)
(defdfun gl-get-proc-address (proc-name)
"Get foreign pointer to the GL extension designed by PROC-NAME."
(declare (ignore proc-name))
(error 'not-implemented))
;;; Display management
(defgeneric ... | null | https://raw.githubusercontent.com/lispgames/glop/45e722ab4a0cd2944d550bf790206b3326041e38/src/glop.lisp | lisp | Syntax : ANSI - Common - Lisp ; Base : 10 ; indent - tabs - mode : nil -*-
Display management
XXX: stupid distance match is maybe not the best option here...
Context management
Window management
(unless (eq state (window-fullscreen window))
(call-next-method)
already passed so would always wait N frames.... |
(in-package #:glop)
(defdfun gl-get-proc-address (proc-name)
"Get foreign pointer to the GL extension designed by PROC-NAME."
(declare (ignore proc-name))
(error 'not-implemented))
(defgeneric list-video-modes ()
(:documentation
"Returns a list of all available video modes as a list video-mode structs."))... |
e775d42400a1fe806e3b124bd29ecd0ddd14a7897221e4a2448707ecc78884f0 | facebookarchive/pfff | class_basic.ml | class foo =
object(self)
method foo = 1
end
| null | https://raw.githubusercontent.com/facebookarchive/pfff/ec21095ab7d445559576513a63314e794378c367/tests/ml/parsing/class_basic.ml | ocaml | class foo =
object(self)
method foo = 1
end
| |
ae77817b857556e97b3aa2fe73a63a881e43c4853ee990ccdd55cb0e9965ec76 | databrary/databrary | Service.hs | {-# LANGUAGE OverloadedStrings #-}
module EZID.Service
( EZID(..)
, initEZID
) where
import Control.Monad (unless, forM)
import qualified Data.ByteString as BS
import qualified Data.ByteString.Char8 as BSC
import qualified Network.HTTP.Client as HC
import Network.HTTP.Types (hContentType)
import qualified Store... | null | https://raw.githubusercontent.com/databrary/databrary/c5a03129c6c113a12fc649b2852a972325bfcdb9/src/EZID/Service.hs | haskell | # LANGUAGE OverloadedStrings # | module EZID.Service
( EZID(..)
, initEZID
) where
import Control.Monad (unless, forM)
import qualified Data.ByteString as BS
import qualified Data.ByteString.Char8 as BSC
import qualified Network.HTTP.Client as HC
import Network.HTTP.Types (hContentType)
import qualified Store.Config as C
data EZID = EZID
{ ... |
913bc0d6202b9e3735edfc6b1a33a77151cfba72937da7fbd1fc6000f1765a32 | theodormoroianu/SecondYearCourses | LambdaChurch_20210415164346.hs | module LambdaChurch where
import Data.Char (isLetter)
import Data.List ( nub )
class ShowNice a where
showNice :: a -> String
class ReadNice a where
readNice :: String -> (a, String)
data Variable
= Variable
{ name :: String
, count :: Int
}
deriving (Show, Eq, Ord)
var :: String -> Variable
var ... | null | https://raw.githubusercontent.com/theodormoroianu/SecondYearCourses/5e359e6a7cf588a527d27209bf53b4ce6b8d5e83/FLP/Laboratoare/Lab%209/.history/LambdaChurch_20210415164346.hs | haskell | alpha-equivalence
subst u x t defines [u/x]t, i.e., substituting u for x in t
This substitution avoids variable captures so it is safe to be used when
reducing terms with free variables (e.g., if evaluating inside lambda abstractions)
^ substitution term
^ variable to be substitutes
^ term in which the substit... | module LambdaChurch where
import Data.Char (isLetter)
import Data.List ( nub )
class ShowNice a where
showNice :: a -> String
class ReadNice a where
readNice :: String -> (a, String)
data Variable
= Variable
{ name :: String
, count :: Int
}
deriving (Show, Eq, Ord)
var :: String -> Variable
var ... |
ab5e7a9a8149e69e7810ffa29fa26bc0656782519c9e74f9065b01cdc37e6522 | tek/ribosome | Response.hs | module Ribosome.Host.Data.Response where
import Data.MessagePack (Object)
import Exon (exon)
import Ribosome.Host.Data.Request (RequestId (RequestId))
data Response =
Success Object
|
Error Text
deriving stock (Eq, Show)
formatResponse :: Response -> Text
formatResponse = \case
Success o -> show o
Error... | null | https://raw.githubusercontent.com/tek/ribosome/a676b4f0085916777bfdacdcc761f82d933edb80/packages/host/lib/Ribosome/Host/Data/Response.hs | haskell | module Ribosome.Host.Data.Response where
import Data.MessagePack (Object)
import Exon (exon)
import Ribosome.Host.Data.Request (RequestId (RequestId))
data Response =
Success Object
|
Error Text
deriving stock (Eq, Show)
formatResponse :: Response -> Text
formatResponse = \case
Success o -> show o
Error... | |
5d977a71bb8ee961f0da196847d17e0aeb1dc3f7c05b227b99aae52e2ce118b5 | bazurbat/chicken-scheme | posix.import.scm | ;;;; posix.import.scm - import library for "posix" module
;
Copyright ( c ) 2008 - 2016 , The CHICKEN Team
; All rights reserved.
;
; Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following
; conditions are met:
;
; Redistributions of source code mu... | null | https://raw.githubusercontent.com/bazurbat/chicken-scheme/f0c9d1fd8b68eb322e320e65ec40b0bf7d1b41dc/posix.import.scm | scheme | posix.import.scm - import library for "posix" module
All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following
conditions are met:
Redistributions of source code must retain the above copyright notice, this list of condition... | Copyright ( c ) 2008 - 2016 , The CHICKEN Team
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS " AS IS " AND ANY EXPRESS
CONTRIBUTORS BE LIABLE FOR ANY DIRECT , INDIRECT , INCIDENTAL , SPECIAL , EXEMPLARY , OR
CONSEQUENTIAL DAMAGES ( INCLUDING , BUT NOT LIMITED TO , PROCUREMENT OF SUBSTITUTE... |
60992e263be195ccef87aca02d147874d441dbdbea13c6fd02c1a201671d0aaf | exoscale/ex | auspex_test.clj | (ns exoscale.ex.test.auspex-test
(:use clojure.test)
(:require
[exoscale.ex :as ex]
[exoscale.ex.auspex :as c]
[qbits.auspex :as a]
[clojure.spec.test.alpha]))
(clojure.spec.test.alpha/instrument)
(deftest test-auspex
(let [ex (ex-info "bar" {::ex/type ::bar1 :bar :baz})]
(is (= ::boom
... | null | https://raw.githubusercontent.com/exoscale/ex/a2172c271014dff3238f6a05b465af273252e87c/modules/ex-auspex/test/exoscale/ex/test/auspex_test.clj | clojure | (ns exoscale.ex.test.auspex-test
(:use clojure.test)
(:require
[exoscale.ex :as ex]
[exoscale.ex.auspex :as c]
[qbits.auspex :as a]
[clojure.spec.test.alpha]))
(clojure.spec.test.alpha/instrument)
(deftest test-auspex
(let [ex (ex-info "bar" {::ex/type ::bar1 :bar :baz})]
(is (= ::boom
... | |
9604a260c685041763d8bccdc987cfde192ea4f574b232eb55775feb9123b6e2 | geneweb/geneweb | gwdb_driver.ml | Copyright ( c ) 1998 - 2007 INRIA
open Dbdisk
type istr = int
type ifam = int
type iper = int
let string_of_iper = string_of_int
let string_of_ifam = string_of_int
let string_of_istr = string_of_int
let iper_of_string = int_of_string
let ifam_of_string = int_of_string
let istr_of_string = int_of_string
let dummy_i... | null | https://raw.githubusercontent.com/geneweb/geneweb/7b71f8f2f75e0e847818f821a0267938f38c9cf5/lib/gwdb-legacy/gwdb_driver.ml | ocaml | FIXME: lock
* Persons
* Families
Restrict file
FIXME: these values should not be global | Copyright ( c ) 1998 - 2007 INRIA
open Dbdisk
type istr = int
type ifam = int
type iper = int
let string_of_iper = string_of_int
let string_of_ifam = string_of_int
let string_of_istr = string_of_int
let iper_of_string = int_of_string
let ifam_of_string = int_of_string
let istr_of_string = int_of_string
let dummy_i... |
353b9d07d289d8ffa0c2c471414528d4cc976a1e601f960499b08585bbfa1e18 | backtracking/ocaml-bazaar | idd.ml | (**************************************************************************)
(* *)
Copyright ( C )
(* *)
(* This software is free software;... | null | https://raw.githubusercontent.com/backtracking/ocaml-bazaar/e8cb0a4549512e5369154579eaec9dcef04a8379/idd.ml | ocaml | ************************************************************************
This software is free software; you can redistribute it and/or
described in file LICENSE.... | Copyright ( C )
modify it under the terms of the GNU Library General Public
License version 2.1 , with the special exception on linking
type idd = {
lo: idd;
p: idd;
hi: idd;
}
* this is lo + x(p ) * hi
invariant max(lo , hi ) < ) , 0 ... |
456834cd9758668403fc35cb62ae7b950de4796dae94d8cd67cb494c80eac1bf | jfeser/castor | value.ml | open Core
open Collections
module T = struct
type t =
| Int of int
| Date of Date.t
| String of string
| Bool of bool
| Fixed of Fixed_point.t
| Null
[@@deriving compare, equal, hash, sexp, variants]
end
include T
module C = Comparable.Make (T)
module O : Comparable.Infix with type t := t ... | null | https://raw.githubusercontent.com/jfeser/castor/432ba569fb36f0a79883e647336b9a4700ebdf38/lib/value.ml | ocaml | open Core
open Collections
module T = struct
type t =
| Int of int
| Date of Date.t
| String of string
| Bool of bool
| Fixed of Fixed_point.t
| Null
[@@deriving compare, equal, hash, sexp, variants]
end
include T
module C = Comparable.Make (T)
module O : Comparable.Infix with type t := t ... | |
ff6200ee509d72e0d0dec0e73290edd4846ffdbcc1f9dfa30fb89ec9f0dfefca | noinia/hgeometry | MST.hs | # LANGUAGE ScopedTypeVariables #
--------------------------------------------------------------------------------
-- |
-- Module : Algorithms.Graph.MST
Copyright : ( C )
-- License : see the LICENSE file
Maintainer :
---------------------------------------------------------------------------... | null | https://raw.githubusercontent.com/noinia/hgeometry/a6abecb1ce4a7fd96b25cc1a5c65cd4257ecde7a/hgeometry-combinatorial/src/Algorithms/Graph/MST.hs | haskell | ------------------------------------------------------------------------------
|
Module : Algorithms.Graph.MST
License : see the LICENSE file
------------------------------------------------------------------------------
------------------------------------------------------------------------------
| Min... | # LANGUAGE ScopedTypeVariables #
Copyright : ( C )
Maintainer :
module Algorithms.Graph.MST( mst
, mstEdges
, makeTree
) where
import Algorithms.Graph.DFS (AdjacencyLists, dfs')
import Control.Monad (f... |
fb6654544aef936eb51f213601e7145856d35ef1d15410597a765f1f74227938 | qfpl/applied-fp-course | File.hs | module Level07.Conf.File where
import Data.ByteString (ByteString)
import qualified Data.ByteString.Char8 as LBS
import Data.Text (pack)
import Data.Bifunctor (first)
import Waargonaut.Attoparsec (pureDecodeAttoparsecByteString)
import Cont... | null | https://raw.githubusercontent.com/qfpl/applied-fp-course/d5a94a9dcee677bc95a5184c2ed13329c9f07559/src/Level07/Conf/File.hs | haskell | $setup
>>> :set -XOverloadedStrings
| Update these tests when you've completed this function.
| readConfFile
Left (ConfigFileReadError badFileName.no: openBinaryFile: does not exist (No such file or directory))
>>> readConfFile "files/test.json"
Right "{\"foo\":33}\n"
and construct our ``PartialConf``. | module Level07.Conf.File where
import Data.ByteString (ByteString)
import qualified Data.ByteString.Char8 as LBS
import Data.Text (pack)
import Data.Bifunctor (first)
import Waargonaut.Attoparsec (pureDecodeAttoparsecByteString)
import Cont... |
22f15d896a681cfde61c74cd1e3b1bfb34649e16b8bddf4cb83b94a82c22ca02 | ryanpbrewster/haskell | CoinJam.hs | module Main where
import Data.Maybe
import Data.List
data JamCoin = JamCoin String [Integer] deriving (Show)
validateJamCoin :: Integer -> Maybe JamCoin
validateJamCoin n =
let
bitstr = bitString n
interpretations = [ interpret b bitstr | b <- [2..10] ]
evidence = map nonTrivialDivisor interpretations
... | null | https://raw.githubusercontent.com/ryanpbrewster/haskell/6edd0afe234008a48b4871032dedfd143ca6e412/GoogleCodeJam/CoinJam/CoinJam.hs | haskell | module Main where
import Data.Maybe
import Data.List
data JamCoin = JamCoin String [Integer] deriving (Show)
validateJamCoin :: Integer -> Maybe JamCoin
validateJamCoin n =
let
bitstr = bitString n
interpretations = [ interpret b bitstr | b <- [2..10] ]
evidence = map nonTrivialDivisor interpretations
... | |
cc58c0ea2bf3588fc19e34b7b98c01b61ab8cfd73fa74a51a595c250fa7fff1d | Innf107/cobble-compiler | Parser.hs | module Cobble.Prelude.Parser (
module Exports
, many, sepBy, sepBy1
) where
import Cobble.Prelude as Exports hiding (optional, noneOf, try, many)
import Text.Parsec qualified as P
import Text.Parsec as Exports hiding (
(<|>), State, Empty, uncons
, many, sepBy, sepBy1
)
import Text... | null | https://raw.githubusercontent.com/Innf107/cobble-compiler/d6b0b65dad0fd6f1d593f7f859b1cc832e01e21f/src/Cobble/Prelude/Parser.hs | haskell | module Cobble.Prelude.Parser (
module Exports
, many, sepBy, sepBy1
) where
import Cobble.Prelude as Exports hiding (optional, noneOf, try, many)
import Text.Parsec qualified as P
import Text.Parsec as Exports hiding (
(<|>), State, Empty, uncons
, many, sepBy, sepBy1
)
import Text... | |
c4546387596ccc17f9e8cf8d74bf76412634da96162dac2ada0557d57c891c25 | haskell/cabal | Library.hs | {-# LANGUAGE DeriveDataTypeable #-}
# LANGUAGE DeriveGeneric #
module Distribution.Types.Library (
Library(..),
emptyLibrary,
explicitLibModules,
libModulesAutogen,
) where
import Distribution.Compat.Prelude
import Prelude ()
import Distribution.ModuleName
import Distribution.Types.BuildInfo
im... | null | https://raw.githubusercontent.com/haskell/cabal/53c5dc9f9b19d01284e2b07d43e010b732ac91a8/Cabal-syntax/src/Distribution/Types/Library.hs | haskell | # LANGUAGE DeriveDataTypeable #
^ What sigs need implementations?
^ Is the lib to be exposed by default? (i.e. whether its modules available in GHCi for example)
^ Whether this multilib can be used as a dependency for other packages.
| This instance is not good.
We need it for 'PackageDescription.Configuration.ad... | # LANGUAGE DeriveGeneric #
module Distribution.Types.Library (
Library(..),
emptyLibrary,
explicitLibModules,
libModulesAutogen,
) where
import Distribution.Compat.Prelude
import Prelude ()
import Distribution.ModuleName
import Distribution.Types.BuildInfo
import Distribution.Types.LibraryVisib... |
bbc394c326ccb00947b15c72791d8ce1893d7d217ac636e7b9188c45f60c45fa | CloudI/CloudI | tcp_echo_app.erl | %% Feel free to use, reuse and abuse the code in this file.
@private
-module(tcp_echo_app).
-behaviour(application).
%% API.
-export([start/2]).
-export([stop/1]).
%% API.
start(_Type, _Args) ->
{ok, _} = ranch1:start_listener(tcp_echo, 1,
ranch1_tcp, [{port, 5555}], echo_protocol, []),
tcp_echo_sup:start_lin... | null | https://raw.githubusercontent.com/CloudI/CloudI/3e45031c7ee3e974ead2612ea7dd06c9edf973c9/src/external/cloudi_x_ranch1/examples/tcp_echo/src/tcp_echo_app.erl | erlang | Feel free to use, reuse and abuse the code in this file.
API.
API. |
@private
-module(tcp_echo_app).
-behaviour(application).
-export([start/2]).
-export([stop/1]).
start(_Type, _Args) ->
{ok, _} = ranch1:start_listener(tcp_echo, 1,
ranch1_tcp, [{port, 5555}], echo_protocol, []),
tcp_echo_sup:start_link().
stop(_State) ->
ok.
|
3c40d6dce0a7b3aab8e4dc13fe5831794b01ed6b9f0bf8c01f3aa2c4b7b01c89 | AlfrescoLabs/technical-validation | project.clj | ;
Copyright © 2013,2014 ( )
;
Licensed under the Apache License , Version 2.0 ( the " License " ) ;
; you may not use this file except in compliance with the License.
; You may obtain a copy of the License at
;
; -2.0
;
; Unless required by applicable law or agreed to in writing, software
distributed under... | null | https://raw.githubusercontent.com/AlfrescoLabs/technical-validation/bd1b4b83f6a5e9dd150eedbeebecd30970d3b4aa/project.clj | clojure |
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
-2.0
Unless required by applicable law or agreed to in writing, software
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing pe... | Copyright © 2013,2014 ( )
distributed under the License is distributed on an " AS IS " BASIS ,
This file is part of an unsupported extension to Alfresco .
(defproject org.alfrescolabs.alfresco-technical-validation "0.7.0-SNAPSHOT"
:description "Performs technical validation of an Alfresco extension."
... |
355dbf5e349a47d4af22e940c3bb905b61d5eb6d3cc364e29fe5d8c38a62016a | schemedoc/implementation-metadata | stalingrad.scm | (title "Stalin∇")
(tagline "brutally optimizing compiler for VLAD, a pure Scheme with first-class automatic differentiation operators")
(github "Functional-AutoDiff/STALINGRAD")
| null | https://raw.githubusercontent.com/schemedoc/implementation-metadata/6280d9c4c73833dc5bd1c9bef9b45be6ea5beb68/schemes/stalingrad.scm | scheme | (title "Stalin∇")
(tagline "brutally optimizing compiler for VLAD, a pure Scheme with first-class automatic differentiation operators")
(github "Functional-AutoDiff/STALINGRAD")
| |
6850db9c7fb890b6d41d6144619be341e5b3aa8f244cbada81859bf81e8d08fb | coast-framework/coast | migrations.clj | (ns coast.migrations
(:require [coast.migrations.sql :as migrations.sql]
[coast.migrations.edn :as migrations.edn]
[coast.db.migrations]
[coast.db.connection :refer [connection]]
[coast.db.schema :as schema]
[clojure.java.io :as io]
[clojure.java... | null | https://raw.githubusercontent.com/coast-framework/coast/5d4a6db4cd87ed9a6d0e3015fdaec0ba0e1b6012/src/coast/migrations.clj | clojure | the last var defined
Figure out what the migration's given us...
don't auto-undo anything,
because we're gonna run 'down' exactly as provided;
and then put it back. | (ns coast.migrations
(:require [coast.migrations.sql :as migrations.sql]
[coast.migrations.edn :as migrations.edn]
[coast.db.migrations]
[coast.db.connection :refer [connection]]
[coast.db.schema :as schema]
[clojure.java.io :as io]
[clojure.java... |
2cea94395a700e25e2fd647fc0c4c9df1d4c4379e526696483b5a84bf625dfe6 | jpmonettas/clograms | build.clj | (ns build
(:require [clojure.tools.build.api :as b]
[clojure.string :as str]))
(def class-dir "target/classes")
(defn clean [_]
(b/delete {:path "target"}))
(defn jar [_]
(clean nil)
(let [lib 'com.github.jpmonettas/clograms
version (format "0.1.%s" (b/git-count-revs nil))
basis (... | null | https://raw.githubusercontent.com/jpmonettas/clograms/79a09e35f294b8b52af15a91a26487c0a90ea005/build.clj | clojure | (ns build
(:require [clojure.tools.build.api :as b]
[clojure.string :as str]))
(def class-dir "target/classes")
(defn clean [_]
(b/delete {:path "target"}))
(defn jar [_]
(clean nil)
(let [lib 'com.github.jpmonettas/clograms
version (format "0.1.%s" (b/git-count-revs nil))
basis (... | |
0751cb1be15d6a424f24189fd8a39bf1e200c99ede9d3c310ad65d5ecd6f10b1 | vii/dysfunkycom | bitmap-font.lisp |
(in-package :lispbuilder-sdl)
(defclass bitmap-font (font)
((characters :reader characters :initform (make-hash-table :test 'equal)))
(:default-initargs
:font-definition *font-8x8*))
(defmethod char-width ((self bitmap-font)) (char-width (font-definition self)))
(defmethod char-height ((self bitmap-font)) (ch... | null | https://raw.githubusercontent.com/vii/dysfunkycom/a493fa72662b79e7c4e70361ad0ea3c7235b6166/addons/lispbuilder-sdl/sdl/bitmap-font.lisp | lisp | Create a surface for the character, if one does not already exist.
If bg-color must match or font will be redrawn.
Redraw the chracter if fg- or bg-color mismatch or
a surface was created.
(defun load-font (file-name font-width font-height &optional (path-name ""))
"Load and initialise a simple font using a bmp... |
(in-package :lispbuilder-sdl)
(defclass bitmap-font (font)
((characters :reader characters :initform (make-hash-table :test 'equal)))
(:default-initargs
:font-definition *font-8x8*))
(defmethod char-width ((self bitmap-font)) (char-width (font-definition self)))
(defmethod char-height ((self bitmap-font)) (ch... |
6938a13224349ab2b59df11d25ca92154731238161e049951458ce194c16a375 | replikativ/superv.async | dev_server.clj | (ns superv.dev-server
(:require
[ring.util.response :as resp])
(:gen-class))
(defn handle-index [handler]
(fn [request]
(if (= [:get "/"] ((juxt :request-method :uri) request))
(resp/response
"<!DOCTYPE html>
<html>
<body>
<script src=\"js/client.js\"></script>
... | null | https://raw.githubusercontent.com/replikativ/superv.async/f9f4f51c2b51ac2fd90dd5ad18a053722882390f/src/superv/dev_server.clj | clojure | (ns superv.dev-server
(:require
[ring.util.response :as resp])
(:gen-class))
(defn handle-index [handler]
(fn [request]
(if (= [:get "/"] ((juxt :request-method :uri) request))
(resp/response
"<!DOCTYPE html>
<html>
<body>
<script src=\"js/client.js\"></script>
... | |
87406bbcd36e354663f10f16f55175ecf00a1fd513d4dc63e7b9592785452ffb | plapadoo/matrix-bot | Http.hs | {-# LANGUAGE DeriveFunctor #-}
# LANGUAGE FlexibleInstances #
# LANGUAGE TemplateHaskell #
module Plpd.Http
( HttpMethod(..)
, HttpRequest(..)
, HttpResponse(..)
, loggingHttp
, jsonHttpRequest
, hrUrl
, hrMethod
, hrContentType
, hrContent
, hresStatusCode
, hresContent
, JsonParseError... | null | https://raw.githubusercontent.com/plapadoo/matrix-bot/01ea062116200d407632b93743ef0dbc11a63715/src/Plpd/Http.hs | haskell | # LANGUAGE DeriveFunctor #
HTTP API abstraction
eitherDecode returns an error, but keeping the original reply is even better. | # LANGUAGE FlexibleInstances #
# LANGUAGE TemplateHaskell #
module Plpd.Http
( HttpMethod(..)
, HttpRequest(..)
, HttpResponse(..)
, loggingHttp
, jsonHttpRequest
, hrUrl
, hrMethod
, hrContentType
, hrContent
, hresStatusCode
, hresContent
, JsonParseError
, jpeOriginal
, jpeError
) w... |
07d48fae914a1ced0fa0704d3f51ef6165a8e5f1ad5a9e93b9de9aed95f75812 | jakubfijalkowski/hlibsass | Main.hs | {-# LANGUAGE BangPatterns #-}
# LANGUAGE CPP #
import Bindings.Libsass
import Foreign
import Foreign.C
import Test.Hspec
simpleCompile :: String -> IO String
simpleCompile str = do
cstr <- newCString str
ctx <- sass_make_data_context cstr
status <- sass_com... | null | https://raw.githubusercontent.com/jakubfijalkowski/hlibsass/aac28a320f4b7435dbb91af11413762679631f0f/tests/Main.hs | haskell | # LANGUAGE BangPatterns # | # LANGUAGE CPP #
import Bindings.Libsass
import Foreign
import Foreign.C
import Test.Hspec
simpleCompile :: String -> IO String
simpleCompile str = do
cstr <- newCString str
ctx <- sass_make_data_context cstr
status <- sass_compile_data_context ctx
if s... |
4ea2a2ed7fa1328d43b408503bc1a9ed53009f68d2fe36fe7fabbc0f34e1a5cd | moby/vpnkit | connect.ml | let src =
let src =
Logs.Src.create "port forward" ~doc:"forward local ports to the VM"
in
Logs.Src.set_level src (Some Logs.Info);
src
module Log = (val Logs.src_log src : Logs.LOG)
open Lwt.Infix
let ( >>*= ) m f = m >>= function
| Error (`Msg m) -> Lwt.fail_with m
| Ok x -> f x
let (/) = Filename... | null | https://raw.githubusercontent.com/moby/vpnkit/6039eac025e0740e530f2ff11f57d6d990d1c4a1/src/bin/connect.ml | ocaml | Avoid using `detach` because we don't want to exhaust the
thread pool since this will block the main TCP/IP stack. | let src =
let src =
Logs.Src.create "port forward" ~doc:"forward local ports to the VM"
in
Logs.Src.set_level src (Some Logs.Info);
src
module Log = (val Logs.src_log src : Logs.LOG)
open Lwt.Infix
let ( >>*= ) m f = m >>= function
| Error (`Msg m) -> Lwt.fail_with m
| Ok x -> f x
let (/) = Filename... |
0fae61229c9b385beb752bbcccf4ca8a3247bb28e6950fa6204d9fdb1f70be97 | ddmcdonald/sparser | note on multi-pass sentence control structure.lisp | SEE note on bio control structure.lisp
| null | https://raw.githubusercontent.com/ddmcdonald/sparser/304bd02d0cf7337ca25c8f1d44b1d7912759460f/Sparser/documentation/notes/note%20on%20multi-pass%20sentence%20control%20structure.lisp | lisp | SEE note on bio control structure.lisp
| |
021a89f23429c97f04baa47845a525e23e3ab4534beba8daaceb4642cbb06c9b | batterseapower/openshake | Shakefile.hs | import Development.Shake
import Development.Shake.System
import System.FilePath
main :: IO ()
main = shake $ do
("subdirectory" </> "foo") *> \x -> do
system' $ ["touch",x]
want ["subdirectory/foo"]
| null | https://raw.githubusercontent.com/batterseapower/openshake/4d590c6c4191d5970f2d88f45d9425421d4f64af/tests/creates-directory-implicitly/Shakefile.hs | haskell | import Development.Shake
import Development.Shake.System
import System.FilePath
main :: IO ()
main = shake $ do
("subdirectory" </> "foo") *> \x -> do
system' $ ["touch",x]
want ["subdirectory/foo"]
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.