_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 |
|---|---|---|---|---|---|---|---|---|
99285a7866792920d450474972490251848a0aeea1bc7072e65a7bc5a18c64a2 | jrm-code-project/LISP-Machine | stat-counters.lisp | -*- Mode : LISP ; Package : STAT - COUNTERS ; Base:8 ; : ZL -*-
(defun disable-microsecond-clock ()
(cond ((not (zerop (ldb si:%%processor-switch-use-stat2-for-usec-clock (si:%processor-switches nil))))
(si:%processor-switches
(dpb 0 si:%%processor-switch-use-stat2-for-usec-clock (si:%processo... | null | https://raw.githubusercontent.com/jrm-code-project/LISP-Machine/0a448d27f40761fafabe5775ffc550637be537b2/lambda/pace/hacks/stat-counters.lisp | lisp | Package : STAT - COUNTERS ; Base:8 ; : ZL -*- |
(defun disable-microsecond-clock ()
(cond ((not (zerop (ldb si:%%processor-switch-use-stat2-for-usec-clock (si:%processor-switches nil))))
(si:%processor-switches
(dpb 0 si:%%processor-switch-use-stat2-for-usec-clock (si:%processor-switches nil)))
(time:initialize-timebase))))
(defconst... |
c0f4a8fd01dc0a58927b9840bf35b3fd94e4b80a1ea9a73496265184dd278869 | kowainik/summoner | Form.hs | |
Module : Summoner . . Form
Copyright : ( c ) 2018 - 2022 Kowainik
SPDX - License - Identifier : MPL-2.0
Maintainer : < >
Stability : Stable
Portability : Portable
Form layout and form fields data types .
Module ... | null | https://raw.githubusercontent.com/kowainik/summoner/0c03dd0d6ee71c79227974b697f171396d3d09a7/summoner-tui/src/Summoner/Tui/Form.hs | haskell | User
Build tools
GitHub fields
| Alias for type of the @summoner@ form.
| Creates the input form from the given initial 'SummonKit'.
++ groupBorder "Tools"
]
| Returns 'True' when form field is active depending on the current state of 'SummonKit'.
| Gets current focus of the form.
| Create form from scra... | |
Module : Summoner . . Form
Copyright : ( c ) 2018 - 2022 Kowainik
SPDX - License - Identifier : MPL-2.0
Maintainer : < >
Stability : Stable
Portability : Portable
Form layout and form fields data types .
Module ... |
403b7523b52bcbd9bb389761927645955243bc3a1f8c8b154640d0b412f0fbb9 | simplex-chat/simplex-chat | M20221210_idxs.hs | # LANGUAGE QuasiQuotes #
module Simplex.Chat.Migrations.M20221210_idxs where
import Database.SQLite.Simple (Query)
import Database.SQLite.Simple.QQ (sql)
m20221210_idxs :: Query
m20221210_idxs =
[sql|
CREATE INDEX idx_messages_connection_id ON messages(connection_id);
CREATE INDEX idx_chat_items_group_member_id O... | null | https://raw.githubusercontent.com/simplex-chat/simplex-chat/138dc7fe8f8f417a5380600ef459d337b534aa55/src/Simplex/Chat/Migrations/M20221210_idxs.hs | haskell | # LANGUAGE QuasiQuotes #
module Simplex.Chat.Migrations.M20221210_idxs where
import Database.SQLite.Simple (Query)
import Database.SQLite.Simple.QQ (sql)
m20221210_idxs :: Query
m20221210_idxs =
[sql|
CREATE INDEX idx_messages_connection_id ON messages(connection_id);
CREATE INDEX idx_chat_items_group_member_id O... | |
3d456afb6f47e1ec8d42b5a0d8f0610d048671f8c41ed562783f52a3b509d597 | pbrisbin/google-drive | SpecHelper.hs | # LANGUAGE CPP #
{-# LANGUAGE OverloadedStrings #-}
module SpecHelper
( runApiSpec
-- * Fixtures
, Fixture(..)
, fixture
-- * Re-exports
, module Test.Hspec
, module Test.Hspec.Expectations.Lifted
, module Network.Google.Drive
, getCurrentTime
) where
import Test.Hspec hiding
... | null | https://raw.githubusercontent.com/pbrisbin/google-drive/7ecfa5e60658758674c521bbeb81be740e6d0b10/test/SpecHelper.hs | haskell | # LANGUAGE OverloadedStrings #
* Fixtures
* Re-exports
| Run an API spec and cleanup after
Create a folder and hand it to the given action. That action should place any
working files within the folder. The folder will be removed at the end of the
spec run.
| # LANGUAGE CPP #
module SpecHelper
( runApiSpec
, Fixture(..)
, fixture
, module Test.Hspec
, module Test.Hspec.Expectations.Lifted
, module Network.Google.Drive
, getCurrentTime
) where
import Test.Hspec hiding
( expectationFailure
, shouldBe
, shouldContain
, shouldM... |
ab9b17110b483d22980fa8af1540f4130f2ecb76051be703f237aed3224f7c60 | mzp/coq-ide-for-ios | pp_control.ml | (************************************************************************)
v * The Coq Proof Assistant / The Coq Development Team
< O _ _ _ , , * INRIA - CNRS - LIX - LRI - PPS - Copyright 1999 - 2010
\VV/ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *... | null | https://raw.githubusercontent.com/mzp/coq-ide-for-ios/4cdb389bbecd7cdd114666a8450ecf5b5f0391d3/coqlib/lib/pp_control.ml | ocaml | **********************************************************************
// * This file is distributed under the terms of the
* GNU Lesser General Public License Version 2.1
**********************************************************************
Parameters of pretty-printing
Def... | v * The Coq Proof Assistant / The Coq Development Team
< O _ _ _ , , * INRIA - CNRS - LIX - LRI - PPS - Copyright 1999 - 2010
\VV/ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
$ I d : pp_control.ml 13323... |
a9a072631ee005e448cffd7913eba0823195e170ccf91d6f5082a9a0cc9f78d3 | alaq/learning-clojure-in-public | core.clj | (ns fwpd.core)
(def filename "suspects.csv")
(def vamp-keys [:name :glitter-index])
(defn str->int
[str]
(Integer. str))
(def conversions {:name identity
:glitter-index str->int})
(defn convert
[vamp-key value]
((get conversions vamp-key) value))
(defn parse
"Convert a CSV into rows of ... | null | https://raw.githubusercontent.com/alaq/learning-clojure-in-public/27d11c1d8cad289b3fb9278082812a019d42b8d8/code/fwpd/src/fwpd/core.clj | clojure | (ns fwpd.core)
(def filename "suspects.csv")
(def vamp-keys [:name :glitter-index])
(defn str->int
[str]
(Integer. str))
(def conversions {:name identity
:glitter-index str->int})
(defn convert
[vamp-key value]
((get conversions vamp-key) value))
(defn parse
"Convert a CSV into rows of ... | |
b5f8f28d826e70abf3b8101cb9f79b56c72e56e43b23f64b2744a8ac06646be7 | chef/chef-server | bksw_wm_sql_bucket.erl | @copyright Chef Software , Inc. All Rights Reserved
@author < >
%%
Licensed to the Apache Software Foundation ( ASF ) under one or more
%% contributor license agreements. See the NOTICE file distributed
%% with this work for additional information regarding copyright
ownership . The ASF licenses this file... | null | https://raw.githubusercontent.com/chef/chef-server/775e6b24229e46884dcd8801e0534a07627327b2/src/bookshelf/src/bksw_wm_sql_bucket.erl | erlang |
contributor license agreements. See the NOTICE file distributed
with this work for additional information regarding copyright
License, Version 2.0 (the "License"); you may not use this file
the License at -2.0
Unless required by applicable law or agreed to in writing, software
WITHOUT WARRANTIES OR CONDITIONS ... | @copyright Chef Software , Inc. All Rights Reserved
@author < >
Licensed to the Apache Software Foundation ( ASF ) under one or more
ownership . The ASF licenses this file to you under the Apache
except in compliance with the License . You may obtain a copy of
distributed under the License is distrib... |
94382fe903c0d24debdfa36a6117546f32b84dd30f8aeede7e5ab99076ff50e6 | mario-goulart/salmonella | salmonella-common.scm | (import scheme)
(cond-expand
(chicken-4
(import foreign)
(use extras files irregex ports posix srfi-1 srfi-13)
(define pseudo-random-integer random))
(chicken-5
(import (chicken file)
(chicken file posix)
(chicken foreign)
(chicken irregex)
(chicken pathname)
... | null | https://raw.githubusercontent.com/mario-goulart/salmonella/6609dc501d6cc7735c5b0c42d1dfb9696585092a/salmonella-common.scm | scheme | Used to be chicken-prefix in C4
We could simply use delete-directory giving it a truthy value as
find-files, which was broken before
delete-directory (rmdir).
before
spec: list of elements. The format of elements is:
- symbols: options that do not require an argument
- lists: options that require an argument... | (import scheme)
(cond-expand
(chicken-4
(import foreign)
(use extras files irregex ports posix srfi-1 srfi-13)
(define pseudo-random-integer random))
(chicken-5
(import (chicken file)
(chicken file posix)
(chicken foreign)
(chicken irregex)
(chicken pathname)
... |
58e68f61ed7951965fab4db5486c86db31665a7233bd51bc9cdf63e1d90c8e08 | LPCIC/matita | nCic.ml |
||M|| This file is part of HELM , an Hypertextual , Electronic
||A|| Library of Mathematics , developed at the Computer Science
||T|| Department , University of Bologna , Italy .
||I||
||T||... | null | https://raw.githubusercontent.com/LPCIC/matita/794ed25e6e608b2136ce7fa2963bca4115c7e175/matita/components/ng_kernel/nCic.ml | ocaml | ******************************** TERMS ***********************************
shift (0 -> no shift),
subst (Irl n means id of
length n)
arguments
binder, source, target
binder, source, target
binder, type, term, body
Cast \def d... |
||M|| This file is part of HELM , an Hypertextual , Electronic
||A|| Library of Mathematics , developed at the Computer Science
||T|| Department , University of Bologna , Italy .
||I||
||T||... |
eb44316bde3dba48f943ad1b33d773cddc2bd2df46ef2ad5dd825f62737ad824 | rigetti/rpcq | suite.lisp | ;;;; suite.lisp
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;; Copyright 2018 Rigetti Computing
;;;;
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 t... | null | https://raw.githubusercontent.com/rigetti/rpcq/3a734718d5c2bb7ed57ad612e2c7158736d1a650/src-tests/suite.lisp | lisp | suite.lisp
Copyright 2018 Rigetti Computing
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 imp... | distributed under the License is distributed on an " AS IS " BASIS ,
See the License for the specific language governing permissions and
(in-package :rpcq-tests)
(defun run-rpcq-tests (&key (verbose nil) (headless nil))
"Run all rpcq tests. If VERBOSE is T, print out lots of test info. If HEADLESS is T, d... |
f7d1ab74b083a308ce3d01282ccd32ea23592ad15a7cdc2dcbb4acba69728e0a | Clozure/ccl-tests | format-b.lsp | ;-*- Mode: Lisp -*-
Author :
Created : Sun Aug 1 05:10:10 2004
;;;; Contains: Tests of the ~B format directive
(in-package :cl-test)
(compile-and-load "printer-aux.lsp")
(deftest format.b.1
(let ((fn (formatter "~b")))
(with-standard-io-syntax
(loop for x = (ash 1 (+ 2 (random 80)))
f... | null | https://raw.githubusercontent.com/Clozure/ccl-tests/0478abddb34dbc16487a1975560d8d073a988060/ansi-tests/format-b.lsp | lisp | -*- Mode: Lisp -*-
Contains: Tests of the ~B format directive
Comma tests
Must add tests for non-integers when the parameters
are specified, but it's not clear what the meaning is.
Are comma-char and comma-interval always ignored?
# arguments
Randomized test | Author :
Created : Sun Aug 1 05:10:10 2004
(in-package :cl-test)
(compile-and-load "printer-aux.lsp")
(deftest format.b.1
(let ((fn (formatter "~b")))
(with-standard-io-syntax
(loop for x = (ash 1 (+ 2 (random 80)))
for i = (- (random (+ x x)) x)
for s1 = (format nil "~B" i)
for s... |
6fd4b96c3470e27bde5d0b0519b1fb8caaaf23dac6368dbdf87f3d9c067164ef | pedestal/pedestal | csrf.clj | Copyright 2013 Relevance , Inc.
Copyright 2014 - 2022 Cognitect , Inc.
; The use and distribution terms for this software are covered by the
Eclipse Public License 1.0 ( )
; which can be found in the file epl-v10.html at the root of this distribution.
;
; By using this software in any fashion, you are agreeing ... | null | https://raw.githubusercontent.com/pedestal/pedestal/53bfe70143a22cdfd2f0d183023334a199c9e9a2/service/src/io/pedestal/http/csrf.clj | clojure | The use and distribution terms for this software are covered by the
which can be found in the file epl-v10.html at the root of this distribution.
By using this software in any fashion, you are agreeing to be bound by
the terms of this license.
You must not remove this notice, or any other, from this software.
T... | Copyright 2013 Relevance , Inc.
Copyright 2014 - 2022 Cognitect , Inc.
Eclipse Public License 1.0 ( )
(ns io.pedestal.http.csrf
"CSRF protection interceptor support, compatible with ring-anti-forgery"
(:require [crypto.random :as random]
[crypto.equality :as crypto]
[io.pedestal.int... |
f050fffe790a4c4b3fc61baa61557aa184952cecd7bf35175b7e76a88248334c | cljdoc/cljdoc | meta.clj | (ns cljdoc.render.meta
(:require [cljdoc.render.layout :as layout]))
(defn- shortcut [key desc]
[:tr.striped--near-white
[:td.pv2.pr2.pl3.bb.b--black-20.nowrap.tr key]
[:td.pv2.pr3.pl2.bb.b--black-20 desc]])
(defn shortcuts [context]
(->> [:div
(layout/top-bar-generic)
[:div.pa4-ns.pa2.w-a... | null | https://raw.githubusercontent.com/cljdoc/cljdoc/4034128558664bf81ceada65811f6eb3bd61c88e/src/cljdoc/render/meta.clj | clojure | (ns cljdoc.render.meta
(:require [cljdoc.render.layout :as layout]))
(defn- shortcut [key desc]
[:tr.striped--near-white
[:td.pv2.pr2.pl3.bb.b--black-20.nowrap.tr key]
[:td.pv2.pr3.pl2.bb.b--black-20 desc]])
(defn shortcuts [context]
(->> [:div
(layout/top-bar-generic)
[:div.pa4-ns.pa2.w-a... | |
b18045c0fdcffd7b41efd34f6a43042ef0e642c142dee9f217b9d5676a4414a2 | locusmath/locus | impl.clj | (ns locus.order.lattice.combinat.impl
(:require [locus.set.logic.core.set :refer :all]
[locus.set.logic.limit.product :refer :all]
[locus.set.logic.numeric.nms :refer :all]
[locus.set.logic.numeric.sig :refer :all]
[locus.con.core.setpart :refer :all]
[locus... | null | https://raw.githubusercontent.com/locusmath/locus/fb6068bd78977b51fd3c5783545a5f9986e4235c/src/clojure/locus/order/lattice/combinat/impl.clj | clojure | Intervals lattice
Noncrossing partition lattice | (ns locus.order.lattice.combinat.impl
(:require [locus.set.logic.core.set :refer :all]
[locus.set.logic.limit.product :refer :all]
[locus.set.logic.numeric.nms :refer :all]
[locus.set.logic.numeric.sig :refer :all]
[locus.con.core.setpart :refer :all]
[locus... |
a8a999e455f4da87cee4eaacb5543bbb94b68d415e34f062d3ae0dfab1df46a0 | htmfilho/minimily | category_test.clj | (ns minimily.accounting.web.api.category-test
(:require [clojure.test :refer :all]
[minimily.accounting.web.ctrl.category :refer :all]))
(deftest test-list-tree-branches
(testing "Empty category"
(is (= (list-tree-branches []) [])))
(testing "Only parents"
(is (= (li... | null | https://raw.githubusercontent.com/htmfilho/minimily/b317b6b67bc79773163f1a6f7c3b46db795ef979/test/minimily/accounting/web/api/category_test.clj | clojure | "A single node is parent and leaf at the same time" | (ns minimily.accounting.web.api.category-test
(:require [clojure.test :refer :all]
[minimily.accounting.web.ctrl.category :refer :all]))
(deftest test-list-tree-branches
(testing "Empty category"
(is (= (list-tree-branches []) [])))
(testing "Only parents"
(is (= (li... |
63b003c01d0cef2b03bb839411ef15348752199e69a627a7d47919661ea849ad | malcolmreynolds/GSLL | higher-moments.lisp | ;; Skewness and kurtosis.
, Sun Dec 31 2006 - 14:20
Time - stamp : < 2008 - 12 - 26 12:20:08EST higher-moments.lisp >
$ Id$
(in-package :gsl)
To do : stride other than 1 when that information is availble from
;;; the vector.
(defmfun skewness ((data vector) &optional mean standard-deviation)
(("gsl_stats"... | null | https://raw.githubusercontent.com/malcolmreynolds/GSLL/2f722f12f1d08e1b9550a46e2a22adba8e1e52c4/statistics/higher-moments.lisp | lisp | Skewness and kurtosis.
the vector.
Examples and unit test | , Sun Dec 31 2006 - 14:20
Time - stamp : < 2008 - 12 - 26 12:20:08EST higher-moments.lisp >
$ Id$
(in-package :gsl)
To do : stride other than 1 when that information is availble from
(defmfun skewness ((data vector) &optional mean standard-deviation)
(("gsl_stats" :type "_skew")
("gsl_stats" :type "_sk... |
0b5cf66d23f22acbda0d674b44fae062ac9a9f08a4a2457bb9af24b7f114809a | g7s/skidder | utils.cljs | (ns skidder.utils
(:require
[goog.userAgent.product :as product]
[goog.dom :as gdom]
[clojure.string :as str]
[skidder.protocols :as p])
(:import
(goog.math.interpolator Linear1)))
(defn ev-client-offset
[e]
[(.-clientX e) (.-clientY e)])
(defn node-client-offset
[node]
(when-some [node (... | null | https://raw.githubusercontent.com/g7s/skidder/145be5c9d2243e60f59e456551608353c7f28271/src/skidder/utils.cljs | clojure | (ns skidder.utils
(:require
[goog.userAgent.product :as product]
[goog.dom :as gdom]
[clojure.string :as str]
[skidder.protocols :as p])
(:import
(goog.math.interpolator Linear1)))
(defn ev-client-offset
[e]
[(.-clientX e) (.-clientY e)])
(defn node-client-offset
[node]
(when-some [node (... | |
0e898b454f5e6f6f14d05c413fb5dfe4badbfe21ace9ef1ec9987da007fe8cbd | vikram/lisplibraries | deflate-stream.lisp | ;;;
deflate-stream.lisp
;;;
Created : 2005 - 03 - 12 by < >
;;;
;;; An interface to the DEFLATE data compression format. See the
;;; "packages.lisp" file for the public interface.
;;;
Copyright ( c ) 2005 , All Rights Reserved
;;;
;;; Redistribution and use in source and binary forms, with or without
;;;... | null | https://raw.githubusercontent.com/vikram/lisplibraries/105e3ef2d165275eb78f36f5090c9e2cdd0754dd/site/salza-0.7.4/deflate-stream.lisp | lisp |
An interface to the DEFLATE data compression format. See the
"packages.lisp" file for the public interface.
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 ab... | deflate-stream.lisp
Created : 2005 - 03 - 12 by < >
Copyright ( c ) 2005 , All Rights Reserved
DIRECT , INDIRECT , INCIDENTAL , SPECIAL , EXEMPLARY , OR CONSEQUENTIAL
INTERRUPTION ) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY ,
$ I d : deflate - stream.lisp , v 1.12 2005/04/28 18:45:26 xach Exp $
(i... |
9c07fcbc030cdb5a8a7ed3f22ccef2dcdeebed230d59b13f500590ee147a52ce | sbcl/sbcl | dynamic-extent.pure.lisp | ;;;; tests that dynamic-extent functionality works.
This software is part of the SBCL system . See the README file for
;;;; more information.
;;;;
While most of SBCL is derived from the CMU CL system , the test
;;;; files (like this one) were written from scratch after the fork
from CMU CL .
;;;;
;;;; This softw... | null | https://raw.githubusercontent.com/sbcl/sbcl/3252878f0d01a64eadcb8d9632d075eaf0492cfc/tests/dynamic-extent.pure.lisp | lisp | tests that dynamic-extent functionality works.
more information.
files (like this one) were written from scratch after the fork
This software is in the public domain and is provided with
absolutely no warranty. See the COPYING and CREDITS files for
more information.
lp#1530390
&REST lists
LET-variable substi... |
This software is part of the SBCL system . See the README file for
While most of SBCL is derived from the CMU CL system , the test
from CMU CL .
(when (eq sb-ext:*evaluator-mode* :interpret)
(invoke-restart 'run-tests::skip-file))
(use-package :ctu)
(setq sb-c::*check-consistency* t
sb-ext:*stack-allo... |
9bd3ca4c56fda3c6ab3bd462f7611349007b3c6fe7373d87c5e8fedf7b26eae8 | josephwilk/stereotype | stereotypes.clj | (ns stereotype.stereotypes
(:use
[slingshot.slingshot :only [throw+]])
(:require
[stereotype.db :as db]
[stereotype.entities :as entities]
[stereotype.sql :as sql]
[stereotype.resolve-map :as resolve-map]))
(defn fn-name [identifier]
(let [stereotype-id (entities/id-for iden... | null | https://raw.githubusercontent.com/josephwilk/stereotype/49c845ec7e5b401f5cd6c6e8de6c79fbe60eade8/src/stereotype/stereotypes.clj | clojure | (ns stereotype.stereotypes
(:use
[slingshot.slingshot :only [throw+]])
(:require
[stereotype.db :as db]
[stereotype.entities :as entities]
[stereotype.sql :as sql]
[stereotype.resolve-map :as resolve-map]))
(defn fn-name [identifier]
(let [stereotype-id (entities/id-for iden... | |
f96dc3d4f02221ba62eca0946d3491fa96fb7b7af4eb6d932552304964c57d41 | OlivierSohn/hamazed | Run.hs | # LANGUAGE NoImplicitPrelude #
# LANGUAGE DeriveGeneric #
# LANGUAGE GeneralizedNewtypeDeriving #
{-# LANGUAGE OverloadedStrings #-}
# LANGUAGE TypeFamilies #
# LANGUAGE FlexibleContexts #
# LANGUAGE AllowAmbiguousTypes #
# LANGUAGE UndecidableInstances #
# LANGUAGE TypeFamilyDependencies #
# LANGUAGE LambdaCase #
# LA... | null | https://raw.githubusercontent.com/OlivierSohn/hamazed/c0df1bb60a8538ac75e413d2f5bf0bf050e5bc37/imj-server/src/Imj/Server/Run.hs | haskell | # LANGUAGE OverloadedStrings #
(network failures or players disconnections) are handled so that
a broken connection of /another/ client while broadcasting a message
won't impact the handled client.
associated to it, if it exsits.
To detect disconnections when communication is idle:
we don't log individual argumen... | # LANGUAGE NoImplicitPrelude #
# LANGUAGE DeriveGeneric #
# LANGUAGE GeneralizedNewtypeDeriving #
# LANGUAGE TypeFamilies #
# LANGUAGE FlexibleContexts #
# LANGUAGE AllowAmbiguousTypes #
# LANGUAGE UndecidableInstances #
# LANGUAGE TypeFamilyDependencies #
# LANGUAGE LambdaCase #
# LANGUAGE ScopedTypeVariables #
modul... |
aa7e528084a9e99bdaa780cf89674bafff883809fcb2b9407ba53ec296b84c97 | babashka/babashka | http_connection_test.clj | (ns babashka.http-connection-test
(:require
[babashka.test-utils :as tu]
[clojure.string :as str]
[clojure.test :as t :refer [deftest is]]))
(defn bb [& args]
(apply tu/bb nil (map str args)))
(deftest open-connection-test
(is (try (= "\"1\"" (str/trim (bb "-e" "
(require '[cheshire.core :as json])
(le... | null | https://raw.githubusercontent.com/babashka/babashka/3dfc15f5a40efaec07cba991892c1207a352fab4/test/babashka/http_connection_test.clj | clojure | nonsensical, but to test if this method exists | (ns babashka.http-connection-test
(:require
[babashka.test-utils :as tu]
[clojure.string :as str]
[clojure.test :as t :refer [deftest is]]))
(defn bb [& args]
(apply tu/bb nil (map str args)))
(deftest open-connection-test
(is (try (= "\"1\"" (str/trim (bb "-e" "
(require '[cheshire.core :as json])
(le... |
fb126c1b43045c66a926f2f5f19c9f6c01c4f6e4e95d3581b235345668295964 | dyzsr/ocaml-selectml | Tests.ml | (* TEST
* expect
*)
(* Subtyping is "syntactic" *)
fun (x : < x : int >) y z -> (y :> 'a), (x :> 'a), (z :> 'a);;
[%%expect{|
- : < x : int > ->
< x : int > -> < x : int > -> < x : int > * < x : int > * < x : int >
= <fun>
|}];;
(* - : (< x : int > as 'a) -> 'a -> 'a * 'a = <fun> *)
(* Quirks of class typing. ... | null | https://raw.githubusercontent.com/dyzsr/ocaml-selectml/875544110abb3350e9fb5ec9bbadffa332c270d2/testsuite/tests/typing-objects/Tests.ml | ocaml | TEST
* expect
Subtyping is "syntactic"
- : (< x : int > as 'a) -> 'a -> 'a * 'a = <fun>
Quirks of class typing.
class ['a] c : unit -> object constraint 'a = int method f : 'a c end
and ['a] d : unit -> object constraint 'a = int method f : 'a c end
'a free in class d
Create instance #c
class virtu... |
fun (x : < x : int >) y z -> (y :> 'a), (x :> 'a), (z :> 'a);;
[%%expect{|
- : < x : int > ->
< x : int > -> < x : int > -> < x : int > * < x : int > * < x : int >
= <fun>
|}];;
class ['a] c () = object
method f = (new c (): int c)
end and ['a] d () = object
inherit ['a] c ()
end;;
[%%expect{|
class ['a] c : ... |
f119ee784a36361fdf0981b108153d1aeba587cb148953e1c25f68ce13935d37 | egison/egison-scheme | test.scm | ;;
;; Egison Test
;;
(load "./egison.scm")
(match-all 10 Something [x x]) ; ("OK")
(match-all 10 Eq [,10 "OK"]) ; ("OK")
( 10 )
( ( 1 ( 2 3 ) ) )
( ( ( ) ( 1 2 3 ) ) ( ( 1 ) ( 2 3 ) ) ( ( 1 2 ) ( 3 ) ) )
(match-all '(1 2 3) (List Integer) [(join _ (cons x _)) x]) ; (1 2 3)
( ( 1 2 ) ( 1 3 ) ( 2 3 ) )
( ( 1 ... | null | https://raw.githubusercontent.com/egison/egison-scheme/49188f4bcf91199a9e1d5142851a48ed2eb916e1/test/test.scm | scheme |
Egison Test
("OK")
("OK")
(1 2 3)
("OK")
("OK")
("OK")
()
()
() |
(load "./egison.scm")
( 10 )
( ( 1 ( 2 3 ) ) )
( ( ( ) ( 1 2 3 ) ) ( ( 1 ) ( 2 3 ) ) ( ( 1 2 ) ( 3 ) ) )
( ( 1 2 ) ( 1 3 ) ( 2 3 ) )
( ( 1 2 ) ( 1 3 ) ( 2 1 ) ( 2 3 ) ( 3 1 ) ( 3 2 ) )
( 1 2 )
( 1 4 )
1
( 1 )
( 1 )
|
a2b2d1f849e677d7ac9198714108f5e52ca9b48ac8c13c9e142bce9fc92ecda7 | footprintanalytics/footprint-web | common.clj | (ns metabase.api.common
"Dynamic variables and utility functions/macros for writing API functions."
(:require [clojure.spec.alpha :as s]
[clojure.string :as str]
[clojure.tools.logging :as log]
[compojure.core :as compojure]
[honeysql.types :as htypes]
[me... | null | https://raw.githubusercontent.com/footprintanalytics/footprint-web/d3090d943dd9fcea493c236f79e7ef8a36ae17fc/src/metabase/api/common.clj | clojure | ----------------------------------------------- DYNAMIC VARIABLES ------------------------------------------------
These get bound by middleware for each HTTP request.
default binding is just something that will return nil when dereferenced
checkp- functions: as in "check param". These functions expect that you pas... | (ns metabase.api.common
"Dynamic variables and utility functions/macros for writing API functions."
(:require [clojure.spec.alpha :as s]
[clojure.string :as str]
[clojure.tools.logging :as log]
[compojure.core :as compojure]
[honeysql.types :as htypes]
[me... |
2aa4e65eb4132b3376bd18b3589eff6c66632cd26599c47f1037b7955dde59d2 | input-output-hk/marlowe-cardano | Main.hs | module Main
where
import Control.Exception (bracket, bracketOnError)
import Data.Functor (void)
import Data.Proxy (Proxy(Proxy))
import qualified FollowingUTxOs
import Language.Marlowe.Runtime.ChainSync.Api (RuntimeChainSeek, WithGenesis(..))
import Network.Channel (socketAsChannel)
import Network.Protocol.ChainSeek... | null | https://raw.githubusercontent.com/input-output-hk/marlowe-cardano/bc9a0325f13b886e90ea05196ffb70a46c2ab095/marlowe-chain-sync/example-client/Main.hs | haskell | module Main
where
import Control.Exception (bracket, bracketOnError)
import Data.Functor (void)
import Data.Proxy (Proxy(Proxy))
import qualified FollowingUTxOs
import Language.Marlowe.Runtime.ChainSync.Api (RuntimeChainSeek, WithGenesis(..))
import Network.Channel (socketAsChannel)
import Network.Protocol.ChainSeek... | |
58eed5dc7608e696b90a6950ed9a02d0ceebc3f418b059c4fd2bfa92b7e7d50b | LightAndLight/sized-hkts | Parser.hs | # language LambdaCase #
{-# language OverloadedStrings #-}
{-# language ScopedTypeVariables #-}
module Parser
( Parser, Parser.ParseError(..), Parser.parse, Parser.eof
, datatype
, declaration
, declarations
, expr
, function
, type_
)
where
import Bound (Var(..))
import Control.Applicative ((<|>), man... | null | https://raw.githubusercontent.com/LightAndLight/sized-hkts/d12fedb34e7ea82be66f200e9ecf7fcf611cce53/src/Parser.hs | haskell | # language OverloadedStrings #
# language ScopedTypeVariables # | # language LambdaCase #
module Parser
( Parser, Parser.ParseError(..), Parser.parse, Parser.eof
, datatype
, declaration
, declarations
, expr
, function
, type_
)
where
import Bound (Var(..))
import Control.Applicative ((<|>), many)
import Data.Functor (void)
import qualified Data.Set as Set
import Da... |
15b1f400fc52d30e6d378213ff74ca47f4c1851a7b5b6897be679df5c2fe7409 | philc/clj-maxmind-geoip | project.clj | (defproject clj-maxmind-geoip "0.1.0-SNAPSHOT"
:description "A thin wrapper around Maxmind's GeoIP Java API."
:url "-maxmind-geoip"
:license {:name "Eclipse Public License"
:url "-v10.html"}
We compile - in the APIs . " " to compile them .
:java-source-paths ["vendor/maxmind_geoip_api_java/sou... | null | https://raw.githubusercontent.com/philc/clj-maxmind-geoip/065b2d7410fd0981b3261e7aadd49580ed44c526/project.clj | clojure | (defproject clj-maxmind-geoip "0.1.0-SNAPSHOT"
:description "A thin wrapper around Maxmind's GeoIP Java API."
:url "-maxmind-geoip"
:license {:name "Eclipse Public License"
:url "-v10.html"}
We compile - in the APIs . " " to compile them .
:java-source-paths ["vendor/maxmind_geoip_api_java/sou... | |
9d84c4a16c6498f16fe4d237e8d47566381fe3b9b1bf167961a798e5a5af4896 | RDTK/generator | help.lisp | ;;;; help.lisp --- Help text generation for the commandline-options module.
;;;;
Copyright ( C ) 2017 , 2018 , 2019 Jan Moringen
;;;;
Author : < >
(cl:in-package #:build-generator.commandline-options)
(defvar *paragraph-limit* nil)
(defun print-option (stream info
&optional colon? at? (pa... | null | https://raw.githubusercontent.com/RDTK/generator/8d9e6e47776f2ccb7b5ed934337d2db50ecbe2f5/src/commandline-options/help.lisp | lisp | help.lisp --- Help text generation for the commandline-options module.
~
[COMMAND-OPTIONS]~]~ | Copyright ( C ) 2017 , 2018 , 2019 Jan Moringen
Author : < >
(cl:in-package #:build-generator.commandline-options)
(defvar *paragraph-limit* nil)
(defun print-option (stream info
&optional colon? at? (paragraph-limit *paragraph-limit*))
(option-synopsis info stream :long? colon?)
(whe... |
109f1c04c68e07a4cef77cbb5b06bdd30f0b17ba9054a8be8a551b2cf21e83c1 | mishadoff/project-euler | problem092.clj | (ns project-euler.problem092)
(def cache (atom {1 1
89 89}))
(defn advance [n]
(->> n
(str)
(map #(- (int %) 48))
(map #(* % %))
(reduce +)))
(defn last-chain
([n] (last-chain n [] #{1 89}))
([n nums sets]
(cond
;; chain finished?
(sets n) (do ;; add n... | null | https://raw.githubusercontent.com/mishadoff/project-euler/45642adf29626d3752227c5a342886b33c70b337/src/project_euler/problem092.clj | clojure | chain finished?
add numbers
return last
not in cache
else | (ns project-euler.problem092)
(def cache (atom {1 1
89 89}))
(defn advance [n]
(->> n
(str)
(map #(- (int %) 48))
(map #(* % %))
(reduce +)))
(defn last-chain
([n] (last-chain n [] #{1 89}))
([n nums sets]
(cond
(doseq [nn nums] (swap! cache asso... |
484b53e995b27d4a2066ef473d47fc2a021127b156ed51ecd216ce5bb46065d7 | input-output-hk/cardano-wallet | Gen.hs | # LANGUAGE DuplicateRecordFields #
# LANGUAGE LambdaCase #
# LANGUAGE MultiParamTypeClasses #
# LANGUAGE NamedFieldPuns #
-- |
Copyright : © 2022 IOHK
-- License: Apache-2.0
--
-- This module provides generators and shrinkers for the 'TxSeq' type.
--
-- Usage:
--
- Use ' genTxSeq ' to generate a ' ShrinkableTxSeq... | null | https://raw.githubusercontent.com/input-output-hk/cardano-wallet/1a8514a8fa64c13e37001098e94d7fd6c4849e82/lib/wallet/src/Cardano/Wallet/Primitive/Types/Tx/TxSeq/Gen.hs | haskell | |
License: Apache-2.0
This module provides generators and shrinkers for the 'TxSeq' type.
Usage:
- Use 'getTxSeq' to extract a 'TxSeq' from a 'ShrinkableTxSeq'.
* Public interface
* Internal types and functions (exported for testing)
--------------------------------------------------------------------------... | # LANGUAGE DuplicateRecordFields #
# LANGUAGE LambdaCase #
# LANGUAGE MultiParamTypeClasses #
# LANGUAGE NamedFieldPuns #
Copyright : © 2022 IOHK
- Use ' genTxSeq ' to generate a ' ShrinkableTxSeq ' value .
- Use ' shrinkTxSeq ' to shrink a ' ShrinkableTxSeq ' value .
module Cardano.Wallet.Primitive.Types.Tx.T... |
0a4bb8bc31d5138f118483c03972cf12a8006f16033d70ff5dcbf17f495f0d8f | twystd/GA144 | cucumber.erl | -module(cucumber).
-export([run/2]).
% INCLUDES
-include_lib("eunit/include/eunit.hrl").
RECORDS
-record(feature,{ feature,
scenarios=[]
}).
-record(scenario,{ scenario,
steps=[],
tags=[]
}).
-record(step,{ type,
... | null | https://raw.githubusercontent.com/twystd/GA144/741d2f2fca82133d594c51807115bd5121aa5350/erlang/src/cucumber.erl | erlang | INCLUDES
API
INTERNAL | -module(cucumber).
-export([run/2]).
-include_lib("eunit/include/eunit.hrl").
RECORDS
-record(feature,{ feature,
scenarios=[]
}).
-record(scenario,{ scenario,
steps=[],
tags=[]
}).
-record(step,{ type,
descr... |
4b9250cab7e5c48170e459a767704e87eb31e80f65d8d4f3268dc006514ef0c9 | heyoka/faxe | esp_stats.erl | %% Date: 05.01.17 - 14:11
Ⓒ 2017 heyoka
-module(esp_stats).
-author("Alexander Minichmair").
-include("faxe.hrl").
%% API
-behavior(df_component).
%% API
-export([init/3, process/3, handle_info/2, get_options/0, wants/0, emits/0]).
-callback execute(tuple(), term()) -> tuple().
-record(state, {
node_id,
fie... | null | https://raw.githubusercontent.com/heyoka/faxe/a5d768e1c354e2e76761cd6bd4dd003a8d88339f/apps/faxe/src/components/esp_stats.erl | erlang | Date: 05.01.17 - 14:11
API
API
lager:info("~p buffertime: ~p", [?MODULE, State#state.buffer_time]),
do not emit uninitialized
lager:info("~p emitting: ~p", [Mod, Result]),
reset buffer
lager:info("~p TS < BufferTime", [?MODULE]),
lager:info("~p buffer: ~p", [?MODULE, NewState#st... | Ⓒ 2017 heyoka
-module(esp_stats).
-author("Alexander Minichmair").
-include("faxe.hrl").
-behavior(df_component).
-export([init/3, process/3, handle_info/2, get_options/0, wants/0, emits/0]).
-callback execute(tuple(), term()) -> tuple().
-record(state, {
node_id,
field,
factor,
modules :: list(),
... |
1e074ac06ebb579918b4540ca1fac830352ed3d5b61524f67affefb6979470ff | cl-axon/shop2 | Log_ran_problems_60.lisp | name : Log_ran_problems.lisp
# packages : 60 # citys : NUM_CITY
# planes : 12 seed:931125489
;;--------------------------------------
(defproblem log-ran-60-1 logistics
(
(AIRPLANE plane1)
(airplane-at plane1 LOC9-1)
(AIRPLANE plane2)
(airplane-at plane2 LOC29-1)
(AIRPLANE plane3)
(airplane-at plane3... | null | https://raw.githubusercontent.com/cl-axon/shop2/9136e51f7845b46232cc17ca3618f515ddcf2787/examples/logistic/logistic/Log_ran_problems_60.lisp | lisp | --------------------------------------
--------------------------------------
--------------------------------------
--------------------------------------
--------------------------------------
--------------------------------------
--------------------------------------
--------------------------------------
--------... | name : Log_ran_problems.lisp
# packages : 60 # citys : NUM_CITY
# planes : 12 seed:931125489
(defproblem log-ran-60-1 logistics
(
(AIRPLANE plane1)
(airplane-at plane1 LOC9-1)
(AIRPLANE plane2)
(airplane-at plane2 LOC29-1)
(AIRPLANE plane3)
(airplane-at plane3 LOC12-1)
(AIRPLANE plane4)
(airplane-a... |
e8217be2003092572723d305e1dcfa1a0ec6e9e838e37eafb12db92fc941a464 | AdaCore/why3 | binverttab.ml | open Printf
let inverse x =
let rec loop t t' r r' =
if r' = 0 then
if t < 0 then t + 256 else t
else
let q = r / r' in
loop t' (t - q * t') r' (r - q * r')
in
loop 0 1 256 x
let () =
printf "/* binverttab[i] is the multiplicative inverse of 2*i+1 mod 256,\
\n ie. (binverttab[i] * ... | null | https://raw.githubusercontent.com/AdaCore/why3/e0dc747dcbdbf58ddad668a234c7d05defc65cee/examples/multiprecision/binverttab.ml | ocaml | open Printf
let inverse x =
let rec loop t t' r r' =
if r' = 0 then
if t < 0 then t + 256 else t
else
let q = r / r' in
loop t' (t - q * t') r' (r - q * r')
in
loop 0 1 256 x
let () =
printf "/* binverttab[i] is the multiplicative inverse of 2*i+1 mod 256,\
\n ie. (binverttab[i] * ... | |
56c49d4edf2942ec18f77aad358d6c86e706e350d73c56e6d335d6bad3ae1246 | fjvallarino/monomer | CirclesGrid.hs | |
Module : Widgets . CirclesGrid
Copyright : ( c ) 2018
License : BSD-3 - Clause ( see the LICENSE file )
Maintainer :
Stability : experimental
Portability : non - portable
Widget representing a grid of circles .
Module : Widgets.CirclesGrid
Copyright : (c) 2018 Francisco V... | null | https://raw.githubusercontent.com/fjvallarino/monomer/332529a67a121e0ffc3db64977835d717bc48e52/examples/generative/Widgets/CirclesGrid.hs | haskell | Imported to avoid issues with duplicate lens names | |
Module : Widgets . CirclesGrid
Copyright : ( c ) 2018
License : BSD-3 - Clause ( see the LICENSE file )
Maintainer :
Stability : experimental
Portability : non - portable
Widget representing a grid of circles .
Module : Widgets.CirclesGrid
Copyright : (c) 2018 Francisco V... |
8d0d414f2abcfacdaa3aeb73f646eb7ae19f3165bd55663a1a62caaa05b8bde7 | Quid2/zm | Kb1f46a49c8f8.hs | module Test.ZM.ADT.Word8.Kb1f46a49c8f8 (module ZM.Prim) where
import ZM.Prim(Word8)
| null | https://raw.githubusercontent.com/Quid2/zm/02c0514777a75ac054bfd6251edd884372faddea/test/Test/ZM/ADT/Word8/Kb1f46a49c8f8.hs | haskell | module Test.ZM.ADT.Word8.Kb1f46a49c8f8 (module ZM.Prim) where
import ZM.Prim(Word8)
| |
147e271e8ec50c0cbec44b0909bdc67ddb65cf136284e86bfe54d8826b8f0954 | Anut-py/h-raylib | Util.hs | {-# OPTIONS -Wall #-}
module Raylib.Util (cameraDirectionRay, whileWindowOpen, whileWindowOpen_, whileWindowOpen0, setMaterialShader) where
import Control.Monad (void)
import Raylib.Core (windowShouldClose)
import Raylib.Types
( Camera3D (camera3D'position, camera3D'target),
Material (material'shader),
Model... | null | https://raw.githubusercontent.com/Anut-py/h-raylib/7b83a6f60dd1ce035988cb32d4c3d3c157971e35/src/Raylib/Util.hs | haskell | # OPTIONS -Wall #
| Gets the direction of a camera as a ray.
| Calls the game loop every frame as long as the window is open.
For larger projects, instead of using this function, consider
making a custom game loop for flexibility.
| The game loop. Its only argument should be the current application state, and it... | module Raylib.Util (cameraDirectionRay, whileWindowOpen, whileWindowOpen_, whileWindowOpen0, setMaterialShader) where
import Control.Monad (void)
import Raylib.Core (windowShouldClose)
import Raylib.Types
( Camera3D (camera3D'position, camera3D'target),
Material (material'shader),
Model (model'materials),
... |
70038ae06a3cbbf1bd2b99dfd5b8a47c32592b83b33c1cc4659f93507683a09d | rowangithub/DOrder | 22.ml | let rec loop x y z k =
if (Random.bool ()) then
let x = if (k mod 3 = 0) then x+1 else x in
let y = y + 1 in
let z = z + 1 in
loop x y z k
else
(assert (x = y);
assert (y = z))
let main () =
let x = 0 in
let y = 0 in
let z = 0 in
let k = 0 in
loop x y z k
let _ = main () | null | https://raw.githubusercontent.com/rowangithub/DOrder/e0d5efeb8853d2a51cc4796d7db0f8be3185d7df/tests/folprograms/hola/22.ml | ocaml | let rec loop x y z k =
if (Random.bool ()) then
let x = if (k mod 3 = 0) then x+1 else x in
let y = y + 1 in
let z = z + 1 in
loop x y z k
else
(assert (x = y);
assert (y = z))
let main () =
let x = 0 in
let y = 0 in
let z = 0 in
let k = 0 in
loop x y z k
let _ = main () | |
a7ab1bef1e605b3b0a669c39b0972c2b8e447f1707c6fcb1935c12b16c6a2e1c | modular-macros/ocaml-macros | typedtree.mli | (**************************************************************************)
(* *)
(* OCaml *)
(* *)
... | null | https://raw.githubusercontent.com/modular-macros/ocaml-macros/05372c7248b5a7b1aa507b3c581f710380f17fcd/typing/typedtree.mli | ocaml | ************************************************************************
OCaml
... | , projet Cristal , INRIA Rocquencourt
Copyright 1996 Institut National de Recherche en Informatique et
the GNU Lesser General Public License version 2.1 , with the
* By comparison with { ! :
- Every { ! Longindent.t } is accompanied by a resolved { ! Path.t }... |
9404edc99b9f8ff8228c5d78579deac43dc9ee19368b23d6b77376261bbe1f3a | troydm/edda | ShipyardV2.hs | {-# LANGUAGE OverloadedStrings #-}
module EDDA.Schema.ShipyardV2 where
import EDDA.Types
import EDDA.Schema.Util
import Data.Aeson
import Data.Aeson.Types
import qualified Data.Text as T
import qualified Data.Text.Encoding as TE
import qualified Data.HashMap.Strict as HM
import qualified Data.HashSet as HS
getShips... | null | https://raw.githubusercontent.com/troydm/edda/710856d5bc3bf70c1061c50ae159107ca51c15f0/src/EDDA/Schema/ShipyardV2.hs | haskell | # LANGUAGE OverloadedStrings # | module EDDA.Schema.ShipyardV2 where
import EDDA.Types
import EDDA.Schema.Util
import Data.Aeson
import Data.Aeson.Types
import qualified Data.Text as T
import qualified Data.Text.Encoding as TE
import qualified Data.HashMap.Strict as HM
import qualified Data.HashSet as HS
getShips :: Value -> ConfigT (Maybe [Str])
... |
052be92491d525e0dbc33b05714658bcf4dedd79ee4f3178e7fb5903b3cb49fe | Shirakumo/trial | bvh2.lisp | (in-package #:org.shirakumo.fraf.trial.bvh2)
;; CF
(defstruct (bvh-node
(:include vec4)
(:constructor %make-bvh-node (3d-vectors::%vx4 3d-vectors::%vy4 3d-vectors::%vz4 3d-vectors::%vw4 d p l r o))
(:copier NIL)
(:predicate NIL))
(d 0 :type (unsigned-byte 16))
(p N... | null | https://raw.githubusercontent.com/Shirakumo/trial/b89966495c11c8a2c5a62754fcef72a9b42154fc/bvh2.lisp | lisp | CF
If it's in neither or in both, just see whose centroid we're closer to.
FIXME: Figure out when to rebalance the tree.
REGION should be a vec2 for a point test, or a vec4 with left/bottom/right/top coordinates.
create the greatest cumulative decrease in box perimiter.
traverse downwards
decrease of cost gets... | (in-package #:org.shirakumo.fraf.trial.bvh2)
(defstruct (bvh-node
(:include vec4)
(:constructor %make-bvh-node (3d-vectors::%vx4 3d-vectors::%vy4 3d-vectors::%vz4 3d-vectors::%vw4 d p l r o))
(:copier NIL)
(:predicate NIL))
(d 0 :type (unsigned-byte 16))
(p NIL :typ... |
d8480d574cb861e72e0f4d5031c4fdfe34fb262fcbeb5ad8b4ca65e22daf8602 | Clozure/ccl | correlate.lisp | ;;; -*- Log: hemlock.log; Package: Spell -*-
;;;
;;; **********************************************************************
This code was written as part of the CMU Common Lisp project at
Carnegie Mellon University , and has been placed in the public domain .
;;;
;;; ************************************************... | null | https://raw.githubusercontent.com/Clozure/ccl/6c1a9458f7a5437b73ec227e989aa5b825f32fd3/cocoa-ide/hemlock/unused/archive/spell/correlate.lisp | lisp | -*- Log: hemlock.log; Package: Spell -*-
**********************************************************************
**********************************************************************
This is the file that deals with checking and correcting words
using a dictionary read in from a binary file. It has been ... | This code was written as part of the CMU Common Lisp project at
Carnegie Mellon University , and has been placed in the public domain .
Written by
Designed by and
from the basic ideas used in ( on DEC-20 's ) which originated as
Spell on the ITS machines at MIT . There are flags which have p... |
30e5c96ba9b89a06deefa3244c8301139df97ba959feaab8ffc6a3270be44899 | poscat0x04/telegram-types | ChosenInlineResult.hs | module Web.Telegram.Types.Internal.ChosenInlineResult where
import Common
import Web.Telegram.Types.Internal.Location
import Web.Telegram.Types.Internal.User
-- | A result of an inline query that was chosen by the user and sent to their chat partner.
data ChosenInlineResult = ChosenInlineResult
{ -- | The unique id... | null | https://raw.githubusercontent.com/poscat0x04/telegram-types/c09ccc81cff10399538894cf2d1273022c797e18/src/Web/Telegram/Types/Internal/ChosenInlineResult.hs | haskell | | A result of an inline query that was chosen by the user and sent to their chat partner.
| The unique identifier for the result that was chosen
| The user that chose the result
| Sender location, only for bots that require user location
| Identifier of the sent inline message. Available only if there
attached ... | module Web.Telegram.Types.Internal.ChosenInlineResult where
import Common
import Web.Telegram.Types.Internal.Location
import Web.Telegram.Types.Internal.User
data ChosenInlineResult = ChosenInlineResult
resultId :: Text,
from :: User,
location :: Maybe Location,
is an [ inline keyboard]( / bots / api#... |
6fc18685b8b2ed1acb69f5d7e5ec1f44888c87b3f16a9eca58d4a4cdc803d7c0 | caisah/sicp-exercises-and-examples | ex_1.42.scm | Let f and be two functions . The composition f after is defined to be the function
;; x -> f(g(x)). Define a procedure compose that implements composition. For example
if inc is a procedure that adds 1 to its argument ,
( ( compose square inc ) 6 )
;; 49
(define (inc x)
(+ x 1))
(define (compose f g)
... | null | https://raw.githubusercontent.com/caisah/sicp-exercises-and-examples/605c698d7495aa3474c2b6edcd1312cb16c5b5cb/1.3.4-procedures_as_returned_values/ex_1.42.scm | scheme | x -> f(g(x)). Define a procedure compose that implements composition. For example
49 | Let f and be two functions . The composition f after is defined to be the function
if inc is a procedure that adds 1 to its argument ,
( ( compose square inc ) 6 )
(define (inc x)
(+ x 1))
(define (compose f g)
(lambda (y) (f (g y))))
((compose square inc) 6)
|
ea458ef85a08445cd55d0a129aa480c9841cf18a761d6ea0dfafa0faa301a634 | typeable/octopod | Orphans.hs | # OPTIONS_GHC -fno - warn - orphans #
module Orphans () where
import Common.Types
import Data.Maybe
import Rel8
parseTypeInformationFromMapping :: (Eq a, Eq b, DBType b, Show b, Show a) => [(a, b)] -> TypeInformation a
parseTypeInformationFromMapping m =
parseTypeInformation
(\v -> maybe (Left $ "unknown value... | null | https://raw.githubusercontent.com/typeable/octopod/372f5dd63585f07fa36ab76b70a67d9c94636e6b/octopod-backend/src/Orphans.hs | haskell | # OPTIONS_GHC -fno - warn - orphans #
module Orphans () where
import Common.Types
import Data.Maybe
import Rel8
parseTypeInformationFromMapping :: (Eq a, Eq b, DBType b, Show b, Show a) => [(a, b)] -> TypeInformation a
parseTypeInformationFromMapping m =
parseTypeInformation
(\v -> maybe (Left $ "unknown value... | |
c9b615ba135223414ac0490b4ae08d064c0bf25b09081369c029fe7bace3ffee | input-output-hk/ouroboros-network | Mux.hs | {-# LANGUAGE BangPatterns #-}
# LANGUAGE DataKinds #
# LANGUAGE ExistentialQuantification #
# LANGUAGE FlexibleContexts #
# LANGUAGE GADTSyntax #
{-# LANGUAGE KindSignatures #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE RankNTypes ... | null | https://raw.githubusercontent.com/input-output-hk/ouroboros-network/2f09ddd9282916858ba5d6b4b340cddbaf050d7e/network-mux/src/Network/Mux.hs | haskell | # LANGUAGE BangPatterns #
# LANGUAGE KindSignatures #
# LANGUAGE NamedFieldPuns #
# LANGUAGE RankNTypes #
# LANGUAGE ScopedTypeVariables #
# LANGUAGE TypeFamilies #
* Running the Mux
* Bearer
* Monitoring
* Errors
* Tracing
indicate weather mux... | # LANGUAGE DataKinds #
# LANGUAGE ExistentialQuantification #
# LANGUAGE FlexibleContexts #
# LANGUAGE GADTSyntax #
module Network.Mux
* Defining ' ' protocol bundles
newMux
, Mux
, MuxMode (..)
, HasInitiator
, HasResponder
, MiniProtocolBundle (..)
, Mini... |
e6b69321737df447ff5113c97239a58cd664409f774209defce7888e4930c3a8 | NathanReb/ppx_yojson | ezjsonm.mli | type json = Ezjsonm.value
val null : json
val true_ : json
val false_ : json
val string : json
val int : json
val float : json
val empty_array : json
val array : json
val mixed_array : json
val record : json
val complex : json
val legacy_anti_quotation : json
val anti_quotation : json
| null | https://raw.githubusercontent.com/NathanReb/ppx_yojson/7be5f3a004a93e73ac31c405415455d928a9dd99/test/rewriter/ezjsonm.mli | ocaml | type json = Ezjsonm.value
val null : json
val true_ : json
val false_ : json
val string : json
val int : json
val float : json
val empty_array : json
val array : json
val mixed_array : json
val record : json
val complex : json
val legacy_anti_quotation : json
val anti_quotation : json
| |
f7f4cada64128ba105faafda81bdc23523b8f96fc2ac10118ae94c8c3ba2bfbe | typelead/eta | tcfail076.hs | {-# LANGUAGE RankNTypes #-}
From :
Date : Fri , 15 Aug 1997 15:20:51 +0200 ( MET DST )
I * suppose * that there is a bug in GHC 's type checker . The following
program , which I think is ill - typed , passes silently the type checker .
Needless to say that it uses some of GHC 's arcane ... | null | https://raw.githubusercontent.com/typelead/eta/97ee2251bbc52294efbf60fa4342ce6f52c0d25c/tests/suite/typecheck/fail/tcfail076.hs | haskell | # LANGUAGE RankNTypes #
`ContT' is a continuation monad transformer. Note that we locally
qualify over the result type `res' (sometimes called answer or
output). IMHO this make it impossible to define control constructs
like `callcc'. Let's have a closer look: the code of `callcc' contains
the subexpression `KContT (... |
From :
Date : Fri , 15 Aug 1997 15:20:51 +0200 ( MET DST )
I * suppose * that there is a bug in GHC 's type checker . The following
program , which I think is ill - typed , passes silently the type checker .
Needless to say that it uses some of GHC 's arcane type extensions .
... |
d604f8b60a85ff41d643834d4f7879e71ac97ac038722509af5306e2c99b414b | tlehman/sicp-exercises | ex-1.28.scm | Exercise 1.28 : One variant of the Fermat test that can not be fooled
is called the - Rabin test ( Miller 1976 ; 1980 ) .
This starts from an alternate form of Fermat 's little theorem , which
; states that if n is a prime number and a is any positive integer
less than n , then a^(n-1 ) is congruent to 1 m... | null | https://raw.githubusercontent.com/tlehman/sicp-exercises/57151ec07d09a98318e91c83b6eacaa49361d156/ex-1.28.scm | scheme | 1980 ) .
states that if n is a prime number and a is any positive integer
pick a random number a < n and raise a to the (n-1)-th power modulo
n using the expmod procedure.
However, whenever we perform the squaring step in expmod, we check
exists, then n is not prime.
It is also possible to prove that if n ... | Exercise 1.28 : One variant of the Fermat test that can not be fooled
This starts from an alternate form of Fermat 's little theorem , which
less than n , then a^(n-1 ) is congruent to 1 modulo n.
To test the primality of a number n by the - Rabin test , we
to see if we have discovered a " nontrivial squa... |
1ddaa50b7ec7e4afde0a6471831e77b58cb1fdea7fce5dd014e5aaf1f52a2533 | diku-dk/futhark | IxFunWrapper.hs | | Perform index function operations in both algebraic and LMAD
-- representations.
module Futhark.IR.Mem.IxFunWrapper
( IxFun,
iota,
permute,
reshape,
coerce,
slice,
flatSlice,
rebase,
)
where
import Futhark.IR.Mem.IxFun qualified as I
import Futhark.IR.Mem.IxFun.Alg qualified as IA
i... | null | https://raw.githubusercontent.com/diku-dk/futhark/98e4a75e4de7042afe030837084764bbf3c6c66e/unittests/Futhark/IR/Mem/IxFunWrapper.hs | haskell | representations. | | Perform index function operations in both algebraic and LMAD
module Futhark.IR.Mem.IxFunWrapper
( IxFun,
iota,
permute,
reshape,
coerce,
slice,
flatSlice,
rebase,
)
where
import Futhark.IR.Mem.IxFun qualified as I
import Futhark.IR.Mem.IxFun.Alg qualified as IA
import Futhark.IR.Syn... |
f45ea9c94e8d55b93f1bc16d5cadbcdac2a8eb50469f81d19c735dc68820b9c3 | cryptosense/pkcs11 | pkcs11_slot_list.mli | * An element of type [ t ] is a structure made of a pointer to a C
array , and its length .
The reason we use these texts is that some PKCS#11 functions
require a two step interraction , in which one first gives a null
pointer ( with length 0 ) to a function , which modifies the length
of... | null | https://raw.githubusercontent.com/cryptosense/pkcs11/93c39c7a31c87f68f0beabf75ef90d85a782a983/driver/pkcs11_slot_list.mli | ocaml | * [allocate t] updates the content of the [t] structure to point
to freshly allocated memory. | * An element of type [ t ] is a structure made of a pointer to a C
array , and its length .
The reason we use these texts is that some PKCS#11 functions
require a two step interraction , in which one first gives a null
pointer ( with length 0 ) to a function , which modifies the length
of... |
80140b107950d4151d9db35f9e12e8a434b5a5a8626dedd8e246eee4e4590449 | kim/leveldb-haskell | Streaming.hs | {-# LANGUAGE BangPatterns #-}
{-# LANGUAGE OverloadedStrings #-}
# OPTIONS_GHC -fno - warn - orphans #
# OPTIONS_GHC -fno - warn - missing - signatures #
module Test.Streaming (tests) where
import Control.Applicative hiding (empty)
import Control.Monad.Catch
import ... | null | https://raw.githubusercontent.com/kim/leveldb-haskell/f5249081f589233890ddb1945ec548ca9fb717cf/test/Test/Streaming.hs | haskell | # LANGUAGE BangPatterns #
# LANGUAGE OverloadedStrings #
Show instance for a -> b
conversions
basic functions
transformations
folds
TODO: foldM_ ?
special folds
scans
infinite streams
unfolding
predicates
searching
substreams
zipping and unzipping
generalized
Helpers
|
# OPTIONS_GHC -fno - warn - orphans #
# OPTIONS_GHC -fno - warn - missing - signatures #
module Test.Streaming (tests) where
import Control.Applicative hiding (empty)
import Control.Monad.Catch
import Control.Monad.Identity
import Control.Monad.IO.Class
impo... |
48b350ee48c0c29de33ef3ae90844ffe28617ded53247455355fb0ad3138b698 | grin-compiler/ghc-grin | prel.hs | # INLINE error #
error :: String -> a
error s = _error s
# INLINE map #
map :: (a -> b) -> [a] -> [b]
map f = map'
where map' [] = []
map' (x:xs) = f x : map' xs
# INLINE filter #
filter :: (a -> Bool) -> [a] -> [a]
filter f = filter'
where filter' [] = []
filter' (x:xs) = if f x t... | null | https://raw.githubusercontent.com/grin-compiler/ghc-grin/ebc4dca2e1f5b3581d4b84726730564ce909d786/ghc-grin-benchmark/boquist-grin-bench/spectral/awards/prel.hs | haskell | {-# SPECIALIZE sum :: [Int] -> Int #-} | # INLINE error #
error :: String -> a
error s = _error s
# INLINE map #
map :: (a -> b) -> [a] -> [b]
map f = map'
where map' [] = []
map' (x:xs) = f x : map' xs
# INLINE filter #
filter :: (a -> Bool) -> [a] -> [a]
filter f = filter'
where filter' [] = []
filter' (x:xs) = if f x t... |
38929cccfe74b6c0dbc0c8f6b4411346002d442aaeeff9ee11f544c023a59565 | NorfairKing/intray | IntrayServer.hs | module IntrayServer where
import Import
import Intray.Server (runIntrayServer)
import Intray.Server.OptParse (getSettings)
intrayServer :: IO ()
intrayServer = do
settings <- getSettings
putStrLn $ ppShow settings
runIntrayServer settings
| null | https://raw.githubusercontent.com/NorfairKing/intray/0f272c63ff44fc7869964ca22f6195b855810543/intray-server/src/IntrayServer.hs | haskell | module IntrayServer where
import Import
import Intray.Server (runIntrayServer)
import Intray.Server.OptParse (getSettings)
intrayServer :: IO ()
intrayServer = do
settings <- getSettings
putStrLn $ ppShow settings
runIntrayServer settings
| |
de183520a1fa124ae49d37d7f60b837cc8dfe690485c2c5673fd163bcfb77f86 | frenetic-lang/netcore-1.0 | Semantics.hs | -- |Composes NetCore policies and predicates, and defines how these policies
-- interpret abstract packets.
module Frenetic.NetCore.Semantics
( evalProgram
, Id (..)
, Act (..)
, Pol (..)
, In (..)
, Out (..)
, Callback (..)
, Callbacks
, callbackDelayStream
, callbackInterval
, evalPol
, evalAc... | null | https://raw.githubusercontent.com/frenetic-lang/netcore-1.0/976b08b740027e8ed19f2d55b1e77f663bee6f02/src/Frenetic/NetCore/Semantics.hs | haskell | |Composes NetCore policies and predicates, and defines how these policies
interpret abstract packets.
# LANGUAGE DeriveDataTypeable #
packets
bytes
TODO(arjun): perhaps Out should carry the channel ID
|Restricts the policy's domain to 'pred'. Does not eliminate
'Restrict' expressions, but does restrict their r... | module Frenetic.NetCore.Semantics
( evalProgram
, Id (..)
, Act (..)
, Pol (..)
, In (..)
, Out (..)
, Callback (..)
, Callbacks
, callbackDelayStream
, callbackInterval
, evalPol
, evalAct
, desugarPolicy
, synthRestrictPol
, isForward
, isGetPacket
, isQuery
, matchPkt
, actOnMat... |
d5fbf160cb10adef884278d8421bb0213a45cf29a391b8387e21dd6a7edefdf2 | airbus-seclab/bincat | powerpc.ml |
This file is part of BinCAT .
Copyright 2014 - 2022 - Airbus
BinCAT is free software : you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation , either version 3 of the License , or ( at your
opti... | null | https://raw.githubusercontent.com/airbus-seclab/bincat/7d4a0b90cf950c0f43e252602a348cf9e2f858ba/ocaml/src/disassembly/powerpc.ml | ocaml |
Decoder for PowerPC
:PowerISA_public.v3.1.pdf
split field decoding
PPC Forms decoding
ST type as in prefix opcode for PPC64
manual reference 1.6.3.1
* state predecessor
* current address to decode
* buffer to decode
**********************************************************************
Creation of th... |
This file is part of BinCAT .
Copyright 2014 - 2022 - Airbus
BinCAT is free software : you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation , either version 3 of the License , or ( at your
opti... |
f935fe3e5c9037194d41316fdc8b6faefe45a2b5c88099269015b2161af4b09c | flyspeck/flyspeck | topology.ml | open Hol_core
open Card
open Products
open Permutations
open Floor
open Vectors
open Determinants
include Topology5
(* ------------------------------------------------------------------------- *)
(* Hausdorff distance between sets. *)
(* ----------------------------------------... | null | https://raw.githubusercontent.com/flyspeck/flyspeck/05bd66666b4b641f49e5131a37830f4881f39db9/azure/hol-light-nat/Multivariate/topology.ml | ocaml | -------------------------------------------------------------------------
Hausdorff distance between sets.
-------------------------------------------------------------------------
-------------------------------------------------------------------------
Isometries are ... | open Hol_core
open Card
open Products
open Permutations
open Floor
open Vectors
open Determinants
include Topology5
let hausdist = new_definition
`hausdist(s:real^N->bool,t:real^N->bool) =
let ds = {setdist({x},t) | x IN s} UNION {setdist({y},s) | y IN t} in
if ~(ds = {}) /\ (?b. !d. d IN ds ==> d <=... |
c5fcffe652f82f5efbad355077a8e51335cad2c73abc0ff032841384b3f366b7 | debasishg/hask | AccountService.hs | {-# LANGUAGE RankNTypes #-}
# LANGUAGE DataKinds #
# LANGUAGE FlexibleContexts #
# LANGUAGE ScopedTypeVariables #
# LANGUAGE QuasiQuotes #
# LANGUAGE TemplateHaskell #
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE GADTs #-}
-- | Exposes coarser level domain services in terms of actions that can be done on accounts.
... | null | https://raw.githubusercontent.com/debasishg/hask/1745ed50c8175cd035e8070c9cb988f4f5063653/hfrdomain/src/Service/AccountService.hs | haskell | # LANGUAGE RankNTypes #
# LANGUAGE OverloadedStrings #
# LANGUAGE GADTs #
| Exposes coarser level domain services in terms of actions that can be done on accounts.
done on an account. The service layer also implements a combinator `actionCombinator` that
allows implementation of composition of multiple actions throu... | # LANGUAGE DataKinds #
# LANGUAGE FlexibleContexts #
# LANGUAGE ScopedTypeVariables #
# LANGUAGE QuasiQuotes #
# LANGUAGE TemplateHaskell #
The service layer publishes an ADT named ` AccountAction ` that models each action that can be
module Service.AccountService
(
AccountAction (Debit, Credit, Close)
... |
3b4e2266503a60b28a394df795b6e5da8ff47f473b7ddece4659143d7abbf344 | polysemy-research/polysemy | FusionSpec.hs | # LANGUAGE CPP #
# LANGUAGE DataKinds #
# LANGUAGE TemplateHaskell #
# LANGUAGE TypeApplications #
{-# OPTIONS_GHC -O2 #-}
# OPTIONS_GHC -dsuppress - idinfo -dsuppress - coercions #
#if __GLASGOW_HASKELL__ < 804
{-# OPTIONS_GHC -fplugin=Test.Inspection.Plugin #-}
#endif
module FusionSpec whe... | null | https://raw.githubusercontent.com/polysemy-research/polysemy/2ddc66bc7813bbbc707efa3bc22e64310d6ec793/test/FusionSpec.hs | haskell | # OPTIONS_GHC -O2 #
# OPTIONS_GHC -fplugin=Test.Inspection.Plugin #
it "Union proofs should simplify" $ do
#endif
it "who needs Weaving even?" $ do
shouldSucceed $(inspectTest $ 'jank `doesNotUse` 'Weaving)
shouldSucceed $(inspectTest $ 'countDown `doesNotUse` 'Weaving)
#endif
#endif | # LANGUAGE CPP #
# LANGUAGE DataKinds #
# LANGUAGE TemplateHaskell #
# LANGUAGE TypeApplications #
# OPTIONS_GHC -dsuppress - idinfo -dsuppress - coercions #
#if __GLASGOW_HASKELL__ < 804
#endif
module FusionSpec where
import qualified Control.Monad.Trans.Except as E
import qualified Contro... |
929d17035316f23559fcedbda262271edd41b936aec3c6b9249fa6225482f58c | rowangithub/DOrder | mcs_m.ml | (**************************************************************************)
(* *)
: a generic graph library for OCaml
Copyright ( C ) 2004 - 2007
, and
(* ... | null | https://raw.githubusercontent.com/rowangithub/DOrder/e0d5efeb8853d2a51cc4796d7db0f8be3185d7df/external/ocamlgraph/src/mcs_m.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
*
Max... |
54307607da3d562d187a56cb27e33545974fef5cbfdecb558482d45b64c019a8 | darrenldl/ocaml-SeqBox | osbx.ml | open Cmdliner
let help_secs = [ `S Manpage.s_common_options
; `P "These options are common to all comamnds."
; `S "MORE HELP"
; `P "Use `$(mname) $(i,COMMAND) --help' for help on a single command."
; `S Manpage.s_authors
; `P "Darren Ldl <... | null | https://raw.githubusercontent.com/darrenldl/ocaml-SeqBox/658c623db8745ae1d804c75880b29fb53435860f/src/osbx.ml | ocaml | catch Ctrl-C breaks | open Cmdliner
let help_secs = [ `S Manpage.s_common_options
; `P "These options are common to all comamnds."
; `S "MORE HELP"
; `P "Use `$(mname) $(i,COMMAND) --help' for help on a single command."
; `S Manpage.s_authors
; `P "Darren Ldl <... |
8e2d9d7f02ce049e06ac119624686504e17212b2f50c959193c898c0c43dfa5e | xclerc/ocamljava | javaIOStreams.mli |
* This file is part of library .
* Copyright ( C ) 2007 - 2015 .
*
* library 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 ; either version 3 of the License , or
* ( at yo... | null | https://raw.githubusercontent.com/xclerc/ocamljava/8330bfdfd01d0c348f2ba2f0f23d8f5a8f6015b1/library/javalib/src/javaIOStreams.mli | ocaml | * [open_in ?buffered str] returns a new {java java.io.InputStream}
instance reading data from the file whose path is [str]. The
[buffered] parameter (defaulting to [true]) indicates whether the
stream is buffered.
@raise Java_exception if an error occurs
* [open_out ?buffered str] returns a new {java ... |
* This file is part of library .
* Copyright ( C ) 2007 - 2015 .
*
* library 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 ; either version 3 of the License , or
* ( at yo... |
69efab5b9e210107636832d2758ef3e8e3aae3c640a8978036d7218a63fbf129 | CatalaLang/catala | diff.mli | This file is part of the Catala compiler , a specification language for tax
and social benefits computation rules . Copyright ( C ) 2022 , contributor :
< >
Licensed under the Apache License , Version 2.0 ( the " License " ) ; you may not
use this file except in compliance with the License . ... | null | https://raw.githubusercontent.com/CatalaLang/catala/f1d0831d8653f91e407194d34dd04bac27535f4f/french_law/catala_legifrance/diff.mli | ocaml | * Simple and inefficient diff algorithm based on longest common subsequences
* The diff algorithm works on comparable items
* Functor that produces a [Diff] module given a comparable type | This file is part of the Catala compiler , a specification language for tax
and social benefits computation rules . Copyright ( C ) 2022 , contributor :
< >
Licensed under the Apache License , Version 2.0 ( the " License " ) ; you may not
use this file except in compliance with the License . ... |
57e36da13fc0d38f2d4fbe941a7f24888a209e0c8032b45d3a32242a1350ee10 | mbenke/jnp3-haskell | dialog3.hs | doesQuit :: String -> Bool
doesQuit "q" = True
doesQuit "quit" = True
doesQuit _ = False
promptLine :: String -> IO String
promptLine prompt = do
putStr prompt
getLine
main = mainLoop
mainLoop :: IO()
mainLoop = do
input <- promptLine "> "
if doesQuit input
then return ()
else processInput input... | null | https://raw.githubusercontent.com/mbenke/jnp3-haskell/712c5a6a24ad0efb45aee2b48e66bb91d949848e/Code/io/dialog3.hs | haskell | doesQuit :: String -> Bool
doesQuit "q" = True
doesQuit "quit" = True
doesQuit _ = False
promptLine :: String -> IO String
promptLine prompt = do
putStr prompt
getLine
main = mainLoop
mainLoop :: IO()
mainLoop = do
input <- promptLine "> "
if doesQuit input
then return ()
else processInput input... | |
343d31668457d0ac7bc1a71423a77f133992004f7f1275bb601b85582cc5e4f2 | boomerang-lang/boomerang | lenscontext.ml | open Stdlib
open Lang
* * * * The main LensContext module { { { * * * *
module LensContext = struct
module DefsD = DictOf(Id)(TripleOf(Lens)(Regex)(Regex))
module OutgoingD = DictOf(Id)(ListOf(PairOf(Lens)(Id)))
module DS = DisjointSetOf(Id)
type t = { defs : DefsD.t ;
outgoing : Outgoi... | null | https://raw.githubusercontent.com/boomerang-lang/boomerang/b42c2bfc72030bbe5c32752c236c0aad3b17d149/optician/lenscontext.ml | ocaml | TODO: is this the right thing, simpler if just between vars ?
**** }}} **** | open Stdlib
open Lang
* * * * The main LensContext module { { { * * * *
module LensContext = struct
module DefsD = DictOf(Id)(TripleOf(Lens)(Regex)(Regex))
module OutgoingD = DictOf(Id)(ListOf(PairOf(Lens)(Id)))
module DS = DisjointSetOf(Id)
type t = { defs : DefsD.t ;
outgoing : Outgoi... |
0caf8ea3346c063cb11bd4a1b430d874a43c8fe8c5c912cb7bd53744b5883851 | bsansouci/bsb-native | discard_printf.mli | (***********************************************************************)
(* *)
(* ocamlbuild *)
(* *)
, , projet Galliu... | null | https://raw.githubusercontent.com/bsansouci/bsb-native/9a89457783d6e80deb0fba9ca7372c10a768a9ea/vendor/ocaml/ocamlbuild/discard_printf.mli | ocaml | *********************************************************************
ocamlbuild
... | , , projet Gallium , INRIA Rocquencourt
Copyright 2007 Institut National de Recherche en Informatique et
en Automatique . All rights reserved . This file is distributed
under the terms of the Q Public License version 1.0 .
Original author :
open Format
val discard_printf... |
ad0a901c88f14fb8e5a7371a8dd30b6d40729fe3e247e0f8af6f5b51a80514d1 | oswald2/DGPatchMaker | Types.hs | {-# LANGUAGE OverloadedStrings, RecordWildCards #-}
module Data.DrumDrops.Types
(
Sample(..),
SampleGroup(..),
VelocityGroup(..),
Channel(..),
getMic,
)
where
import Control . Monad ( void )
import Data.Text as T
import Data.Types
import Data.Maybe (isJust)
-- data type for the sample... | null | https://raw.githubusercontent.com/oswald2/DGPatchMaker/0e10acc680b0c2b7446693c25e356763a8806afc/src/Data/DrumDrops/Types.hs | haskell | # LANGUAGE OverloadedStrings, RecordWildCards #
data type for the samples | module Data.DrumDrops.Types
(
Sample(..),
SampleGroup(..),
VelocityGroup(..),
Channel(..),
getMic,
)
where
import Control . Monad ( void )
import Data.Text as T
import Data.Types
import Data.Maybe (isJust)
data Sample =
Sample {
saFileName :: !Text,
saMaker :: !Tex... |
989ad9b8caa1964cfc309e6f1388c86854fd056c2cf92453c16edb6c1e2e0940 | tomsmalley/semantic-reflex | Checkbox.hs | # LANGUAGE FlexibleContexts #
{-# LANGUAGE GADTs #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE QuasiQuotes #-}
{-# LANGUAGE RecursiveDo #-}
# LANGUAGE RecordWildCards #
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE TemplateHaskell #-}
{-# OPTIONS_GHC -Wno-... | null | https://raw.githubusercontent.com/tomsmalley/semantic-reflex/5a973390fae1facbc4351b75ea59210d6756b8e5/semantic-reflex-example/src/Example/Section/Checkbox.hs | haskell | # LANGUAGE GADTs #
# LANGUAGE OverloadedStrings #
# LANGUAGE QuasiQuotes #
# LANGUAGE RecursiveDo #
# LANGUAGE ScopedTypeVariables #
# LANGUAGE TemplateHaskell #
# OPTIONS_GHC -Wno-unused-do-bind #
# OPTIONS_GHC -Wno-name-shadowing # | # LANGUAGE FlexibleContexts #
# LANGUAGE RecordWildCards #
module Example.Section.Checkbox where
import Control.Lens
import Reflex.Dom.SemanticUI
import Reflex.Dom.Core hiding (Checkbox, CheckboxConfig, checkbox, button, checkboxConfig_setValue, checkbox_value)
import Example.QQ
import Example.Common
ch... |
051bd8866e9e6a5694a4099a1906d5b96baee5726ae56f2fb94bd45c2322ece8 | hasktorch/hasktorch | GRU.hs | # LANGUAGE AllowAmbiguousTypes #
{-# LANGUAGE ConstraintKinds #-}
# LANGUAGE DataKinds #
{-# LANGUAGE DeriveAnyClass #-}
# LANGUAGE DeriveGeneric #
# LANGUAGE FlexibleContexts #
# LANGUAGE FlexibleInstances #
{-# LANGUAGE GADTs #-}
# LANGUAGE MultiParamTypeClasses #
# LANGUAGE OverloadedLists #
# LANGUAGE PartialTypeSi... | null | https://raw.githubusercontent.com/hasktorch/hasktorch/cf0ed1aba9c41123ba46f7c0788a4df10fbfe1ef/hasktorch/src/Torch/Typed/NN/Recurrent/GRU.hs | haskell | # LANGUAGE ConstraintKinds #
# LANGUAGE DeriveAnyClass #
# LANGUAGE GADTs #
# LANGUAGE RankNTypes #
# LANGUAGE StrictData #
# OPTIONS_GHC -fplugin GHC.TypeLits.Extra.Solver #
# OPTIONS_GHC -fplugin GHC.TypeLits.Normalise #
Input-to-hidden, hidden-to-hidden, and bias parameters for a mulilayered
TODO: when we have ca... | # LANGUAGE AllowAmbiguousTypes #
# LANGUAGE DataKinds #
# LANGUAGE DeriveGeneric #
# LANGUAGE FlexibleContexts #
# LANGUAGE FlexibleInstances #
# LANGUAGE MultiParamTypeClasses #
# LANGUAGE OverloadedLists #
# LANGUAGE PartialTypeSignatures #
# LANGUAGE PolyKinds #
# LANGUAGE QuantifiedConstraints #
# LANGUAGE RecordWi... |
378af81859cbda26903a31cf083583c2f33d3a2f08d76c6f27c67fe5c6b67b3e | chef-boneyard/opscode-pushy-server | pushy_job_state.erl | -*- erlang - indent - level : 4;indent - tabs - mode : nil ; fill - column : 92 -*-
%% ex: ts=4 sw=4 et
Copyright 2011 - 2012 Chef Software , Inc. All Rights Reserved .
%%
This file is provided to you under the Apache License ,
%% Version 2.0 (the "License"); you may not use this file
%% except in compliance wi... | null | https://raw.githubusercontent.com/chef-boneyard/opscode-pushy-server/7272326960fcc35eaa99fa8d5f5bd58959755b3e/apps/pushy/src/pushy_job_state.erl | erlang | ex: ts=4 sw=4 et
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,
KIND, either express or implied. See the License for the
specific language governing permissio... | -*- erlang - indent - level : 4;indent - tabs - mode : nil ; fill - column : 92 -*-
Copyright 2011 - 2012 Chef Software , Inc. All Rights Reserved .
This file is provided to you under the Apache License ,
software distributed under the License is distributed on an
" AS IS " BASIS , WITHOUT WARRANTIES OR CON... |
395e46d3dbd1d1d0ccccd5f978a66a82ab15b11186b13b9763e4b2e8c68423fc | jbracker/supermonad | Wrapper.hs |
# LANGUAGE CPP #
# OPTIONS_GHC -fno - warn - unused - imports #
| Provides version safe wrappers around GHC functions .
module Control.Super.Plugin.Wrapper
( -- * General Utilities (To avoid import loop)
fromLeft, fromRight
, -- * Type Variable Substitutions
TypeVarSubst
, mkTypeVarSubst
-- * Ty... | null | https://raw.githubusercontent.com/jbracker/supermonad/2595396a225a65b1dce6ed9a1ce59960f392a55b/src/Control/Super/Plugin/Wrapper.hs | haskell | * General Utilities (To avoid import loop)
* Type Variable Substitutions
* Types
* Modules
* Evidence Production
* Instance Environment
| Return the 'Left' value. If no 'Left' value is given, an error is raised.
| Return the 'Right' value. If no 'Right' value is given, an error is raised.
| Type of type variab... |
# LANGUAGE CPP #
# OPTIONS_GHC -fno - warn - unused - imports #
| Provides version safe wrappers around GHC functions .
module Control.Super.Plugin.Wrapper
fromLeft, fromRight
TypeVarSubst
, mkTypeVarSubst
, splitKindFunTys
, mkEqualityCtType
, constraintSourceLocation
, UnitId
, baseUnitId
... |
d6b1b7ecfd5107799c15d9dcaa47415efd81b88aec542bfcd53040919868f82b | mlabs-haskell/plutus-simple-model | Mint.hs | -- | Fake coins for testing
module Plutus.Model.Mint (
FakeCoin (..),
fakeCoin,
fakeValue,
) where
import Prelude (either, error, id, ($), (.))
import Data.Text qualified as Text
import PlutusLedgerApi.V1
import PlutusLedgerApi .
import Plutarch
import Plutarch.Api.V1 as Plutarch
import Plutarch.Api.V1.Va... | null | https://raw.githubusercontent.com/mlabs-haskell/plutus-simple-model/10000d64ede979bb1d7838b3ed20b785615910b9/psm/src/Plutus/Model/Mint.hs | haskell | | Fake coins for testing
| Fake coin class generated from fixed tag. | module Plutus.Model.Mint (
FakeCoin (..),
fakeCoin,
fakeValue,
) where
import Prelude (either, error, id, ($), (.))
import Data.Text qualified as Text
import PlutusLedgerApi.V1
import PlutusLedgerApi .
import Plutarch
import Plutarch.Api.V1 as Plutarch
import Plutarch.Api.V1.Value
import Plutarch.DataRepr... |
a74e716d097a227294d8eaee8039604fa03c6d58df2974b74b2f98001727baaf | josefs/STMonadTrans | Internal.hs | # LANGUAGE MagicHash , UnboxedTuples , Rank2Types , FlexibleInstances ,
MultiParamTypeClasses , UndecidableInstances , RecursiveDo #
MultiParamTypeClasses, UndecidableInstances, RecursiveDo #-}
|
Module : Control . Monad . ST.Trans
Copyright : 2008 - 2010
( c ) T... | null | https://raw.githubusercontent.com/josefs/STMonadTrans/db9199b8612cea9d4bd58b8ebe1fc7a44970aa91/Control/Monad/ST/Trans/Internal.hs | haskell | | 'STT' is the monad transformer providing polymorphic updateable references
around. This type is essentially a pair, but an ordinary pair is not
not allowed to contain unboxed types.
| Lifting the `ST` monad into `STT`. The library uses this function
extensively to be able to reuse functions from `ST`.
All... | # LANGUAGE MagicHash , UnboxedTuples , Rank2Types , FlexibleInstances ,
MultiParamTypeClasses , UndecidableInstances , RecursiveDo #
MultiParamTypeClasses, UndecidableInstances, RecursiveDo #-}
|
Module : Control . Monad . ST.Trans
Copyright : 2008 - 2010
( c ) T... |
94bae44e064a60f8aefd308ccd1de6fcc3bd8026cfa16e688b844cce297dd33c | tonyg/racket-something | sweet.rkt | #lang something // -*- sth -*-
// c.f. Sweet-expression examples
// /#quick-examples
require
something/infix
something/for
def fibfast n
if n < 2
n
fibup n 2 1 0
def fibup max count n1 n2
if max = count
n1 + n2
fibup max (count + 1) (n1 + n2) n1
def factorial n
if n <= 1
1
n * fact... | null | https://raw.githubusercontent.com/tonyg/racket-something/4a00a9a6d37777f5aab4f28b03c53555b87e21d7/src/something/test/sweet.rkt | racket | 1 ; 2 ; 3 ; 5 ; 8 ; 13 ]
2 ; 6 ; 24 ; 120 ; 720 ; 5040 ]
3 ; 4 ] ) 10
" hello " ; 4 ] ) # f | #lang something // -*- sth -*-
// c.f. Sweet-expression examples
// /#quick-examples
require
something/infix
something/for
def fibfast n
if n < 2
n
fibup n 2 1 0
def fibup max count n1 n2
if max = count
n1 + n2
fibup max (count + 1) (n1 + n2) n1
def factorial n
if n <= 1
1
n * fact... |
1df5cd3c057d3e477164d61dfbc2cd02f90d8b4e63299d7ca22f0cd2c9b22779 | iskandr/parakeet-retired | FindLiveIds.ml | (* collects the set of IDs which are used inside of a function body *)
open Base
open TypedSSA
open SSA_Analysis
module LiveIdEval = MkEvaluator(struct
type env = ID.t MutableSet.t
type value_info = unit
type exp_info = unit
let iterative = false
let dir = Forward
let init fundef =
let liveSet = Muta... | null | https://raw.githubusercontent.com/iskandr/parakeet-retired/3d7e6e5b699f83ce8a1c01290beed0b78c0d0945/SSA/Analyses/FindLiveIds.ml | ocaml | collects the set of IDs which are used inside of a function body | open Base
open TypedSSA
open SSA_Analysis
module LiveIdEval = MkEvaluator(struct
type env = ID.t MutableSet.t
type value_info = unit
type exp_info = unit
let iterative = false
let dir = Forward
let init fundef =
let liveSet = MutableSet.create 127 in
List.iter (MutableSet.add liveSet) fundef.inp... |
285b8956e5c8006fae1df4ada3217ce08f02d315984be2f910d0ca5fd5229237 | jgertm/lang | utils.clj | (ns lang.utils
(:require [clojure.edn :as edn]
[clojure.java.io :as io]
[clojure.set :as set]))
(def dev?
(= :dev (:profile (edn/read-string (slurp (io/resource "config.edn"))))))
(when dev?
(require '[com.gfredericks.debug-repl :refer [break!]]))
(defmacro undefined
;; (throw (Except... | null | https://raw.githubusercontent.com/jgertm/lang/5a4d73f01d93d7615e44f8ce2dfe8a237dd80766/src/lang/utils.clj | clojure | (throw (Exception. "not implemented yet")) | (ns lang.utils
(:require [clojure.edn :as edn]
[clojure.java.io :as io]
[clojure.set :as set]))
(def dev?
(= :dev (:profile (edn/read-string (slurp (io/resource "config.edn"))))))
(when dev?
(require '[com.gfredericks.debug-repl :refer [break!]]))
(defmacro undefined
([]
(if dev?
... |
273264c12f904a79ac157fa2e00dd32a0c4d667fea8e1cc030e0d6cbabca633f | aufishgrp/istype | istype.erl | -module(istype).
%% API exports
-export([return_value/1]).
-include_lib("eunit/include/eunit.hrl").
-record(record0, {a = apple :: atom(),
b = <<"">> :: binary(),
c :: undefined | range0(),
d}).
-record(record1, {a = #record0{} :: record0(),
... | null | https://raw.githubusercontent.com/aufishgrp/istype/4d30777eaf1309dbef73fff99605235a46a3e61b/src/istype.erl | erlang | API exports
====================================================================
Test functions
====================================================================
TODO: record to map
-record(record0, {a = apple :: atom(),
b = <<"">> :: binary(),
c :: undefined | range0... | -module(istype).
-export([return_value/1]).
-include_lib("eunit/include/eunit.hrl").
-record(record0, {a = apple :: atom(),
b = <<"">> :: binary(),
c :: undefined | range0(),
d}).
-record(record1, {a = #record0{} :: record0(),
b = <<"... |
39a34eb37c4228b691b901564d0657fb28168e29889c8b7657b3a0e86b370bd7 | SKA-ScienceDataProcessor/RC | dot-product.hs | # LANGUAGE GeneralizedNewtypeDeriving #
{-# LANGUAGE BangPatterns #-}
{-# LANGUAGE GADTs #-}
{-# LANGUAGE TemplateHaskell #-}
{-# LANGUAGE DeriveDataTypeable #-}
# LANGUAGE DeriveGeneric #
-- | Very simple scheduler and node monitor
module Main where
import System.Environment (getArgs)
import Control.Applicat... | null | https://raw.githubusercontent.com/SKA-ScienceDataProcessor/RC/1b5e25baf9204a9f7ef40ed8ee94a86cc6c674af/MS1/distributed-dot-product/dot-product.hs | haskell | # LANGUAGE BangPatterns #
# LANGUAGE GADTs #
# LANGUAGE TemplateHaskell #
# LANGUAGE DeriveDataTypeable #
| Very simple scheduler and node monitor
--------------------------------------------------------------
Data types
--------------------------------------------------------------
| Process completed its execut... | # LANGUAGE GeneralizedNewtypeDeriving #
# LANGUAGE DeriveGeneric #
module Main where
import System.Environment (getArgs)
import Control.Applicative
import Control.Monad
import Control.Category
import Control.Monad.Trans.Except
import Control.Distributed.Process
import Control.Distributed.Process.Closure
import C... |
c939d6bcb8eaaf9692c53db54b786866f719720456ba9b34a56c0a42e302f4bc | srid/ema | Folder.hs | module Ema.Route.Lib.Folder (
FolderRoute (FolderRoute, unFolderRoute),
prefixRoutePrism,
) where
import Data.Text qualified as T
import Ema.Route.Class (IsRoute (..))
import Ema.Route.Prism (Prism_, mapRoutePrism)
import Ema.Site (EmaSite (..), EmaStaticSite)
import GHC.TypeLits (KnownSymbol, Symbol, symbolVal)
i... | null | https://raw.githubusercontent.com/srid/ema/61faae56aa0f3c6ca815f344684cc566f6341662/ema/src/Ema/Route/Lib/Folder.hs | haskell | | A route that is prefixed at some URL prefix
| Prefix the encoding of the given route prism. | module Ema.Route.Lib.Folder (
FolderRoute (FolderRoute, unFolderRoute),
prefixRoutePrism,
) where
import Data.Text qualified as T
import Ema.Route.Class (IsRoute (..))
import Ema.Route.Prism (Prism_, mapRoutePrism)
import Ema.Site (EmaSite (..), EmaStaticSite)
import GHC.TypeLits (KnownSymbol, Symbol, symbolVal)
i... |
20f0b5d49bc461b2e750cabb0f89e0d5879438485106cb64b6b90addab95343f | ghc/testsuite | tcfail038.hs | -- !!! duplicate class-method declarations
module ShouldFail where
data NUM = ONE | TWO
instance Eq NUM where
a == b = True
a /= b = False
a == b = False
a /= b = True
| null | https://raw.githubusercontent.com/ghc/testsuite/998a816ae89c4fd573f4abd7c6abb346cf7ee9af/tests/typecheck/should_fail/tcfail038.hs | haskell | !!! duplicate class-method declarations |
module ShouldFail where
data NUM = ONE | TWO
instance Eq NUM where
a == b = True
a /= b = False
a == b = False
a /= b = True
|
da04b0a882709febb877262da92521be868bb356a8a28b04a801878a1e31b32e | nikodemus/SBCL | vm-tran.lisp | ;;;; implementation-dependent transforms
This software is part of the SBCL system . See the README file for
;;;; more information.
;;;;
This software is derived from the CMU CL system , which was
written at Carnegie Mellon University and released into the
;;;; public domain. The software is in the public domain ... | null | https://raw.githubusercontent.com/nikodemus/SBCL/3c11847d1e12db89b24a7887b18a137c45ed4661/src/compiler/generic/vm-tran.lisp | lisp | implementation-dependent transforms
more information.
public domain. The software is in the public domain and is
provided with absolutely no warranty. See the COPYING and CREDITS
files for more information.
transform picks whichever predicate was defined last when there
are multiple predicates for equivalent ty... |
This software is part of the SBCL system . See the README file for
This software is derived from the CMU CL system , which was
written at Carnegie Mellon University and released into the
(in-package "SB!C")
We need to define these predicates , since the TYPEP source
(define-source-transform short-float-p (x)... |
0f8efb58afeca6dd4ae9f166a7a8a820950304082ead87de2f8732aa32d805d3 | melange-re/melange | js_exp_make.mli | Copyright ( C ) 2015 - 2016 Bloomberg Finance L.P.
*
* 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 , either version 3 of the License , or
* ( at your option ) any later... | null | https://raw.githubusercontent.com/melange-re/melange/24083b39f10d8df40a786d890d7530b514ba70a4/jscomp/core/js_exp_make.mli | ocaml | * Creator utilities for the [J] module
* check if a javascript ast is constant
The better signature might be
{[
J.expresssion -> Js_output.t
]}
for exmaple
{[
e ?print_int(3) : 0
--->
if(e){print_int(3)}
]}
val runtime_var_vid : ... | Copyright ( C ) 2015 - 2016 Bloomberg Finance L.P.
*
* 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 , either version 3 of the License , or
* ( at your option ) any later... |
2228b803ae60e2fecb211b9577edfd339f14db36297b103690150d28d52d180a | stonebuddha/eopl | core.mli | open Syntax
exception Interpreter_error of string * Ploc.t
val value_of_program : program -> unit
| null | https://raw.githubusercontent.com/stonebuddha/eopl/88ea636110421706f900e753c30240ff1ea26f67/MUTABLE-PAIRS/core.mli | ocaml | open Syntax
exception Interpreter_error of string * Ploc.t
val value_of_program : program -> unit
| |
393a720749bb535785db05a9fcaea15cc765f8bdf7b0f58141feda67539d68d2 | gsakkas/rite | 0078.ml | CaseG VarG [(ConPatG Nothing,Nothing,VarG),(ConPatG Nothing,Nothing,VarG),(ConPatG (Just EmptyPatG),Nothing,AppG [EmptyG])]
match e with
| VarX -> x
| VarY -> y
| Sine ex -> sin (pi *. eval (ex , x , y))
| null | https://raw.githubusercontent.com/gsakkas/rite/958a0ad2460e15734447bc07bd181f5d35956d3b/data/sp14_min/clusters/0078.ml | ocaml | CaseG VarG [(ConPatG Nothing,Nothing,VarG),(ConPatG Nothing,Nothing,VarG),(ConPatG (Just EmptyPatG),Nothing,AppG [EmptyG])]
match e with
| VarX -> x
| VarY -> y
| Sine ex -> sin (pi *. eval (ex , x , y))
| |
cfad580eceb7f5cbb5a5897f484086ac9903f0e74fdfb1c9c505eda4bdd80cb5 | ijvcms/chuanqi_dev | mysql.erl | %%% File : mysql.erl
Author : < >
. : MySQL client .
%%%
Created : 4 Aug 2005 by < >
%%%
Copyright ( c ) 2001 - 2004 Kungliga Tekniska H � gskolan
%%% See the file COPYING
%%%
Modified : 9/12/2006 by < >
%%% Note: Added support for prepared statements,
%%% transactions, better connection pool... | null | https://raw.githubusercontent.com/ijvcms/chuanqi_dev/7742184bded15f25be761c4f2d78834249d78097/server/trunk/server/src/system/db/mysql/mysql.erl | erlang | File : mysql.erl
See the file COPYING
Note: Added support for prepared statements,
transactions, better connection pooling, more efficient logging
and made other internal enhancements.
moved much of the prepared statement handling code to mysql_conn.erl
and added versioning to prepared statements.
Usa... | Author : < >
. : MySQL client .
Created : 4 Aug 2005 by < >
Copyright ( c ) 2001 - 2004 Kungliga Tekniska H � gskolan
Modified : 9/12/2006 by < >
Modified : 9/23/2006 Rewrote the transaction handling code to
provide a simpler , - style transaction interface . Also ,
Call one of the start ... |
2cc1b1a9a56b2f3bf79d658f9fd9a2f4abfd0748a6e79ad7cc7dee44cc8a129d | willemdj/erlsom | continuation_example.erl | -module(continuation_example).
Example to show how the Erlsom Sax parser can be used in combination
%% with a 'continuation function'. This enables parsing of very big documents
%% in a sort of streaming mode.
%%
%% When the sax parser reaches the end of a block of data, it calls the
%% continuation function. This sh... | null | https://raw.githubusercontent.com/willemdj/erlsom/19883e01a36c8927a770f0f46c3b96bbe9ad90ce/examples/continuation/continuation_example.erl | erlang | with a 'continuation function'. This enables parsing of very big documents
in a sort of streaming mode.
When the sax parser reaches the end of a block of data, it calls the
continuation function. This should return the next block of data.
- Tail is the (short) list of characters that could not yet be parsed
... | -module(continuation_example).
Example to show how the Erlsom Sax parser can be used in combination
the continuation function is a function that takes 2 arguments : Tail and
State .
characters / unicode code points , and NewState the new value for the State .
-export([run/0]).
should be tuned for the best r... |
ac16db667806bfe1b84374f12a4e586fa228f56242dcdcb65a3d61533a180a2a | CoNarrative/precept-devtools | config.clj | (ns precept-devtools.config
(:require [cprop.core :refer [load-config]]
[cprop.source :as source]
[mount.core :refer [args defstate]]))
(defstate env :start (load-config
:merge
[(args)
(source/from-system-props)
... | null | https://raw.githubusercontent.com/CoNarrative/precept-devtools/0c69c090db2159c4d1f5ce783cecd9d5426c5fe0/src/clj/precept_devtools/config.clj | clojure | (ns precept-devtools.config
(:require [cprop.core :refer [load-config]]
[cprop.source :as source]
[mount.core :refer [args defstate]]))
(defstate env :start (load-config
:merge
[(args)
(source/from-system-props)
... | |
853dc84426f33195daffd56ef8edaf5fefd8064a1879b87cf094d343b560f49f | scrintal/heroicons-reagent | device_phone_mobile.cljs | (ns com.scrintal.heroicons.outline.device-phone-mobile)
(defn render []
[:svg {:xmlns ""
:fill "none"
:viewBox "0 0 24 24"
:strokeWidth "1.5"
:stroke "currentColor"
:aria-hidden "true"}
[:path {:strokeLinecap "round"
:strokeLinejoin "ro... | null | https://raw.githubusercontent.com/scrintal/heroicons-reagent/572f51d2466697ec4d38813663ee2588960365b6/src/com/scrintal/heroicons/outline/device_phone_mobile.cljs | clojure | (ns com.scrintal.heroicons.outline.device-phone-mobile)
(defn render []
[:svg {:xmlns ""
:fill "none"
:viewBox "0 0 24 24"
:strokeWidth "1.5"
:stroke "currentColor"
:aria-hidden "true"}
[:path {:strokeLinecap "round"
:strokeLinejoin "ro... | |
4ff5cd005b7ce6367c81279c39c7a0ee51739899d76e9b71ade615ae09904d00 | gfour/gic | Renamer.hs | -- | The renamer that creates unique names for functions and variables.
--
-- Notes:
--
-- * The binder names for pattern matching expressions are assumed to be unique.
--
module SLIC.Front.Renamer (renInvNames, uniqueNames) where
import Data.Map (Map, empty, fromList, mapKeys, mapWithKey, toList, unions)
import... | null | https://raw.githubusercontent.com/gfour/gic/d5f2e506b31a1a28e02ca54af9610b3d8d618e9a/SLIC/Front/Renamer.hs | haskell | | The renamer that creates unique names for functions and variables.
Notes:
* The binder names for pattern matching expressions are assumed to be unique.
* Renaming information
| A map of renaming pairs for unique variable name generation.
(e.g. rename an imported function with its fully qualified name)... |
module SLIC.Front.Renamer (renInvNames, uniqueNames) where
import Data.Map (Map, empty, fromList, mapKeys, mapWithKey, toList, unions)
import qualified Data.Map as M (lookup, map)
import SLIC.AuxFun (ierr, mergeM)
import SLIC.Constants (bMod)
import SLIC.Front.Typeclass
import SLIC.SyntaxAux
import SLIC.SyntaxFL
impo... |
e62608d5be49006ce5a943841e4eeff59b9bd0a491c23ef769f763d51979157c | KeepSafe/measure | project.clj | (defproject com.getkeepsafe/measure "0.1.8"
:description "Say things about your application with authority, using Coda Hale's Metrics."
:url ""
:scm {:name "git"
:url ""}
:license {:name "Apache License, Version 2.0"
:url "-2.0.html"}
:dependencies [[org.clojure/clojure "1.6.0"]
... | null | https://raw.githubusercontent.com/KeepSafe/measure/88fa7dfd572493034c6bc5bdb3a4ede1ad33e2aa/project.clj | clojure | (defproject com.getkeepsafe/measure "0.1.8"
:description "Say things about your application with authority, using Coda Hale's Metrics."
:url ""
:scm {:name "git"
:url ""}
:license {:name "Apache License, Version 2.0"
:url "-2.0.html"}
:dependencies [[org.clojure/clojure "1.6.0"]
... | |
54df18ee4c70ced7b4c15e7e2903c63ea4acf8e6f8e5a22a78ec919d83098eb5 | thosmos/riverdb | util.cljc | (ns riverdb.util
#?(:cljs (:require-macros [riverdb.util]))
#?(:cljs (:refer-clojure :exclude [uuid]))
(:require
#?(:clj [dotenv])
#?(:cljs [goog.object :as gobj])
[com.fulcrologic.guardrails.core :refer [>defn]]
[com.fulcrologic.fulcro.algorithms.tempid :as tempid]
[clojure.spec.alpha :as s]
... | null | https://raw.githubusercontent.com/thosmos/riverdb/db658754417289361e565d9e215a3f2c3a495d32/src/main/riverdb/util.cljc | clojure | can be a minus
can be exceeding than available page limit
const url = window.URL.createObjectURL(new Blob([response.data]));
const link = document.createElement('a');
link.href = url;
link.setAttribute('download', 'file.pdf'); //or any other extension
document.body.appendChild(link);
link.click()
link.parentNode.remov... | (ns riverdb.util
#?(:cljs (:require-macros [riverdb.util]))
#?(:cljs (:refer-clojure :exclude [uuid]))
(:require
#?(:clj [dotenv])
#?(:cljs [goog.object :as gobj])
[com.fulcrologic.guardrails.core :refer [>defn]]
[com.fulcrologic.fulcro.algorithms.tempid :as tempid]
[clojure.spec.alpha :as s]
... |
c1b69a90db64b7a9795c508cc325566e98e14800bc878501c5206aafbe02a254 | sbcl/sbcl | cover.lisp | A frontend for the SBCL code coverage facility . Written by
Snellman , and placed under public domain .
;;; This module includes a modified version of the source path parsing
routines from Swank . That code was written by , and
;;; was placed under Public Domain
(defpackage #:sb-cover
(:use #:cl #:sb-c)
... | null | https://raw.githubusercontent.com/sbcl/sbcl/df6846ef14d09bf499bd79bab09c082d9916fc9b/contrib/sb-cover/cover.lisp | lisp | This module includes a modified version of the source path parsing
was placed under Public Domain
New coverage representation.
representation of the marks from other architectures.
Coverage marks are in the raw bytes following the jump tables
preceding any other unboxed constants. This way we don't have to store
... | A frontend for the SBCL code coverage facility . Written by
Snellman , and placed under public domain .
routines from Swank . That code was written by , and
(defpackage #:sb-cover
(:use #:cl #:sb-c)
(:export #:report
#:get-coverage
#:reset-coverage #:clear-coverage
#:rest... |
bd380872b4d3b5350468262bb97fcc327f85fefea67aa134db7370f3ae8ca6e8 | racket/racket7 | stats.rkt | #lang racket/base
(require "check.rkt"
"thread.rkt"
"time.rkt")
(provide vector-set-performance-stats!)
(define/who (vector-set-performance-stats! vec [thd #f])
(check who (lambda (v) (and (vector? v) (not (immutable? v))))
#:contract "(and/c vector? (not/c immutable?))"
vec)
(... | null | https://raw.githubusercontent.com/racket/racket7/5dbb62c6bbec198b4a790f1dc08fef0c45c2e32b/racket/src/thread/stats.rkt | racket | # of thread switches
# of stack overflows
# of threads scheduled for running
# of syntax objects read
# of hash table searches
# of hash table collisions
non-GCed memory allocated for machine code
blocked for synchronization?
continuation size in bytes | #lang racket/base
(require "check.rkt"
"thread.rkt"
"time.rkt")
(provide vector-set-performance-stats!)
(define/who (vector-set-performance-stats! vec [thd #f])
(check who (lambda (v) (and (vector? v) (not (immutable? v))))
#:contract "(and/c vector? (not/c immutable?))"
vec)
(... |
3c84e389b20e7a655a9febf028d245012eb4a1b6950bc9c2af9bb027e819964e | bdeket/rktsicm | mechanics.rkt | #lang racket/base
(require "units/constants.rkt"
"mechanics/rotation.rkt"
"mechanics/universal.rkt"
"mechanics/Lagrangian.rkt"
"mechanics/action.rkt"
"mechanics/gamma-bar.rkt"
"mechanics/Lagrangian-transformations.rkt"
"mechanics/Noether.rkt"
"mec... | null | https://raw.githubusercontent.com/bdeket/rktsicm/9a6177d98040f058214add392bd791f5259b83b5/rktsicm/sicm/mechanics.rkt | racket | overwritten in time-varying | #lang racket/base
(require "units/constants.rkt"
"mechanics/rotation.rkt"
"mechanics/universal.rkt"
"mechanics/Lagrangian.rkt"
"mechanics/action.rkt"
"mechanics/gamma-bar.rkt"
"mechanics/Lagrangian-transformations.rkt"
"mechanics/Noether.rkt"
"mec... |
b66c36deec51350fb8f1f650153f472713951ccd54f3cd1bcb3b63a2e6236497 | aws-beam/aws-erlang | aws_chime_sdk_meetings.erl | %% WARNING: DO NOT EDIT, AUTO-GENERATED CODE!
See -beam/aws-codegen for more details .
@doc The Amazon Chime SDK meetings APIs in this section allow software
developers to create Amazon Chime SDK meetings , set the AWS Regions for
%% meetings, create and manage users, and send and receive meeting
%% notification... | null | https://raw.githubusercontent.com/aws-beam/aws-erlang/699287cee7dfc9dc8c08ced5f090dcc192c9cba8/src/aws_chime_sdk_meetings.erl | erlang | WARNING: DO NOT EDIT, AUTO-GENERATED CODE!
meetings, create and manage users, and send and receive meeting
notifications.
meetings.
====================================================================
API
====================================================================
@doc Updates `AttendeeCapabilities' ex... | See -beam/aws-codegen for more details .
@doc The Amazon Chime SDK meetings APIs in this section allow software
developers to create Amazon Chime SDK meetings , set the AWS Regions for
For more information about the meeting APIs , see Amazon Chime SDK
-module(aws_chime_sdk_meetings).
-export([batch_create_att... |
1ad96ac21cb6396c077f35bb071c69808be344d8d6cab4190b21690fd9412a88 | basho/sidejob | sidejob_worker_sup.erl | %% -------------------------------------------------------------------
%%
Copyright ( c ) 2013 Basho Technologies , Inc. All Rights Reserved .
%%
This file is provided to you under the Apache License ,
%% Version 2.0 (the "License"); you may not use this file
except in compliance with the License . You may ob... | null | https://raw.githubusercontent.com/basho/sidejob/1c377578c0956e91ebbb98a798c5d4b6d0959c99/src/sidejob_worker_sup.erl | erlang | -------------------------------------------------------------------
Version 2.0 (the "License"); you may not use this file
a copy of the License at
-2.0
Unless required by applicable law or agreed to in writing,
KIND, either express or implied. See the License for the
specific language governing permissio... | Copyright ( c ) 2013 Basho Technologies , Inc. All Rights Reserved .
This file is provided to you under the Apache License ,
except in compliance with the License . You may obtain
software distributed under the License is distributed on an
" AS IS " BASIS , WITHOUT WARRANTIES OR CONDITIONS OF ANY
-module(... |
d209556c3f1e470e50d1af3d921b182b76bbd28dc662915f19aec2687533870f | Innf107/cobble-compiler | Tokenizer.hs | {-# LANGUAGE NoOverloadedStrings, OverloadedLists #-}
module Cobble.Parser.Tokenizer where
import Cobble.Prelude hiding ((|>))
import Cobble.Syntax
import Data.Char
import Data.DList as D
import Text.Read (read)
(|>) :: DList a -> a -> DList a
(|>) = D.snoc
-- | A Token consists of its lexical information
-- as w... | null | https://raw.githubusercontent.com/Innf107/cobble-compiler/d6b0b65dad0fd6f1d593f7f859b1cc832e01e21f/src/Cobble/Parser/Tokenizer.hs | haskell | # LANGUAGE NoOverloadedStrings, OverloadedLists #
| A Token consists of its lexical information
as well as the actual token data.
, Output Log | module Cobble.Parser.Tokenizer where
import Cobble.Prelude hiding ((|>))
import Cobble.Syntax
import Data.Char
import Data.DList as D
import Text.Read (read)
(|>) :: DList a -> a -> DList a
(|>) = D.snoc
data Token = Token {
tokLexInfo::LexInfo
, tokData :: TokenData
} deriving (Show, Eq)
data To... |
72df492e09f80d69fb2b92731168fb9c11753591a6a56f0633448bd4b0073165 | avsm/platform | uucp_rmap.ml | ---------------------------------------------------------------------------
Copyright ( c ) 2014 . All rights reserved .
Distributed under the ISC license , see terms at the end of the file .
% % NAME%% % % ---------------------------------------------------------------------------
Copyright (c) ... | null | https://raw.githubusercontent.com/avsm/platform/b254e3c6b60f3c0c09dfdcde92eb1abdc267fa1c/duniverse/uucp.12.0.0%2Bdune/src/uucp_rmap.ml | ocaml | Binary tree uchar ranges maps.
perfect balance.
value sharing not taken into account. | ---------------------------------------------------------------------------
Copyright ( c ) 2014 . All rights reserved .
Distributed under the ISC license , see terms at the end of the file .
% % NAME%% % % ---------------------------------------------------------------------------
Copyright (c) ... |
009440ece8054beaa9795f5a9f87de9f4b93443c08a4eccb904946bd2b104028 | EFanZh/EOPL-Exercises | exercise-4.17-test.rkt | #lang racket/base
(require rackunit)
(require "../solutions/exercise-4.x-implicit-refs-lang.rkt")
(check-equal? (run "let x = 7
in let f = proc ()
set x = 5
in let y = x
in begin (f);
... | null | https://raw.githubusercontent.com/EFanZh/EOPL-Exercises/11667f1e84a1a3e300c2182630b56db3e3d9246a/tests/exercise-4.17-test.rkt | racket | #lang racket/base
(require rackunit)
(require "../solutions/exercise-4.x-implicit-refs-lang.rkt")
(check-equal? (run "let x = 7
in let f = proc ()
set x = 5
in let y = x
let z = x
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.