_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 |
|---|---|---|---|---|---|---|---|---|
bb6d55800fd82bed7df7a0c16a257241857b3984fe07d37d4b994a0fccc2a71e | missingfaktor/akar | patterns_test.clj | (ns akar.patterns-test
(:require [akar.patterns :refer :all]
[akar.primitives :refer :all]
[akar.combinators :refer :all]
[clojure.test :refer :all]
[akar.test-support :refer :all])
(:import [clojure.lang Keyword]
[akar.test_support Add Sub Num Node]))
(de... | null | https://raw.githubusercontent.com/missingfaktor/akar/66403b735cafab4e9fb971b4bf56e899ee84962f/akar-core/test/akar/patterns_test.clj | clojure | (ns akar.patterns-test
(:require [akar.patterns :refer :all]
[akar.primitives :refer :all]
[akar.combinators :refer :all]
[clojure.test :refer :all]
[akar.test-support :refer :all])
(:import [clojure.lang Keyword]
[akar.test_support Add Sub Num Node]))
(de... | |
5d15fe372f71b4595631306db082eb18c58550fd9c47c8d5f765e77e5c051333 | janestreet/vcaml | plugin.mli | open! Core
open! Async
val main : Command.t
module For_testing : sig
type command := [ `connected ] Vcaml.Client.t -> unit Deferred.Or_error.t
val next_file_pattern : command
val prev_file_pattern : command
val echo_file_patterns : command
val list_file_patterns_in_fzf : command
end
| null | https://raw.githubusercontent.com/janestreet/vcaml/e5da6cf146688b904c4627201a43898a397d009b/plugins/mli-cycler/src/plugin.mli | ocaml | open! Core
open! Async
val main : Command.t
module For_testing : sig
type command := [ `connected ] Vcaml.Client.t -> unit Deferred.Or_error.t
val next_file_pattern : command
val prev_file_pattern : command
val echo_file_patterns : command
val list_file_patterns_in_fzf : command
end
| |
3da5edc1e82d5f8c3501bf86d6b4bba921942cfd8eb0eb2b4a1aff37af8eb048 | egonSchiele/dominion | Main.hs | import Dominion
import Dominion.Cards
import Dominion.Strategies
import Control.Monad hiding (join)
import qualified Dominion.Types as T
chapelStrategy p = do
chapels <- countNum p chapel
money <- handValue p
currentRound <- getRound
-- buy a chapel to start
when (chapels == 0 && money <= 3) $ do
... | null | https://raw.githubusercontent.com/egonSchiele/dominion/a4b7300f2e445da5e7cfcc1cf9029243a3561ed6/src/Main.hs | haskell | buy a chapel to start
if you have a chapel, use it | import Dominion
import Dominion.Cards
import Dominion.Strategies
import Control.Monad hiding (join)
import qualified Dominion.Types as T
chapelStrategy p = do
chapels <- countNum p chapel
money <- handValue p
currentRound <- getRound
when (chapels == 0 && money <= 3) $ do
p `buys` chapel
r... |
15788637888d3ecdb4eb594bc5df259fac56a6e37061201ad47cc6dab67df105 | onyx-platform/onyx | abs_merge_test.clj | (ns onyx.peer.abs-merge-test
(:require [clojure.core.async :refer [chan >!! <!! close! sliding-buffer]]
[clojure.test :refer [deftest is testing]]
[onyx.plugin.seq]
[onyx.plugin.core-async :refer [take-segments!]]
[onyx.test-helper :refer [load-config with-test-env add-... | null | https://raw.githubusercontent.com/onyx-platform/onyx/74f9ae58cdbcfcb1163464595f1e6ae6444c9782/test/onyx/peer/abs_merge_test.clj | clojure | (ns onyx.peer.abs-merge-test
(:require [clojure.core.async :refer [chan >!! <!! close! sliding-buffer]]
[clojure.test :refer [deftest is testing]]
[onyx.plugin.seq]
[onyx.plugin.core-async :refer [take-segments!]]
[onyx.test-helper :refer [load-config with-test-env add-... | |
40cf56e3c6d0f6e49a67bfd4b8123714517823c594c83579a823e6d76df27432 | luposlip/nd-db | convert.clj | (ns nd-db.convert
(:require [clojure.java.io :as jio]
[clojure.core.reducers :as r]
[nd-db
[core :as nddb]
[io :as ndio]
[util :as util]])
(:import [java.time Instant]))
(defn ->ndnippy
"Converts .ndjson and .ndedn files to .ndnippy.
.ndnippy is... | null | https://raw.githubusercontent.com/luposlip/nd-db/b8662e80dbeedf46fa05fc423fe1f34a91a4bf7a/src/nd_db/convert.clj | clojure | (ns nd-db.convert
(:require [clojure.java.io :as jio]
[clojure.core.reducers :as r]
[nd-db
[core :as nddb]
[io :as ndio]
[util :as util]])
(:import [java.time Instant]))
(defn ->ndnippy
"Converts .ndjson and .ndedn files to .ndnippy.
.ndnippy is... | |
6be4350c11df20177f2925bf1d58eb1b82aee147d675c7937672e157a0c57f8d | stylewarning/hypergeometrica | sundries.lisp | ;;;; sundries.lisp
;;;;
Copyright ( c ) 2019
(in-package #:hypergeometrica-tests)
;;;; Tests which don't fit anywhere else ;;;;
(deftest test-sundries ()
;; POWER-OF-TWO-P
(is (not (h::power-of-two-p 0)))
(is (h::power-of-two-p 1))
(is (h::power-of-two-p 2))
(is (not (h::power-of-two-p 3)))
(is (h::p... | null | https://raw.githubusercontent.com/stylewarning/hypergeometrica/98817d8125eb4d082ad494e539e0cb35e1dc0556/tests/sundries.lisp | lisp | sundries.lisp
Tests which don't fit anywhere else ;;;;
POWER-OF-TWO-P | Copyright ( c ) 2019
(in-package #:hypergeometrica-tests)
(deftest test-sundries ()
(is (not (h::power-of-two-p 0)))
(is (h::power-of-two-p 1))
(is (h::power-of-two-p 2))
(is (not (h::power-of-two-p 3)))
(is (h::power-of-two-p 4))
(loop :for i :from 1 :to 25
:do (is (h::power-of-two-p (expt 2... |
f89fec4dd8c937176b53beb484e8342a2de42852ac6de6704a90caef993a6799 | Bike/sandalphon.lambda-list | check.lisp | (in-package #:sandalphon.lambda-list)
;;;; (Hopefully) little functions for checking lambda list stuff
;;;; in safe code. Too many arguments is the main one, but I'll throw
;;;; in keywords (less little) here while I'm at it.
;;; keyword stuff
(defun verify-keys (list keys aok-p)
(loop with bad-keys = nil
w... | null | https://raw.githubusercontent.com/Bike/sandalphon.lambda-list/db240cdcf2c066e220de0b49d441cecca941f1fb/check.lisp | lisp | (Hopefully) little functions for checking lambda list stuff
in safe code. Too many arguments is the main one, but I'll throw
in keywords (less little) here while I'm at it.
keyword stuff
whether :allow-other-keys has been seen
length stuff | (in-package #:sandalphon.lambda-list)
(defun verify-keys (list keys aok-p)
(loop with bad-keys = nil
do (typecase list
(null (loop-finish))
(cons (typecase (cdr list)
(null
(error "Odd number of arguments in &key plist: ~a"
list))
((not cons) (error "Dotted list as &key plist ~a"
... |
f0f8e84e7a1a9b662304a666bca04fe64aa651e6946b3bd4c9e88c3dd526c552 | JeffreyBenjaminBrown/hode | AndSearch.hs | -- PITFALL: These functions are all mutually recursive.
-- They mix editing and search.
# LANGUAGE ScopedTypeVariables #
module Hode.Rslt.Edit.AndSearch (
exprToAddrInsert -- ^ Rslt -> Expr -> Either String
-- ( Rslt
-- , [Aged Addr] -- ^ added or already present
... | null | https://raw.githubusercontent.com/JeffreyBenjaminBrown/hode/79a54a6796fa01570cde6903b398675c42954e62/hode/Hode/Rslt/Edit/AndSearch.hs | haskell | PITFALL: These functions are all mutually recursive.
They mix editing and search.
^ Rslt -> Expr -> Either String
( Rslt
, [Aged Addr] -- ^ added or already present
, [Cycle] ) -- ^ any new cycles
^ Rslt -> [Expr] -> Either String
( Rslt
, [[Aged Addr]] -- ^ added or already present
, [Cycle] ) -- ^ any new c... |
# LANGUAGE ScopedTypeVariables #
module Hode.Rslt.Edit.AndSearch (
) where
import qualified Data.List as L
import Hode.Hash.Lookup
import Hode.Rslt.Binary
import Hode.Rslt.Edit.Initial
import Hode.Rslt.Lookup
import Hode.Rslt.Types
import Hode.Rslt.Util
import Hode.Util.Misc
| ` exprToAddrInsert r ei ` ... |
9cfc974054a48b1dca8daf8f0dc818e74ae825a236441cd7c2fa25f76e3e942d | brownplt/cs173-python | python-desugar-core.rkt | #lang plai-typed
;; this is where the core is desugared into the micro-core.
(require "python-core-syntax.rkt"
"python-micro-syntax.rkt"
"python-helpers.rkt")
(define (desugar-core [e : CExp]) : UExp
(type-case CExp e
[CNum (n) (UNum n)]
[CStr (s) (UStr s)]
[CBool (b) (UBool b)]
[... | null | https://raw.githubusercontent.com/brownplt/cs173-python/d8ae026172f269282e54366f16ec42e037117cb4/design4/cs173-python/python-desugar-core.rkt | racket | this is where the core is desugared into the micro-core.
these are the things we are actually changing
basically, we provide a shadowed '^throw continuation, and then see what
we are handed. if it is an error (ie, an exception), we see if it matches
what we are catching, and if it doesn't, we re-throw. Since we ar... | #lang plai-typed
(require "python-core-syntax.rkt"
"python-micro-syntax.rkt"
"python-helpers.rkt")
(define (desugar-core [e : CExp]) : UExp
(type-case CExp e
[CNum (n) (UNum n)]
[CStr (s) (UStr s)]
[CBool (b) (UBool b)]
[CDict (fs) (UMap (hash-map fs (lambda (k v) (pair (desugar-c... |
df7d8f4c5b34d434d9303f431421e54ef9a0adb9b5e41e06df3c04d069851d37 | atlas-engineer/nyxt | remembrance.lisp | SPDX - FileCopyrightText : Atlas Engineer LLC
SPDX - License - Identifier : BSD-3 - Clause
;; TODO: Find better name for "cached pages".
TODO : Compress content using montezuma : stored : compress ? Looks like
;; `montezuma::compress' is a no-op.
;; TODO: Note that field can be accessed programmatically too:... | null | https://raw.githubusercontent.com/atlas-engineer/nyxt/6a1e7be9859a5b157aa04cb9b9da31f3fccbc302/source/mode/remembrance.lisp | lisp | TODO: Find better name for "cached pages".
`montezuma::compress' is a no-op.
TODO: Note that field can be accessed programmatically too:
Not needed though?
TODO: Add tests for garbage collection, caching history, exact matches.
We superclass with `files:read-only-file' instead of `files:virtual-file'
because the... | SPDX - FileCopyrightText : Atlas Engineer LLC
SPDX - License - Identifier : BSD-3 - Clause
TODO : Compress content using montezuma : stored : compress ? Looks like
` - name ' , ` montezuma::all - fields ' , ` montezuma : field - data ' .
(nyxt:define-package :nyxt/remembrance-mode
(:documentation "M... |
cbb106ec4d4e93d5bf8f24fc9751e39496a4e8eba3bf0f10084b82f421407995 | electric-sql/vaxine | log_recovery_SUITE.erl | %% -------------------------------------------------------------------
%%
Copyright < 2013 - 2018 > <
Technische Universität Kaiserslautern , Germany
, France
Universidade NOVA de Lisboa , Portugal
Université catholique de Louvain ( UCL ) , Belgique
, Portugal
%% >
%%
This file is provided... | null | https://raw.githubusercontent.com/electric-sql/vaxine/872a83ea8d4935a52c7b850bb17ab099ee9c346b/apps/antidote/test/singledc/log_recovery_SUITE.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 expressed or implied. See the License for the
specific language governing perm... | Copyright < 2013 - 2018 > <
Technische Universität Kaiserslautern , Germany
, France
Universidade NOVA de Lisboa , Portugal
Université catholique de Louvain ( UCL ) , Belgique
, Portugal
This file is provided to you under the Apache License ,
except in compliance with the License . You... |
054b17c144123e99e4300d78fe653d8591c9f992a7be01895393af4af61defd4 | pascal-knodel/haskell-craft | E'4''9.hs | --
--
--
----------------
Exercise 4.9 .
----------------
--
--
--
module E'4''9 where
import E'4''1 ( maxThree )
import E'4''4 ( fourEqual , fourDifferent , threeEqualOfFour )
-- "maxThreeOccurs" with local definition(s):
---------------------------------------------
maxThreeOccurs :: Int -> Int -> Int -> (... | null | https://raw.githubusercontent.com/pascal-knodel/haskell-craft/c03d6eb857abd8b4785b6de075b094ec3653c968/_/links/E'4''9.hs | haskell |
--------------
--------------
"maxThreeOccurs" with local definition(s):
-------------------------------------------
Because maximum exists:
"maxThreeOccurs" without local definition(s):
----------------------------------------------
Because maximum exists:
Other solution for "occurs":
Other solution for "o... | Exercise 4.9 .
module E'4''9 where
import E'4''1 ( maxThree )
import E'4''4 ( fourEqual , fourDifferent , threeEqualOfFour )
maxThreeOccurs :: Int -> Int -> Int -> (Int , Int)
maxThreeOccurs a b c
= ( maximum , occurrences )
where
maximum :: Int
maximum = fromInteger (
ma... |
a4faae3f4a63782b938386e67f26a9a106e30d38cd0b5216dba6b62d15e78304 | dwango/fialyzer | bif.ml | open Mfa
let number = Type.(of_elem TyNumber)
let string = Type.(of_elem (TyList (of_elem TyNumber)))
let pid = Type.(of_elem TyPid)
let port = Type.(of_elem TyPort)
let reference = Type.(of_elem TyReference)
let binary = Type.(of_elem (TyBitstring (0, 8)))
let bitstring = Type.(of_elem (TyBitstring (0, 1)))
TODO
TODO... | null | https://raw.githubusercontent.com/dwango/fialyzer/3c4b4fc2dacf84008910135bfef16e4ce79f9c89/lib/bif.ml | ocaml | -------- unary op -----------
-------- lists --------------
-------- maps --------------
pid
port
reference
binary
bitstring | open Mfa
let number = Type.(of_elem TyNumber)
let string = Type.(of_elem (TyList (of_elem TyNumber)))
let pid = Type.(of_elem TyPid)
let port = Type.(of_elem TyPort)
let reference = Type.(of_elem TyReference)
let binary = Type.(of_elem (TyBitstring (0, 8)))
let bitstring = Type.(of_elem (TyBitstring (0, 1)))
TODO
TODO... |
b17efbfa4b14728ddf398a61be7fd17cc929e28fa421d681703873fa260c415d | nubank/ordnungsamt | close_open_prs.clj | (ns ordnungsamt.close-open-prs
(:require [clj-github.pull :as pull]
[clj-github.repository :as repository]))
(defn close-pr-and-delete-branch! [client org service pr]
(pull/close-pull! client org service (:number pr))
(repository/delete-reference! client org service (str "heads/" (pull/pull->branch-n... | null | https://raw.githubusercontent.com/nubank/ordnungsamt/e11379b914f652264a5e2b5860fe3447342c9e06/src/ordnungsamt/close_open_prs.clj | clojure | (ns ordnungsamt.close-open-prs
(:require [clj-github.pull :as pull]
[clj-github.repository :as repository]))
(defn close-pr-and-delete-branch! [client org service pr]
(pull/close-pull! client org service (:number pr))
(repository/delete-reference! client org service (str "heads/" (pull/pull->branch-n... | |
258530ee9ab35b533c042574a118a4a91f575e87a12d248288266a40acacdea6 | haskell-lisp/blaise | Eval.hs |
module Eval where
import Expression
import qualified Data.Map as Map
import Data.List
import Control.Monad.State
import Control.Monad.Error
-- Evaluating Lisp expression
eval :: Expr -> BlaiseResult
eval (BlaiseInt n) = return (BlaiseInt n)
eval (BlaiseFn f args) = return (BlaiseFn f args)
eval (BlaiseS... | null | https://raw.githubusercontent.com/haskell-lisp/blaise/17c75be05b6f6d2b2fff4774229ca733b2c5f0e3/src/Eval.hs | haskell | Evaluating Lisp expression
|
module Eval where
import Expression
import qualified Data.Map as Map
import Data.List
import Control.Monad.State
import Control.Monad.Error
eval :: Expr -> BlaiseResult
eval (BlaiseInt n) = return (BlaiseInt n)
eval (BlaiseFn f args) = return (BlaiseFn f args)
eval (BlaiseSpecial f args) = return (Blaise... |
263809c5eb0181f0cdec89e3510e95a2f57c6afe360e323a0b34f62f88df4bc0 | bobzhang/fan | gfailed.ml |
open Format
let pp = fprintf
let name_of_symbol (entry:Gdefs.entry) (x: Gdefs.symbol) =
match x with
| Nterm e -> "[" ^ e.name ^ "]"
| Snterml (e, l) -> "[" ^ e.name ^ " level " ^ string_of_int l ^ "]"
| Self -> "[" ^ entry.name ^ "]"
| Token p -> Tokenf.string_of_pattern p
(* | `Keyword k... | null | https://raw.githubusercontent.com/bobzhang/fan/7ed527d96c5a006da43d3813f32ad8a5baa31b7f/src/treeparser/gfailed.ml | ocaml | | `Keyword kwd -> "\"" ^ kwd ^ "\""
physical equivality
error message entrance
match tok with
| Token p ->
| `Keyword kwd -> kwd
[prev_symb_result] is cast by [Obj.magic]
it may not necessary fail when we use try somewhere
local variables:
compile-command: "pmake gfailed.cmo"
end: |
open Format
let pp = fprintf
let name_of_symbol (entry:Gdefs.entry) (x: Gdefs.symbol) =
match x with
| Nterm e -> "[" ^ e.name ^ "]"
| Snterml (e, l) -> "[" ^ e.name ^ " level " ^ string_of_int l ^ "]"
| Self -> "[" ^ entry.name ^ "]"
| Token p -> Tokenf.string_of_pattern p
| _ -> "???"
... |
27df0328b0ba458b83a6c27eaeea5cd7dec9f663c7cfa6942cd98d523839c4fe | spurious/chibi-scheme-mirror | bitwise.scm | ;; bitwise.scm -- high-level bitwise functions
Copyright ( c ) 2009 . All rights reserved .
;; BSD-style license:
(define (bitwise-not i) (- -1 i))
(define (bitwise-complement f) (lambda args (bitwise-not (apply f args))))
(define (make-nary proc2 default)
(lambda args
(if (null? args)
default
... | null | https://raw.githubusercontent.com/spurious/chibi-scheme-mirror/49168ab073f64a95c834b5f584a9aaea3469594d/lib/srfi/33/bitwise.scm | scheme | bitwise.scm -- high-level bitwise functions
BSD-style license: | Copyright ( c ) 2009 . All rights reserved .
(define (bitwise-not i) (- -1 i))
(define (bitwise-complement f) (lambda args (bitwise-not (apply f args))))
(define (make-nary proc2 default)
(lambda args
(if (null? args)
default
(let lp ((i (car args)) (ls (cdr args)))
(if (null? l... |
b4de9e3737f1757640cdea7ad0a71c74478b0dcf4e088d0b88cebb8e8203759b | emqx/emqx | emqx_authz_mongodb.erl | %%--------------------------------------------------------------------
Copyright ( c ) 2020 - 2023 EMQ Technologies Co. , Ltd. All Rights Reserved .
%%
Licensed under the Apache License , Version 2.0 ( the " License " ) ;
%% you may not use this file except in compliance with the License.
%% You may obtain a copy o... | null | https://raw.githubusercontent.com/emqx/emqx/394e8ab6a463580f02480e52cfbd876456cd2297/apps/emqx_authz/src/emqx_authz_mongodb.erl | erlang | --------------------------------------------------------------------
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
-2.0
Unless required by applicable law or agreed to in writing, software
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express ... | Copyright ( c ) 2020 - 2023 EMQ Technologies Co. , Ltd. All Rights Reserved .
Licensed under the Apache License , Version 2.0 ( the " License " ) ;
distributed under the License is distributed on an " AS IS " BASIS ,
-module(emqx_authz_mongodb).
-include("emqx_authz.hrl").
-include_lib("emqx/include/emqx.hrl").... |
f9bfa4f2c07b4660dab7a0095f1ee218fbf986dcc3e5ac2ceedcf5a5470203e6 | SquidDev/illuaminate | type_parser.ml | open Type_grammar
let show_token = function
| TRUE -> "true"
| NIL -> "nil"
| FUNCTION -> "function"
| FALSE -> "false"
| COMMA -> ","
| COLON -> ":"
| DOT -> "."
| DOTS -> "..."
| EQUALS -> "="
| SEMICOLON -> ";"
| PIPE -> "|"
| ASKING -> "?"
| OPAREN -> "("
| CPAREN -> ")"
| OBRACE -> "... | null | https://raw.githubusercontent.com/SquidDev/illuaminate/2a5a89cbac0f204eefa05db57de51b91e27ce3fe/src/semantics/type_parser.ml | ocaml | Should never happen, but... | open Type_grammar
let show_token = function
| TRUE -> "true"
| NIL -> "nil"
| FUNCTION -> "function"
| FALSE -> "false"
| COMMA -> ","
| COLON -> ":"
| DOT -> "."
| DOTS -> "..."
| EQUALS -> "="
| SEMICOLON -> ";"
| PIPE -> "|"
| ASKING -> "?"
| OPAREN -> "("
| CPAREN -> ")"
| OBRACE -> "... |
66a71fb858f9532e98c8f9052d0048bffe238f7edce150eda4dda426af75666c | HealthSamurai/dojo.clj | hotkeys.cljs | (ns zframes.hotkeys
(:require [re-frame.core :as rf]
[re-frame.db :as db]))
(defonce handlers (atom {"Slash" {:event ::help}}))
(rf/reg-event-fx
::help
(fn [& _]
(println @handlers)))
;; @handlers
(rf/reg-fx
:hotkey/init
(fn [opts]
(swap! handlers merge opts)
(.addEventListener
js/do... | null | https://raw.githubusercontent.com/HealthSamurai/dojo.clj/94922640f534897ab2b181c608b54bfbb8351d7b/ui/src/zframes/hotkeys.cljs | clojure | @handlers
(println "Add hotkey " opts)
(println "Clear hotkey " id) | (ns zframes.hotkeys
(:require [re-frame.core :as rf]
[re-frame.db :as db]))
(defonce handlers (atom {"Slash" {:event ::help}}))
(rf/reg-event-fx
::help
(fn [& _]
(println @handlers)))
(rf/reg-fx
:hotkey/init
(fn [opts]
(swap! handlers merge opts)
(.addEventListener
js/document
"k... |
f4666c363cb5fa04858781e7e7bfe4eadbac467d093c4ec9693076a5fb5a5800 | threatgrid/ctim | actor.cljc | (ns ctim.schemas.actor
(:require [ctim.schemas.common :as c]
[ctim.schemas.relationship :as rel]
[ctim.schemas.vocabularies :as v]
#?(:clj [flanders.core :as f :refer [def-entity-type def-eq]]
:cljs [flanders.core :as f :refer-macros [def-entity-type def-eq]])))
(d... | null | https://raw.githubusercontent.com/threatgrid/ctim/b9a617b49e82ec04cd69ea8354609aec1f892249/src/ctim/schemas/actor.cljc | clojure | Not provided: handling
Not provided: related_packages (deprecated) | (ns ctim.schemas.actor
(:require [ctim.schemas.common :as c]
[ctim.schemas.relationship :as rel]
[ctim.schemas.vocabularies :as v]
#?(:clj [flanders.core :as f :refer [def-entity-type def-eq]]
:cljs [flanders.core :as f :refer-macros [def-entity-type def-eq]])))
(d... |
540668b4b3f2e1728d326678b2a53162c6782813e490489837881446d4db6faf | openeuler-mirror/secGear | GenuntrustPL.ml |
* Copyright ( c ) IPADS@SJTU 2021 . Modification to support ( RISC - V TEE )
* Copyright ( c ) Huawei Technologies Co. , Ltd. 2020 . All rights reserved .
* secGear is licensed under the Mulan PSL v2 .
* You can use this software according to the terms and conditions of the Mulan PSL v2 .
* You may obta... | null | https://raw.githubusercontent.com/openeuler-mirror/secGear/1f5e804c28732c58b283ed8667688cf809bfc165/tools/codegener/penglai/GenuntrustPL.ml | ocaml |
* Copyright ( c ) IPADS@SJTU 2021 . Modification to support ( RISC - V TEE )
* Copyright ( c ) Huawei Technologies Co. , Ltd. 2020 . All rights reserved .
* secGear is licensed under the Mulan PSL v2 .
* You can use this software according to the terms and conditions of the Mulan PSL v2 .
* You may obta... | |
e0500023d51769b5f0ffcf53604317edd1d3e2efaad323eb030d4193a3aba928 | ciderpunx/57-exercises-for-programmers | P29InputSpec.hs | module P29InputSpec (main,spec) where
import Test.Hspec
import Test.Hspec.QuickCheck
import P29Input hiding (main)
main :: IO ()
main = hspec spec
spec :: Spec
spec = do
describe "expectedReturnOn" $ do
it "calculates the book example correctly" $ do
expectedReturnOn 4 `shouldBe` 18
| null | https://raw.githubusercontent.com/ciderpunx/57-exercises-for-programmers/25958ab80cc3edc29756d3bddd2d89815fd390bf/test/P29InputSpec.hs | haskell | module P29InputSpec (main,spec) where
import Test.Hspec
import Test.Hspec.QuickCheck
import P29Input hiding (main)
main :: IO ()
main = hspec spec
spec :: Spec
spec = do
describe "expectedReturnOn" $ do
it "calculates the book example correctly" $ do
expectedReturnOn 4 `shouldBe` 18
| |
e53172cadc3ce822c2af03b44b31bf705845f72e61c49b9c67d22e09022f290b | brick-lang/kiln | nodes.ml | (*
* This file holds information on the parser's
* internal tree representation, without context-based
* information, such as typing
*)
open Common
type 'a location = 'a Location.loc
(* To avoid confusion, the work 'variant' is used in
* this module to refer to the class of AST node,
* as the words 'type' and '... | null | https://raw.githubusercontent.com/brick-lang/kiln/21ec6fe8dfd2a807e514c9a794abbf48a7836ab3/frontend/parseTree/nodes.ml | ocaml |
* This file holds information on the parser's
* internal tree representation, without context-based
* information, such as typing
To avoid confusion, the work 'variant' is used in
* this module to refer to the class of AST node,
* as the words 'type' and 'class' are keywords in
* OCaml, and the word 'kind' i... | open Common
type 'a location = 'a Location.loc
module rec CoreType : sig
type t = {
variant : sort ;
location : Location.t;
}
and sort =
| Any
| Variable of string
| Literal of string
| Arrow of t * t
A tuple type is composed of 2 or more inner types
* ( T1 , ... , Tn ) | w... |
01db75bc58af3564ab0f53e5e555ca393a96cda7d5140363cfd3da3ff3ec8e02 | sdedovic/easings-clj | project.clj | (defproject com.dedovic/easings-clj "0.1.0"
:description ""
:url "-clj"
:license {:name "GNU General Public License v3.0"
:url "-3.0.en.html"}
:dependencies [[org.clojure/clojure "1.10.3"]]
:source-paths ["src/clj"]
:java-source-paths ["src/java"]
:resource-paths ["resources"]
:aot :all)
| null | https://raw.githubusercontent.com/sdedovic/easings-clj/f34781adb94a2d676b9c96a5230a3f49da92dea1/project.clj | clojure | (defproject com.dedovic/easings-clj "0.1.0"
:description ""
:url "-clj"
:license {:name "GNU General Public License v3.0"
:url "-3.0.en.html"}
:dependencies [[org.clojure/clojure "1.10.3"]]
:source-paths ["src/clj"]
:java-source-paths ["src/java"]
:resource-paths ["resources"]
:aot :all)
| |
06640edbfa66b148c49a826dd05a6635f36515bb0001b639ca8f336114eed771 | pilosus/pip-license-checker | spec.clj | Copyright © 2020 - 2023
;;
;; This program and the accompanying materials are made available under the
terms of the Eclipse Public License 2.0 which is available at
;; -2.0.
;;
This Source Code may also be made available under the following Secondary
Licenses when the conditions for such availability set fort... | null | https://raw.githubusercontent.com/pilosus/pip-license-checker/48bb57a59124333b0d28a6432ef9359c9ef07ee1/src/pip_license_checker/spec.clj | clojure |
This program and the accompanying materials are made available under the
-2.0.
Public License, v. 2.0 are satisfied: GNU General Public License as published by
(require '[pip-license-checker.spec :as sp])
Versions
Generators
| Copyright © 2020 - 2023
terms of the Eclipse Public License 2.0 which is available at
This Source Code may also be made available under the following Secondary
Licenses when the conditions for such availability set forth in the Eclipse
the Free Software Foundation , either version 2 of the License , or ( at... |
19a5f745dd761ceddf68b9a7a956697dce2f69b0af722ff2bd5177d3948f5b45 | michaelballantyne/syntax-spec | syntax-classes.rkt | #lang racket/base
(provide literal-in-space
~space-literal)
(require syntax/parse ee-lib
(for-syntax racket/base syntax/parse))
(define-syntax-class (literal-in-space target-id binding-space)
(pattern id:id
#:when (same-binding? ((in-space binding-space) (attribute id))
... | null | https://raw.githubusercontent.com/michaelballantyne/syntax-spec/feb32cfa10639067bb51d83aa48302580993020f/private/runtime/syntax-classes.rkt | racket | #lang racket/base
(provide literal-in-space
~space-literal)
(require syntax/parse ee-lib
(for-syntax racket/base syntax/parse))
(define-syntax-class (literal-in-space target-id binding-space)
(pattern id:id
#:when (same-binding? ((in-space binding-space) (attribute id))
... | |
e4e20cc44456b624bb118af7302616daa3cfc97062e5b5aacb69024e0aeb1b95 | soegaard/sketching | pmouse-x-and-y.rkt | #lang sketching
(define (draw)
(background 204)
(line 20 mouse-y 80 pmouse-y )
(displayln (~a mouse-y " : " pmouse-y)))
| null | https://raw.githubusercontent.com/soegaard/sketching/3773cb790ac69201c967201a2fa1727d90a4ad62/sketching-examples/reference-snippets/pmouse-x-and-y.rkt | racket | #lang sketching
(define (draw)
(background 204)
(line 20 mouse-y 80 pmouse-y )
(displayln (~a mouse-y " : " pmouse-y)))
| |
73305ca80350ccd52ee1a73cebf08026c56705db14f51e3e357241025e67680c | BranchTaken/Hemlock | test_of_array.ml | open! Basis.Rudiments
open! Basis
open Ordset
let test () =
let test ms = begin
let ordset = of_array (module Uns) ms in
File.Fmt.stdout
|> Fmt.fmt "of_array "
|> (Array.pp Uns.pp) ms
|> Fmt.fmt " -> "
|> fmt ordset
|> Fmt.fmt "\n"
|> ignore
end in
let test_arrays = [
[||];
... | null | https://raw.githubusercontent.com/BranchTaken/Hemlock/a21b462fe7f70475591d2ffae185c91552bf6372/bootstrap/test/basis/ordset/test_of_array.ml | ocaml | open! Basis.Rudiments
open! Basis
open Ordset
let test () =
let test ms = begin
let ordset = of_array (module Uns) ms in
File.Fmt.stdout
|> Fmt.fmt "of_array "
|> (Array.pp Uns.pp) ms
|> Fmt.fmt " -> "
|> fmt ordset
|> Fmt.fmt "\n"
|> ignore
end in
let test_arrays = [
[||];
... | |
a2d3915ab11c7912aba0f216474c0854bfedf03cd47d8653caf92733663015e2 | ocaml-sf/learn-ocaml-corpus | union3.ml | let empty : heap =
E
let rank (h : heap) : rank =
match h with
| E ->
0
| T (r, _, _, _) ->
r
let makeT x h1 h2 =
let r1 = rank h1
and r2 = rank h2 in
if r1 >= r2 then
T (r2 + 1, x, h1, h2)
else
T (r1 + 1, x, h2, h1)
let singleton (x : element) : heap =
makeT x empty empty
(* ... | null | https://raw.githubusercontent.com/ocaml-sf/learn-ocaml-corpus/7dcf4d72b49863a3e37e41b3c3097aa4c6101a69/exercises/fpottier/leftist_heaps/wrong/union3.ml | ocaml | T(1, x, E, E)
Drop some elements along the way. | let empty : heap =
E
let rank (h : heap) : rank =
match h with
| E ->
0
| T (r, _, _, _) ->
r
let makeT x h1 h2 =
let r1 = rank h1
and r2 = rank h2 in
if r1 >= r2 then
T (r2 + 1, x, h1, h2)
else
T (r1 + 1, x, h2, h1)
let singleton (x : element) : heap =
makeT x empty empty
let ... |
c5d872f945ec9acdf3c503d31114102ef3a5804db1215a8c92cf7c4ce8481e35 | HaskellEmbedded/data-stm32 | Extract.hs | {-# LANGUAGE OverloadedStrings #-}
# LANGUAGE FlexibleContexts #
module Extract where
import Turtle
import System.Exit
import Prelude hiding (FilePath)
import Control.Monad
import Data.Ord (comparing)
import qualified Data.List as L
import qualified Data.Map as Map
import Text.Regex.Posix
import Debug.Trace
import S... | null | https://raw.githubusercontent.com/HaskellEmbedded/data-stm32/204aff53eaae422d30516039719a6ec7522a6ab7/app/genstm/Extract.hs | haskell | # LANGUAGE OverloadedStrings #
extract all registers for peripheral `periph`
get merged register map (containing regs for all families) for specific peripheral
make a test of this (check if regName groups contain all devices)
print $ map length wtf
merge fields in respective registers grouped by register name.
i... | # LANGUAGE FlexibleContexts #
module Extract where
import Turtle
import System.Exit
import Prelude hiding (FilePath)
import Control.Monad
import Data.Ord (comparing)
import qualified Data.List as L
import qualified Data.Map as Map
import Text.Regex.Posix
import Debug.Trace
import Safe
import Data.SVD
import Utils
... |
8fad3f7098b85df6a23c44d814ec0d1aa1da073edabbc23a8e9c43714c31d0d9 | janestreet/accessor_base | set_tests.ml | open! Core
open! Import
module Bool_set = struct
include Accessor_test_helpers.Testable.Bool_set
module Nonempty = struct
type nonrec t = t [@@deriving compare, quickcheck, sexp_of]
let quickcheck_generator =
Quickcheck.Generator.filter quickcheck_generator ~f:(Fn.non Set.is_empty)
;;
let ... | null | https://raw.githubusercontent.com/janestreet/accessor_base/8384c29a37e557168ae8a43b2a5a531f0ffc16e4/test/fast/set_tests.ml | ocaml | [empty_default] is known and documented to not be well behaved. | open! Core
open! Import
module Bool_set = struct
include Accessor_test_helpers.Testable.Bool_set
module Nonempty = struct
type nonrec t = t [@@deriving compare, quickcheck, sexp_of]
let quickcheck_generator =
Quickcheck.Generator.filter quickcheck_generator ~f:(Fn.non Set.is_empty)
;;
let ... |
e30c88af9000eec2651d214d72167e7ece453264491b2d5c41755bd04f859411 | sionescu/iolib | event-loop.lisp | ;;;; -*- Mode: Lisp; indent-tabs-mode: nil -*-
;;;
;;; --- Main event loop.
;;;
(in-package :iolib/multiplex)
;;;-------------------------------------------------------------------------
;;; Classes and Types
;;;-------------------------------------------------------------------------
(defclass event-base ()
((mu... | null | https://raw.githubusercontent.com/sionescu/iolib/0e8ccf5226a013795dd5a1797637541df4719556/src/multiplex/event-loop.lisp | lisp | -*- Mode: Lisp; indent-tabs-mode: nil -*-
--- Main event loop.
-------------------------------------------------------------------------
Classes and Types
-------------------------------------------------------------------------
-------------------------------------------------------------------------
PRINT-OBJEC... |
(in-package :iolib/multiplex)
(defclass event-base ()
((mux :reader mux-of)
(fds :initform (make-hash-table :test 'eql)
:reader fds-of)
(timers :initform (make-priority-queue :key #'%timer-expire-time)
:reader timers-of)
(fd-timers :initform (make-priority-queue :key #'%timer-expire-ti... |
1971e7fdf2714cf387a65fca267e165fcf2c6ab6c574328986b1b087117cb71e | vivid-inc/ash-ra-template | to_phase_test.clj | ; Copyright 2020 Vivid Inc.
;
Licensed under the Apache License , Version 2.0 ( the " License " ) ;
; you may not use this file except in compliance with the License.
; You may obtain a copy of the License at
;
; -2.0
;
; Unless required by applicable law or agreed to in writing, software
distributed under the L... | null | https://raw.githubusercontent.com/vivid-inc/ash-ra-template/f64be7efd6f52ccd451cddb851f02511d1665b11/art-cli/test/vivid/art/cli/to_phase_test.clj | clojure | Copyright 2020 Vivid Inc.
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
-2.0
Unless required by applicable law or agreed to in writing, software
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the speci... | distributed under the License is distributed on an " AS IS " BASIS ,
(ns vivid.art.cli.to-phase-test
(:require
[clojure.string]
[clojure.test :refer :all]
[farolero.core :as farolero]
[vivid.art.cli.args]
[vivid.art.cli.usage]
[vivid.art.cli.validate :as validate]
[vivid.art.specs]))
... |
474912a2bb724596f96fc5627c387ed32ddb9a63d61ad5d2968adef2431e3b3c | alexandergunnarson/quantum | core.cljc | (ns quantum.untyped.net.core
(:require
[clojure.string :as str]
[quantum.untyped.core.system
#?@(:cljs [:refer [global]])])
#?(:clj
(:import
(java.net URLEncoder URLDecoder))))
(defn url-encode
"Returns `s` as an URL encoded string."
[s & [encoding]]
(when s
#?(:clj (-> (URLEncoder/en... | null | https://raw.githubusercontent.com/alexandergunnarson/quantum/0c655af439734709566110949f9f2f482e468509/src-untyped/quantum/untyped/net/core.cljc | clojure | (ns quantum.untyped.net.core
(:require
[clojure.string :as str]
[quantum.untyped.core.system
#?@(:cljs [:refer [global]])])
#?(:clj
(:import
(java.net URLEncoder URLDecoder))))
(defn url-encode
"Returns `s` as an URL encoded string."
[s & [encoding]]
(when s
#?(:clj (-> (URLEncoder/en... | |
67a4b3c6b9e51f57eb85b2b8d0797955f73e5fa8c2676e829c623f1dc2a87cd6 | well-typed/large-records | Show.hs | module Test.Record.Generic.Prop.Show (tests) where
import Data.Record.Generic.Show (gshowsPrec)
import Test.Tasty
import Test.Tasty.QuickCheck
import Test.Record.Generic.Infra.Examples
tests :: TestTree
tests = testGroup "Test.Record.Generic.Prop.Show" [
testProperty "show" prop_show
]
prop_show :: Simpl... | null | https://raw.githubusercontent.com/well-typed/large-records/fbc9d886094b7b40d6b89db72ff4c7fb59d5b903/large-generics/test/Test/Record/Generic/Prop/Show.hs | haskell | module Test.Record.Generic.Prop.Show (tests) where
import Data.Record.Generic.Show (gshowsPrec)
import Test.Tasty
import Test.Tasty.QuickCheck
import Test.Record.Generic.Infra.Examples
tests :: TestTree
tests = testGroup "Test.Record.Generic.Prop.Show" [
testProperty "show" prop_show
]
prop_show :: Simpl... | |
72138a68ca2748d35a7e44819cb5843ff1906a39198c3f32410393301e5d4ecc | HaskellZhangSong/Introduction_to_Haskell_2ed_source | StreamTest.hs | import Control.Monad.Stream
import Control.Monad
nats = return 0 `mplus` (nats >>= (return . (+1)))
natpair :: Stream (Int,Int)
natpair= do
i <- nats
j <- nats
return (i,j)
pythagorean_triples :: Stream (Int,Int,Int)
pythagorean_triples = do
i <- nats
guard $ i > 0
j <- nats
guard $ j... | null | https://raw.githubusercontent.com/HaskellZhangSong/Introduction_to_Haskell_2ed_source/140c50fdccfe608fe499ecf2d8a3732f531173f5/C14/StreamTest.hs | haskell | import Control.Monad.Stream
import Control.Monad
nats = return 0 `mplus` (nats >>= (return . (+1)))
natpair :: Stream (Int,Int)
natpair= do
i <- nats
j <- nats
return (i,j)
pythagorean_triples :: Stream (Int,Int,Int)
pythagorean_triples = do
i <- nats
guard $ i > 0
j <- nats
guard $ j... | |
7b4daad07c402ce0e00e0910e72286eb1bd3baf3d6b87704da18d901c666ba49 | cblp/crdt | Max.hs | module CRDT.Cv.Max
( Max (..)
, initial
, query
) where
import Data.Semigroup (Max (..))
-- | Construct new value
initial :: a -> Max a
initial = Max
query :: Max a -> a
query = getMax
| null | https://raw.githubusercontent.com/cblp/crdt/175d7ee7df66de1f013ee167ac31719752e0c20b/crdt/lib/CRDT/Cv/Max.hs | haskell | | Construct new value | module CRDT.Cv.Max
( Max (..)
, initial
, query
) where
import Data.Semigroup (Max (..))
initial :: a -> Max a
initial = Max
query :: Max a -> a
query = getMax
|
91b388885947c9b09055bf770b3a2753e7095d96ab11a93f100cf20721a0e976 | DSiSc/why3 | opt.mli | (********************************************************************)
(* *)
The Why3 Verification Platform / The Why3 Development Team
Copyright 2010 - 2018 -- Inria - CNRS - Paris - Sud University
(* ... | null | https://raw.githubusercontent.com/DSiSc/why3/8ba9c2287224b53075adc51544bc377bc8ea5c75/src/util/opt.mli | ocaml | ******************************************************************
This software is distributed under the terms of the GNU Lesser
on linking described in file LICENSE. ... | The Why3 Verification Platform / The Why3 Development Team
Copyright 2010 - 2018 -- Inria - CNRS - Paris - Sud University
General Public License version 2.1 , with the special exception
val inhabited : 'a option -> bool
val get : 'a option -> 'a
val get_exn : exn -> 'a option -> 'a
val g... |
4718c91da39f18a67e2a472b1f25f03390ed6d6da57f566849c06fbff8dec540 | ghc/testsuite | DfltProb2.hs |
module DfltProb2 where
NB : This program fails in GHC 7.4.1 but should be accepted with our new defaulting plan
f :: Int -> Bool
f x = const True (\y -> let w :: a -> a
w a = const a (y+1)
in w y)
{- The implication constraint we get here is that (y::beta):
... | null | https://raw.githubusercontent.com/ghc/testsuite/998a816ae89c4fd573f4abd7c6abb346cf7ee9af/tests/typecheck/should_compile/DfltProb2.hs | haskell | The implication constraint we get here is that (y::beta):
[untch=beta] forall a. 0 => Num beta
and we can't really do any defaulting in this scope.
Instead with our new defaulting plan we
(i) try to approximate the whole constraint
(ii) /then/ we try to default (and succeed)
(iii) ... |
module DfltProb2 where
NB : This program fails in GHC 7.4.1 but should be accepted with our new defaulting plan
f :: Int -> Bool
f x = const True (\y -> let w :: a -> a
w a = const a (y+1)
in w y)
|
594397c01ccca278a3473a12bde7f4d80ac8bcc0811c88482936f4be70f2d714 | jiangpengnju/htdp2e | ex187.rkt | The first three lines of this file were inserted by . They record metadata
;; about the language level of this file in a form that our tools can easily process.
#reader(lib "htdp-beginner-abbr-reader.ss" "lang")((modname ex187) (read-case-sensitive #t) (teachpacks ()) (htdp-settings #(#t constructor repeating-decima... | null | https://raw.githubusercontent.com/jiangpengnju/htdp2e/d41555519fbb378330f75c88141f72b00a9ab1d3/arbitrarily-large-data/composing-functions/ex187.rkt | racket | about the language level of this file in a form that our tools can easily process.
Design a program that sorts lists of email messages by date:
An Email Message is a structure
interpretation: (make-email f d m) represents text m sent by f, d seconds
after the beginning of time
Also develop a program that sort... | The first three lines of this file were inserted by . They record metadata
#reader(lib "htdp-beginner-abbr-reader.ss" "lang")((modname ex187) (read-case-sensitive #t) (teachpacks ()) (htdp-settings #(#t constructor repeating-decimal #f #t none #f () #f)))
(define-struct email [from date message])
( make - em... |
4e34ce188de37cc1c719ab4ed321f66775fcca90dabddbff6f316e4d2c76342f | HealthSamurai/bxb | match.cljc | (ns mappers.match
(:require [clojure.string :as str]))
(defn match
"Match against each pattern"
[x pattern]
(cond
(and (map? x) (map? pattern))
(loop [[[k v] & kvs] pattern]
(if (nil? k)
true
(when (match (get x k) v)
(recur kvs))))
(and (sequential? pattern)
... | null | https://raw.githubusercontent.com/HealthSamurai/bxb/2275b0b8498035e78f23608756465bba945522ec/src/mappers/match.cljc | clojure | (ns mappers.match
(:require [clojure.string :as str]))
(defn match
"Match against each pattern"
[x pattern]
(cond
(and (map? x) (map? pattern))
(loop [[[k v] & kvs] pattern]
(if (nil? k)
true
(when (match (get x k) v)
(recur kvs))))
(and (sequential? pattern)
... | |
423df65ab7e41645bf741b66afc07b4e1ceac9acb969925b6a31962d03af470d | achirkin/vulkan | Descriptor.hs | # OPTIONS_HADDOCK ignore - exports #
{-# LANGUAGE DataKinds #-}
# LANGUAGE FlexibleInstances #
# LANGUAGE GeneralizedNewtypeDeriving #
# LANGUAGE KindSignatures #
{-# LANGUAGE PatternSynonyms #-}
# LANGUAGE StandaloneDeriving #
{-# LANGUAGE Strict ... | null | https://raw.githubusercontent.com/achirkin/vulkan/b2e0568c71b5135010f4bba939cd8dcf7a05c361/vulkan-api/src-gen/Graphics/Vulkan/Types/Enum/Descriptor.hs | haskell | # LANGUAGE DataKinds #
# LANGUAGE PatternSynonyms #
# LANGUAGE Strict #
# LANGUAGE TypeSynonymInstances #
# INLINE showsPrec #
# INLINE readsPrec #
| bitpos = @0@
| Descriptor sets may be freed individually
| type = @enum@
| type = @enum@
<-extensions/html... | # OPTIONS_HADDOCK ignore - exports #
# LANGUAGE FlexibleInstances #
# LANGUAGE GeneralizedNewtypeDeriving #
# LANGUAGE KindSignatures #
# LANGUAGE StandaloneDeriving #
module Graphics.Vulkan.Types.Enum.Descriptor
(VkDescriptorBindingFlagBitsEXT(..),
VkDescriptorBindingBitm... |
66bf770178701dd453810409e54ba18ad6c5be81da78e02cd1cf047e8de26d78 | bobzhang/fan | epN.ml |
%import{
Fid:
xid
;
};;
open Astfn
open Astn_util
let of_str (s:string) : ep =
let len = String.length s in
if len = 0 then
invalid_arg "[exp|pat]_of_str len=0"
else
match s.[0] with
| '`'-> %ep-{ $vrn{ String.sub s 1 (len - 1)} }
| x when Charf.is_uppercase x -> %ep-{$uid:s}
| _ ->... | null | https://raw.githubusercontent.com/bobzhang/fan/7ed527d96c5a006da43d3813f32ad8a5baa31b7f/src/main/epN.ml | ocaml |
Example:
{[
mk_record ~arity:3 (Ctyp.list_of_record %ctyp{ u:int; v:mutable float } )
|> Ast2pt.print_pat f;
({ u = a0; v = a1 },{ u = b0; v = b1 },{ u = c0; v = c1 })
]}
local variables:
end: |
%import{
Fid:
xid
;
};;
open Astfn
open Astn_util
let of_str (s:string) : ep =
let len = String.length s in
if len = 0 then
invalid_arg "[exp|pat]_of_str len=0"
else
match s.[0] with
| '`'-> %ep-{ $vrn{ String.sub s 1 (len - 1)} }
| x when Charf.is_uppercase x -> %ep-{$uid:s}
| _ ->... |
c8ac74b6e4d6bd8b98266eed9f1cc949da741bb4a9ccb14e37b45675b2d15a26 | icicle-lang/x-ambiata | Toml.hs | # LANGUAGE NoImplicitPrelude #
{-# LANGUAGE RankNTypes #-}
module X.Text.Toml (
_NTValue
, _NTable
, _NTArray
, _VString
, _VInteger
, _VFloat
, _VBoolean
, _VDatetime
, _VArray
, key
) where
import Control.Applicative
import Control.Lens
import Data.Bool
import ... | null | https://raw.githubusercontent.com/icicle-lang/x-ambiata/532f8473084b24fb9d8c90fda7fee9858b9fbe30/x-htoml/src/X/Text/Toml.hs | haskell | # LANGUAGE RankNTypes # | # LANGUAGE NoImplicitPrelude #
module X.Text.Toml (
_NTValue
, _NTable
, _NTArray
, _VString
, _VInteger
, _VFloat
, _VBoolean
, _VDatetime
, _VArray
, key
) where
import Control.Applicative
import Control.Lens
import Data.Bool
import Data.Either
import ... |
806b61d98a3810522ccb4bbc82855f0a693361db5633a5cc791737978dfc4f1a | BitGameEN/bitgamex | egeoip_tests.erl | -module(egeoip_tests).
-include_lib("eunit/include/eunit.hrl").
-include("egeoip.hrl").
address_fast_test_() ->
[?_assertEqual(invalid_fast_address, egeoip:address_fast("1", 0, 24)),
?_assertEqual(16909060, egeoip:address_fast("1.2.3.4", 0, 24)),
?_assertEqual(3573612662, egeoip:address_fast("213.1.0.118... | null | https://raw.githubusercontent.com/BitGameEN/bitgamex/151ba70a481615379f9648581a5d459b503abe19/src/deps/egeoip/test/egeoip_tests.erl | erlang | We don't test all of them, just a few.
countrydb doesn't provide region info
recreate the non-parallelized version of egeoip and then verify
that the upgrade works.
Should upgrade when calling lookup | -module(egeoip_tests).
-include_lib("eunit/include/eunit.hrl").
-include("egeoip.hrl").
address_fast_test_() ->
[?_assertEqual(invalid_fast_address, egeoip:address_fast("1", 0, 24)),
?_assertEqual(16909060, egeoip:address_fast("1.2.3.4", 0, 24)),
?_assertEqual(3573612662, egeoip:address_fast("213.1.0.118... |
54b627fad63c1467b2e303f9590d0d17446d5bb54a4e3e956fb74c95635bd723 | re-path/studio | canvas.cljs | (ns repath.studio.tools.canvas
(:require [re-frame.core :as rf]
[repath.studio.tools.base :as tools]
[repath.studio.rulers.views :as rulers]
[clojure.string :as str]
[repath.studio.filters :as filters]
[repath.studio.elements.views :as elements]
... | null | https://raw.githubusercontent.com/re-path/studio/21003ae1408feca9d2ef7772c595731edf9b3880/src/repath/studio/tools/canvas.cljs | clojure | Enable keyboard events on the svg element | (ns repath.studio.tools.canvas
(:require [re-frame.core :as rf]
[repath.studio.tools.base :as tools]
[repath.studio.rulers.views :as rulers]
[clojure.string :as str]
[repath.studio.filters :as filters]
[repath.studio.elements.views :as elements]
... |
ecd72c88d5740d07439dbd94e95429ef17d757d5d67468ce22de35e60f0ea9c1 | reborg/clojure-essential-reference | 1.clj | < 1 >
;; nil
< 2 >
;; #{1 3 2 5}
(ns clojure.set) ; <3>
(load "zip") | null | https://raw.githubusercontent.com/reborg/clojure-essential-reference/c37fa19d45dd52b2995a191e3e96f0ebdc3f6d69/OtherFunctions/Evaluation/load%2Cload-file%2Cload-readerandload-string/1.clj | clojure | nil
#{1 3 2 5}
<3> | < 1 >
< 2 >
(load "zip") |
d8aad5f7863dc8e7e659c2333d148499923339d574b42264cf81318b612ab632 | gafiatulin/codewars | Church.hs | -- Church Numbers - Add, Multiply, Exponents
-- /
module Haskell.Codewars.Church where
type Lambda a = (a -> a)
type Cnum a = Lambda a -> Lambda a
churchAdd :: Cnum a -> Cnum a -> Cnum a
churchAdd c1 c2 f = c1 f . c2 f
churchMul :: Cnum a -> Cnum a -> Cnum a
churchMul c1 c2 = c1 . c2
churchPow :: Cnum a -> (Cnum a... | null | https://raw.githubusercontent.com/gafiatulin/codewars/535db608333e854be93ecfc165686a2162264fef/src/3%20kyu/Church.hs | haskell | Church Numbers - Add, Multiply, Exponents
/ |
module Haskell.Codewars.Church where
type Lambda a = (a -> a)
type Cnum a = Lambda a -> Lambda a
churchAdd :: Cnum a -> Cnum a -> Cnum a
churchAdd c1 c2 f = c1 f . c2 f
churchMul :: Cnum a -> Cnum a -> Cnum a
churchMul c1 c2 = c1 . c2
churchPow :: Cnum a -> (Cnum a -> Cnum a) -> Cnum a
churchPow cb ce = ce cb
|
7f536102ed54a65b8d5d2a07a2247fbe6bfff462af53be9267c17e726c67cb46 | facebookarchive/pfff | parse_lisp.ml |
*
* Copyright ( C ) 2010 Facebook
*
* This program is free software ; you can redistribute it and/or
* modify it under the terms of the GNU General Public License ( GPL )
* version 2 as published by the Free Software Foundation .
*
* This program is distributed in the hope that it will be us... | null | https://raw.githubusercontent.com/facebookarchive/pfff/ec21095ab7d445559576513a63314e794378c367/lang_lisp/parsing/parse_lisp.ml | ocaml | we don't need a full grammar for lisp code, so we put everything,
* the token type, the helper in parser_ml. No token_helpers_lisp.ml
***************************************************************************
Prelude
***************************************************************************
********************... |
*
* Copyright ( C ) 2010 Facebook
*
* This program is free software ; you can redistribute it and/or
* modify it under the terms of the GNU General Public License ( GPL )
* version 2 as published by the Free Software Foundation .
*
* This program is distributed in the hope that it will be us... |
ff93dbafc2f90b1c126cf3fabede28145d47d146e2fd3796687c2de256abb407 | typelead/eta | SCCfinal.hs | ( c ) The GRASP / AQUA Project , Glasgow University , 1992 - 1998
# LANGUAGE CPP #
-----------------------------------------------------------------------------
Modify and collect code generation for final STG program
This is now a sort - of - normal STG - to - STG pass ( WDP 94/06 ) , run by stg2stg .
- ... | null | https://raw.githubusercontent.com/typelead/eta/97ee2251bbc52294efbf60fa4342ce6f52c0d25c/compiler/Eta/Profiling/SCCfinal.hs | haskell | ---------------------------------------------------------------------------
lots of things
module name
unique supply
input
XXX do better
--------
--------
not tick
Trivial _scc_ around nothing but static data
careful: the binder might be :Main.main,
which doesn't belong to module mod_name.
Top-level (static) d... | ( c ) The GRASP / AQUA Project , Glasgow University , 1992 - 1998
# LANGUAGE CPP #
Modify and collect code generation for final STG program
This is now a sort - of - normal STG - to - STG pass ( WDP 94/06 ) , run by stg2stg .
- Traverses the STG program collecting the cost centres . These are required
... |
cbbf0a6ade501d06502b2636bbfbaa676c5390d877f768862a74b5a8edb40a45 | weldr/bdcs | Setup.hs | Copyright ( C ) 2018 Red Hat , Inc.
--
-- This 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 2.1 of the License , or ( at your option ) any later version .
--
-- This libr... | null | https://raw.githubusercontent.com/weldr/bdcs/cf360c3240644b4847336b9d58b2067f3aa1ec50/Setup.hs | haskell |
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU... | Copyright ( C ) 2018 Red Hat , Inc.
License as published by the Free Software Foundation ; either
version 2.1 of the License , or ( at your option ) any later version .
You should have received a copy of the GNU Lesser General Public
import Distribution.Simple
main = defaultMain
|
4567941490bbabc7fe30d89844d1cfb2ba949bc61d680b7f53b1d0ca9ab35171 | amperity/dialog | repl.clj | (ns dialog.repl
(:require
[clojure.java.io :as io]
[clojure.repl :refer :all]
[clojure.stacktrace :refer [print-cause-trace]]
[clojure.string :as str]
[clojure.tools.logging :as ctl]
[clojure.tools.namespace.repl :refer [refresh]]
[criterium.core :as crit]
[dialog.config :as config]
... | null | https://raw.githubusercontent.com/amperity/dialog/f810ef377526f0f4b941662774f22fe79414d95b/dev/dialog/repl.clj | clojure | (ns dialog.repl
(:require
[clojure.java.io :as io]
[clojure.repl :refer :all]
[clojure.stacktrace :refer [print-cause-trace]]
[clojure.string :as str]
[clojure.tools.logging :as ctl]
[clojure.tools.namespace.repl :refer [refresh]]
[criterium.core :as crit]
[dialog.config :as config]
... | |
5214c1e41a7d2d3227636cb8ee54842947c27318d7631b03fd084eb420872475 | xu-hao/QueryArrow | Utils.hs | # LANGUAGE PatternSynonyms #
module QueryArrow.Syntax.Utils where
import QueryArrow.Syntax.Term
import QueryArrow.Syntax.Type
import QueryArrow.Semantics.TypeChecker
import Control.Comonad.Cofree
import Data.Map.Strict (empty)
pattern PTKeyIO a = ParamType True True True False a
pattern PTKeyI a = ParamType True Tr... | null | https://raw.githubusercontent.com/xu-hao/QueryArrow/4dd5b8a22c8ed2d24818de5b8bcaa9abc456ef0d/QueryArrow-common/src/QueryArrow/Syntax/Utils.hs | haskell | # LANGUAGE PatternSynonyms #
module QueryArrow.Syntax.Utils where
import QueryArrow.Syntax.Term
import QueryArrow.Syntax.Type
import QueryArrow.Semantics.TypeChecker
import Control.Comonad.Cofree
import Data.Map.Strict (empty)
pattern PTKeyIO a = ParamType True True True False a
pattern PTKeyI a = ParamType True Tr... | |
421717893132f2dd44671e6489c20eb4ea33e8d2cfa0da544273cb589f89ac22 | spell-music/csound-expression | OSC.hs | module Csound.Typed.Opcode.OSC (
oscInit, oscListen, oscRaw, oscSend) where
import Control.Monad.Trans.Class
import Csound.Dynamic
import Csound.Typed
--
-- |
Start a listening process for OSC messages to a particular port .
--
-- Starts a listening process, which can be used by OSClisten.
--
... | null | https://raw.githubusercontent.com/spell-music/csound-expression/29c1611172153347b16d0b6b133e4db61a7218d5/csound-expression-opcodes/src/Csound/Typed/Opcode/OSC.hs | haskell |
|
Starts a listening process, which can be used by OSClisten.
> ihandle OSCinit iport
csound doc: <>
|
Listen for OSC messages to a particular path.
a given path of a given type.
csound doc: <>
|
Listen for all OSC messages at a given port.
at a given port and copies its contents to... | module Csound.Typed.Opcode.OSC (
oscInit, oscListen, oscRaw, oscSend) where
import Control.Monad.Trans.Class
import Csound.Dynamic
import Csound.Typed
Start a listening process for OSC messages to a particular port .
oscInit :: D -> SE D
oscInit b1 = fmap ( D . return) $ SE $ (depT =<<) $ lift ... |
0cd38e4c485f9da3bd7d1bb828b3e42a64165782e419be595878164177259faf | johnlawrenceaspden/hobby-code | somacs.clj | (defmacro test-macro
[& args]
`(println (str "count=" ~(count args) "; args=" ~@args)))
(defn test-fn-calling-macro
[& args]
(test-macro args))
(defn test-fn-expanding-macro-at-runtime
[& args]
(eval (cons `test-macro args)))
(defmacro test-macro-expanding-macro-at-compile-time
[& args]
(cons `test-macro... | null | https://raw.githubusercontent.com/johnlawrenceaspden/hobby-code/48e2a89d28557994c72299962cd8e3ace6a75b2d/somacs.clj | clojure | using the backquote and splicing notation
args = abc nil
count=1; args=("a" "b" "c") nil
args = abc nil
args = abc nil
args = abc nil
args = abc nil | (defmacro test-macro
[& args]
`(println (str "count=" ~(count args) "; args=" ~@args)))
(defn test-fn-calling-macro
[& args]
(test-macro args))
(defn test-fn-expanding-macro-at-runtime
[& args]
(eval (cons `test-macro args)))
(defmacro test-macro-expanding-macro-at-compile-time
[& args]
(cons `test-macro... |
f6ffc36519c21d3d2dd0318eb3261a79a27b6a0eff4dfc1bf256b5b5e4a0d6f9 | Clojure2D/clojure2d-examples | aabb.clj | (ns rt4.the-next-week.ch05e.aabb
(:require [rt4.the-next-week.ch05e.interval :as interval]
[fastmath.vector :as v]
[fastmath.core :as m])
(:import [fastmath.vector Vec3]))
(set! *warn-on-reflection* true)
(set! *unchecked-math* :warn-on-boxed)
(m/use-primitive-operators)
(defprotocol AABBP... | null | https://raw.githubusercontent.com/Clojure2D/clojure2d-examples/ead92d6f17744b91070e6308157364ad4eab8a1b/src/rt4/the_next_week/ch05e/aabb.clj | clojure | (ns rt4.the-next-week.ch05e.aabb
(:require [rt4.the-next-week.ch05e.interval :as interval]
[fastmath.vector :as v]
[fastmath.core :as m])
(:import [fastmath.vector Vec3]))
(set! *warn-on-reflection* true)
(set! *unchecked-math* :warn-on-boxed)
(m/use-primitive-operators)
(defprotocol AABBP... | |
b46c962e78ecfc581e26250ba478f305951f7097a464adfb0e5b56a862e8960a | racket/typed-racket | projections.rkt | #;#;
#<<END
TR opt: projections.rkt 10:0 (abs -0.0) -- unary float
TR opt: projections.rkt 11:0 (magnitude -0.0) -- unary float
TR opt: projections.rkt 2:0 (real-part 1) -- unary number
TR opt: projections.rkt 3:0 (imag-part 2) -- unary number
TR opt: projections.rkt 4:0 (abs 3) -- unary number
TR opt: projections.rkt ... | null | https://raw.githubusercontent.com/racket/typed-racket/0236151e3b95d6d39276353cb5005197843e16e4/typed-racket-test/optimizer/tests/projections.rkt | racket | #; | #<<END
TR opt: projections.rkt 10:0 (abs -0.0) -- unary float
TR opt: projections.rkt 11:0 (magnitude -0.0) -- unary float
TR opt: projections.rkt 2:0 (real-part 1) -- unary number
TR opt: projections.rkt 3:0 (imag-part 2) -- unary number
TR opt: projections.rkt 4:0 (abs 3) -- unary number
TR opt: projections.rkt 5:0 (... |
c41032de7dea5413c9a26e64e945c3a5bd98fefbbeddad6e4a580076588ce5fe | I3ck/HGE2D | GlFunctions.hs | -- |
-- Module : HGE2D.GlFunctions
Copyright : ( c ) 2016
-- License : see LICENSE
--
-- Containing functions used to interact with OpenGL
module HGE2D.GlFunctions where
import HGE2D.Types
import HGE2D.Datas
import HGE2D.Geometry
import qualified Graphics.Rendering.OpenGL as GL
-----------------... | null | https://raw.githubusercontent.com/I3ck/HGE2D/7ab789964013d8f24cd0be9fbad967d41d00a4bb/src/HGE2D/GlFunctions.hs | haskell | |
Module : HGE2D.GlFunctions
License : see LICENSE
Containing functions used to interact with OpenGL
------------------------------------------------------------------------------
| Renders a RGBA color
| Adds an alpha value to a RGB color, turning it into a RGBA color
--------------------------------... | Copyright : ( c ) 2016
module HGE2D.GlFunctions where
import HGE2D.Types
import HGE2D.Datas
import HGE2D.Geometry
import qualified Graphics.Rendering.OpenGL as GL
| Renders a RGB color
colorRGB :: GlColorRGB -> IO ()
colorRGB (r, g, b) = GL.color $ col3 r g b
where
col3 :: GL.GLfloat -> GL.GLfloat... |
00475fbca718231699320d9a6c27a420eca5d1201437c1493b0520567a340485 | CoNarrative/precept | lang_test.clj | (ns precept.lang-test
(:require [clojure.test :refer [deftest is testing run-tests]]
[precept.spec.lang :as lang]
[clojure.spec.alpha :as s]
[clojure.spec.gen.alpha :as gen]))
(deftest lang-test
(testing "Variable binding"
(is (s/valid? ::lang/variable-binding '?foo)... | null | https://raw.githubusercontent.com/CoNarrative/precept/6078286cae641b924a2bffca4ecba19dcc304dde/test/clj/precept/lang_test.clj | clojure | (gen/generate (s/gen ::lang/variable-binding))
(gen/generate (s/gen ::lang/s-expr))
(gen/generate (s/gen ::lang/test-expr))
(gen/generate (s/gen ::lang/value-expr))
(gen/generate (s/gen ::lang/accum-expr))
(gen/generate (s/gen ::lang/tuple)) | (ns precept.lang-test
(:require [clojure.test :refer [deftest is testing run-tests]]
[precept.spec.lang :as lang]
[clojure.spec.alpha :as s]
[clojure.spec.gen.alpha :as gen]))
(deftest lang-test
(testing "Variable binding"
(is (s/valid? ::lang/variable-binding '?foo)... |
93563ca0978e27ab77ae47b8af0c1a4ca380e7aaf12bbd6fa0e84b0c22697c2f | emqx/mria | mria_node.erl | %%--------------------------------------------------------------------
Copyright ( c ) 2019 EMQ Technologies Co. , Ltd. All Rights Reserved .
%%
Licensed under the Apache License , Version 2.0 ( the " License " ) ;
%% you may not use this file except in compliance with the License.
%% You may obtain a copy of the L... | null | https://raw.githubusercontent.com/emqx/mria/3d3b4e2a4da140ad72f85e466ea8cbdbb1f8f72b/src/mria_node.erl | erlang | --------------------------------------------------------------------
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
-2.0
Unless required by applicable law or agreed to in writing, software
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express ... | Copyright ( c ) 2019 EMQ Technologies Co. , Ltd. All Rights Reserved .
Licensed under the Apache License , Version 2.0 ( the " License " ) ;
distributed under the License is distributed on an " AS IS " BASIS ,
-module(mria_node).
-export([ is_aliving/1
, is_running/1
]).
-spec(is_aliving(node()... |
ee2c22bebec1cf2426ee2dfe505d21c9ae8917a8bcadede6ca596ec39a52d1c9 | jasonstolaruk/CurryMUD | Pause.hs | {-# LANGUAGE NamedFieldPuns, OverloadedStrings #-}
module Mud.Interp.Pause (pause) where
import Mud.Data.State.ActionParams.ActionParams
import Mud.Data.State.MsgQueue
import Mud.Data.State.MudData
import Mud.Data.State.Util.Misc
import Mud.Data.State.Util.Output
import Mud.Interp.Misc
import Mud.Misc.ANSI
import Mud... | null | https://raw.githubusercontent.com/jasonstolaruk/CurryMUD/f9775fb3ede08610f33f27bb1fb5fc0565e98266/lib/Mud/Interp/Pause.hs | haskell | # LANGUAGE NamedFieldPuns, OverloadedStrings #
================================================== |
module Mud.Interp.Pause (pause) where
import Mud.Data.State.ActionParams.ActionParams
import Mud.Data.State.MsgQueue
import Mud.Data.State.MudData
import Mud.Data.State.Util.Misc
import Mud.Data.State.Util.Output
import Mud.Interp.Misc
import Mud.Misc.ANSI
import Mud.Util.Quoting
import Data.Maybe (fromMaybe)
paus... |
aeca3dd97e6b1b319dc8148dc8f62fc2ae12b39a2f2f922be5d322b81776796f | dfinity/motoko | async.mli | (* lower uses of async type appropriately *)
open Ir_def
val transform : Ir.prog -> Ir.prog
| null | https://raw.githubusercontent.com/dfinity/motoko/26c229ad2b6305e15740eb718aa1caf1329f9afd/src/ir_passes/async.mli | ocaml | lower uses of async type appropriately | open Ir_def
val transform : Ir.prog -> Ir.prog
|
175de332b96df14462cafed99434ba84fa300e380db5761b6f70de107f5a5320 | chaoxu/fancy-walks | 1.hs |
problem_1 = sum $ filter (\r -> (r `mod` 3) == 0 || (r `mod` 5) == 0) [1..999]
main = print problem_1
| null | https://raw.githubusercontent.com/chaoxu/fancy-walks/952fcc345883181144131f839aa61e36f488998d/projecteuler.net/1.hs | haskell |
problem_1 = sum $ filter (\r -> (r `mod` 3) == 0 || (r `mod` 5) == 0) [1..999]
main = print problem_1
| |
d06bc1ebfaf409513ccbaad6438c166502581ee223e55b2f13e0e96874de6058 | namin/metamk | mk.scm | newer version : Sept. 18 2013 ( with eigens )
, , and
;;; E = (e* . x*)*, where e* is a list of eigens and x* is a list of variables.
;;; Each e in e* is checked for any of its eigens be in any of its x*. Then it fails.
;;; Since eigen-occurs-check is chasing variables, we might as will do a memq instead
;;;... | null | https://raw.githubusercontent.com/namin/metamk/8a6084888c87444a84f18cf6e470456837b75cfc/mk.scm | scheme | E = (e* . x*)*, where e* is a list of eigens and x* is a list of variables.
Each e in e* is checked for any of its eigens be in any of its x*. Then it fails.
Since eigen-occurs-check is chasing variables, we might as will do a memq instead
of an eq? when an eigen is found through a chain of walks. See eigen-occur... | newer version : Sept. 18 2013 ( with eigens )
, , and
abandons E , if it succeeds . If there is no failure by then , there were no eigen
(define sort list-sort)
(define empty-c '(() () () () () () ()))
(define eigen-tag (vector 'eigen-tag))
(define-syntax inc
(syntax-rules ()
((_ e) (lambdaf@ ()... |
c9e18661afea5817e436c4425b1ad3ba63baec93206f8710a7d0751fe89b4622 | janestreet/base_quickcheck | with_basic_types.ml | open! Base
module type S_bigarray = sig
(** This helper module type exists separately just to [open Bigarray] in its scope. *)
open Bigarray
type 'a t
val bigstring : (char, int8_unsigned_elt, c_layout) Array1.t t
val float32_vec : (float, float32_elt, fortran_layout) Array1.t t
val float64_vec : (float,... | null | https://raw.githubusercontent.com/janestreet/base_quickcheck/b3dc5bda5084253f62362293977e451a6c4257de/src/with_basic_types.ml | ocaml | * This helper module type exists separately just to [open Bigarray] in its scope. | open! Base
module type S_bigarray = sig
open Bigarray
type 'a t
val bigstring : (char, int8_unsigned_elt, c_layout) Array1.t t
val float32_vec : (float, float32_elt, fortran_layout) Array1.t t
val float64_vec : (float, float64_elt, fortran_layout) Array1.t t
val float32_mat : (float, float32_elt, fortran... |
edd8aee96af4b0f54c671c2ea64e9207654ecae55768af978c0e56ae51c7116f | mbj/stratosphere | DataCellsFilterResourceProperty.hs | module Stratosphere.LakeFormation.PrincipalPermissions.DataCellsFilterResourceProperty (
DataCellsFilterResourceProperty(..),
mkDataCellsFilterResourceProperty
) where
import qualified Data.Aeson as JSON
import qualified Stratosphere.Prelude as Prelude
import Stratosphere.Property
import Stratospher... | null | https://raw.githubusercontent.com/mbj/stratosphere/c70f301715425247efcda29af4f3fcf7ec04aa2f/services/lakeformation/gen/Stratosphere/LakeFormation/PrincipalPermissions/DataCellsFilterResourceProperty.hs | haskell | module Stratosphere.LakeFormation.PrincipalPermissions.DataCellsFilterResourceProperty (
DataCellsFilterResourceProperty(..),
mkDataCellsFilterResourceProperty
) where
import qualified Data.Aeson as JSON
import qualified Stratosphere.Prelude as Prelude
import Stratosphere.Property
import Stratospher... | |
6c47cdf08e75d310427b065dd164df79841b8554b2c7954166c093ae99f12446 | yaru22/problem-solving | problem29.hs | -- How many distinct terms are in the sequence generated by a^b for
2 < = a < = 100 and 2 < = b < = 100 ?
import Data.Set
solve :: Int
solve = size . fromList $ [a ^ b | a <- [2..100], b <- [2..100]]
main :: IO ()
main = print solve
| null | https://raw.githubusercontent.com/yaru22/problem-solving/33cd299d6d3dd1de2378f8a42e99a8a17b4a3c5d/project-euler/problem29.hs | haskell | How many distinct terms are in the sequence generated by a^b for | 2 < = a < = 100 and 2 < = b < = 100 ?
import Data.Set
solve :: Int
solve = size . fromList $ [a ^ b | a <- [2..100], b <- [2..100]]
main :: IO ()
main = print solve
|
8d1f1c6f76500c8958680ef9434796809c5e6b3143438da75c0757301054fbe9 | seantempesta/expo-cljs-template | project.clj | (defproject expo/lein-template "0.34.0"
:description "Expo template for Clojurescript."
:url "-cljs-template"
:license {:name "Eclipse Public License"
:url "-v10.html"}
:eval-in-leiningen true)
| null | https://raw.githubusercontent.com/seantempesta/expo-cljs-template/fb85abad30b000c24bb25f430b4f84ccae243cd4/project.clj | clojure | (defproject expo/lein-template "0.34.0"
:description "Expo template for Clojurescript."
:url "-cljs-template"
:license {:name "Eclipse Public License"
:url "-v10.html"}
:eval-in-leiningen true)
| |
d78b39f8862f2cb98c073a7c0a8a98e524e44a8fb913c490e1d7f5b9b20fad85 | babashka/nbb | js_interop.cljs | (ns nbb.impl.js-interop
(:require
[nbb.core :as nbb]
[sci.configs.applied-science.js-interop :as j]))
(defn init []
(nbb/register-plugin!
::js-interop
{:namespaces {'applied-science.js-interop j/js-interop-namespace}}))
| null | https://raw.githubusercontent.com/babashka/nbb/17bc2d31b0d34483e99e9b899305cf3b954e3263/src/nbb/impl/js_interop.cljs | clojure | (ns nbb.impl.js-interop
(:require
[nbb.core :as nbb]
[sci.configs.applied-science.js-interop :as j]))
(defn init []
(nbb/register-plugin!
::js-interop
{:namespaces {'applied-science.js-interop j/js-interop-namespace}}))
| |
050e10f867f8b977b1d15a3e2f7b87f7c6feba5ba43b7476485aff3b0e741a44 | NorfairKing/dekking | Foobar.hs | # LANGUAGE DeriveGeneric #
module Foobar where
import Data.Validity
import GHC.Generics (Generic)
data Example = Example
{ exampleString :: String,
exampleInt :: Int
}
deriving (Show, Eq, Generic)
instance Validity Example
printExample :: Example -> IO ()
printExample = print
| null | https://raw.githubusercontent.com/NorfairKing/dekking/c6d50036ac44ff7f3c83e19291cbd3a9fff64ae0/e2e-test/foobar/src/Foobar.hs | haskell | # LANGUAGE DeriveGeneric #
module Foobar where
import Data.Validity
import GHC.Generics (Generic)
data Example = Example
{ exampleString :: String,
exampleInt :: Int
}
deriving (Show, Eq, Generic)
instance Validity Example
printExample :: Example -> IO ()
printExample = print
| |
505c263dabfed7cac7b32c426a8ec2bb53820cc3ceffd767989018e57aa51661 | ocsigen/obrowser | oo.mli | (***********************************************************************)
(* *)
(* Objective Caml *)
(* *)
, projet Cri... | null | https://raw.githubusercontent.com/ocsigen/obrowser/977c09029ea1e4fde4fb0bf92b4d893835bd9504/rt/caml/oo.mli | ocaml | *********************************************************************
Objective Caml
... | , projet Cristal , INRIA Rocquencourt
Copyright 1996 Institut National de Recherche en Informatique et
en Automatique . All rights reserved . This file is distributed
under the terms of the GNU Library General Public License , with
$ I d : oo.mli 6331 2004 - 05 - 26 11:10... |
c453f5a907b518e7b5d8e0556cde209834453cb0a195ed3db7027df8b9990d10 | foshardware/lsc | BinarySearch.hs | Copyright 2018 - < >
SPDX - License - Identifier : GPL-3.0 - or - later
# LANGUAGE TypeApplications #
module Spec.LSC.BinarySearch where
import Data.Foldable
import Data.List (sort)
import Test.Tasty
import Test.Tasty.HUnit
import Test.Tasty.QuickCheck
import LSC.BinarySearch
import LSC.Entropy hiding (Gen)... | null | https://raw.githubusercontent.com/foshardware/lsc/006c245a89b0a0056286205917438c7d031d04b9/test/Spec/LSC/BinarySearch.hs | haskell | Copyright 2018 - < >
SPDX - License - Identifier : GPL-3.0 - or - later
# LANGUAGE TypeApplications #
module Spec.LSC.BinarySearch where
import Data.Foldable
import Data.List (sort)
import Test.Tasty
import Test.Tasty.HUnit
import Test.Tasty.QuickCheck
import LSC.BinarySearch
import LSC.Entropy hiding (Gen)... | |
55931b896d1575a8eaf79c18b04ab65f9214330b4db0d5cfb51b107450253812 | haskell-opengl/OpenGLRaw | Core31.hs | # LANGUAGE PatternSynonyms #
--------------------------------------------------------------------------------
-- |
Module : Graphics .
Copyright : ( c ) 2019
-- License : BSD3
--
Maintainer : < >
-- Stability : stable
-- Portability : portable
--
-----------------------------------... | null | https://raw.githubusercontent.com/haskell-opengl/OpenGLRaw/57e50c9d28dfa62d6a87ae9b561af28f64ce32a0/src/Graphics/GL/Core31.hs | haskell | ------------------------------------------------------------------------------
|
License : BSD3
Stability : stable
Portability : portable
------------------------------------------------------------------------------
* Types
* Enums
* Functions | # LANGUAGE PatternSynonyms #
Module : Graphics .
Copyright : ( c ) 2019
Maintainer : < >
module Graphics.GL.Core31 (
GLbitfield,
GLboolean,
GLbyte,
GLchar,
GLclampd,
GLclampf,
GLdouble,
GLenum,
GLfloat,
GLhalf,
GLint,
GLintptr,
GLshort,
GLsizei,
GLsizeiptr,
... |
1b6f283c5a13e23720792def25938e1b404134b173a5036c36abf3586f4f4bf5 | ngrunwald/gavagai | core.clj | (ns gavagai.core
(:require [clojure.string :as str]
[lazymap.core :as lz]
[clojure.set :as set])
(:import [java.beans Introspector]
[java.lang.reflect Method]
[java.util.regex Pattern]
[java.util HashSet]))
(declare translate)
(defrecord Translator [registr... | null | https://raw.githubusercontent.com/ngrunwald/gavagai/5208cd6fce671da600c4983f5fb8920599a5048a/src/gavagai/core.clj | clojure | mark ref | (ns gavagai.core
(:require [clojure.string :as str]
[lazymap.core :as lz]
[clojure.set :as set])
(:import [java.beans Introspector]
[java.lang.reflect Method]
[java.util.regex Pattern]
[java.util HashSet]))
(declare translate)
(defrecord Translator [registr... |
67f5aa6e1dcd324b68f0e11bce8e12f8d3577f412eb521d589afeedb26fb5ded | gfngfn/otfed | testCaseName1.ml |
open! Otfed__Basic
module Value = Otfed__Value
let marshaled =
TestUtil.make_string_even [
` lmroman10-regular.otf ` ( offset : 0x180 , length : ` 0x646 )
0x0000; 0x0015; 0x0102; 0x0001; 0x0000; 0x0000; 0x0000; 0x00cf;
0x0000; 0x0001; 0x0000; 0x0000; 0x0001; 0x0012; 0x00cf; 0x0001;
0x0000; 0x0000; 0x... | null | https://raw.githubusercontent.com/gfngfn/otfed/3c6d8ea0b05fc18a48cb423451da7858bf73d1d0/test/testCaseName1.ml | ocaml | Copyright notice
Font Subfamily name
Unique font identifier
Full font name
Version string
PostScript name for the font
Trademark
Copyright notice
Font Subfamily name
Unique font identifier
Full font name
Version string
PostScript name for the font
Trademark |
open! Otfed__Basic
module Value = Otfed__Value
let marshaled =
TestUtil.make_string_even [
` lmroman10-regular.otf ` ( offset : 0x180 , length : ` 0x646 )
0x0000; 0x0015; 0x0102; 0x0001; 0x0000; 0x0000; 0x0000; 0x00cf;
0x0000; 0x0001; 0x0000; 0x0000; 0x0001; 0x0012; 0x00cf; 0x0001;
0x0000; 0x0000; 0x... |
e25c4fec69929c644489d9c5396d1de7922f61f6dfd2bc9b8dff69c73602ae3c | weavejester/ring-reload-modified | tracker.clj | (ns ring.util.tracker
"Keeping track of which namespaces have changed and need to be reloaded"
(:use [ring.util.dependency :only (graph depend dependents remove-key)]
[ring.util.nsdeps :only (deps-from-ns-decl)]
[clojure.tools.namespace :only (find-clojure-sources-in-dir
re... | null | https://raw.githubusercontent.com/weavejester/ring-reload-modified/efe0b26287226baedb99446e064519971e292bfe/src/ring/util/tracker.clj | clojure | (ns ring.util.tracker
"Keeping track of which namespaces have changed and need to be reloaded"
(:use [ring.util.dependency :only (graph depend dependents remove-key)]
[ring.util.nsdeps :only (deps-from-ns-decl)]
[clojure.tools.namespace :only (find-clojure-sources-in-dir
re... | |
b3d616a9201c135188a26097469560e2c623038fef127eae7f4caf95dc5f6d64 | LesleyLai/ocamlpt | perlin.ml | open Base
let points_count = 256
type t = {
ranfloat: float array;
perm_x: int array;
perm_y: int array;
perm_z: int array;
}
let permute p n =
Sequence.range ~start:`inclusive ~stop:`exclusive (n-1) 0
|> Sequence.iter ~f:(fun i ->
let target = Random.int i in
Array.swap p i target
)
let... | null | https://raw.githubusercontent.com/LesleyLai/ocamlpt/65c72fc473e98e1fe802b25807dc74a19a6a3d3e/lib/perlin.ml | ocaml | open Base
let points_count = 256
type t = {
ranfloat: float array;
perm_x: int array;
perm_y: int array;
perm_z: int array;
}
let permute p n =
Sequence.range ~start:`inclusive ~stop:`exclusive (n-1) 0
|> Sequence.iter ~f:(fun i ->
let target = Random.int i in
Array.swap p i target
)
let... | |
9c95240e4940feefd8478da67900350b5ccc93583702b16233bda06506847f5e | SquircleSpace/shcl | working-directory.lisp | Copyright 2017
;;
Licensed under the Apache License , Version 2.0 ( the " License " ) ;
;; you may not use this file except in compliance with the License.
;; You may obtain a copy of the License at
;;
;; -2.0
;;
;; Unless required by applicable law or agreed to in writing, software
distributed under the Li... | null | https://raw.githubusercontent.com/SquircleSpace/shcl/cc8d3c841b8b64b6715bf8f238fb19cd6093a793/core/working-directory.lisp | lisp |
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
-2.0
Unless required by applicable law or agreed to in writing, software
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing per... | Copyright 2017
distributed under the License is distributed on an " AS IS " BASIS ,
(defpackage :shcl/core/working-directory
(:use :common-lisp :bordeaux-threads :shcl/core/utility
:shcl/core/fd-table :shcl/core/posix-types :shcl/core/posix
:shcl/core/support :shcl/core/shell-environment)
(:e... |
24f9a307ea5f658b85d132a2188b25184dcd247f8a34d01747981d57b1e6f241 | Eonblast/Scalaxis | tester_scheduler.erl | 2010 fuer Informationstechnik Berlin
% @end
%
Licensed under the Apache License , Version 2.0 ( the " License " ) ;
% you may not use this file except in compliance with the License.
% You may obtain a copy of the License at
%
% -2.0
%
% Unless required by applicable law or agreed to in writin... | null | https://raw.githubusercontent.com/Eonblast/Scalaxis/10287d11428e627dca8c41c818745763b9f7e8d4/test/tester_scheduler.erl | erlang | @end
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
-2.0
Unless required by applicable law or agreed to in writing, software
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific lang... | 2010 fuer Informationstechnik Berlin
Licensed under the Apache License , Version 2.0 ( the " License " ) ;
distributed under the License is distributed on an " AS IS " BASIS ,
@author < >
Created : 4 Feb 2011 by < >
-module(tester_scheduler).
-author('').
-vsn('$Id$').
-export([
... |
c851bccab2c0bd12ed1741264207a89676d411ee2611d2be390a9a868aef75c1 | dhleong/wish | ally_hp.cljs | (ns wish.sheets.dnd5e.overlays.ally-hp
(:require [reagent-forms.core :refer [bind-fields]]
[spade.core :refer [defattrs]]
[wish.sheets.dnd5e.overlays.style :as styles]
[wish.util :refer [>evt <sub]]))
(defattrs overlay-attrs []
styles/overlay
[:.quick-edit {:display :flex
... | null | https://raw.githubusercontent.com/dhleong/wish/9036f9da3706bfcc1e4b4736558b6f7309f53b7b/src/cljs/wish/sheets/dnd5e/overlays/ally_hp.cljs | clojure | (ns wish.sheets.dnd5e.overlays.ally-hp
(:require [reagent-forms.core :refer [bind-fields]]
[spade.core :refer [defattrs]]
[wish.sheets.dnd5e.overlays.style :as styles]
[wish.util :refer [>evt <sub]]))
(defattrs overlay-attrs []
styles/overlay
[:.quick-edit {:display :flex
... | |
affddcc59e61571e202bde8d1c85df1d318fa039070c07754b79fec0b1a83f7a | ghc/packages-Cabal | cabal.test.hs | import Test.Cabal.Prelude
import Control.Monad ( (>=>) )
main = cabalTest $ do
-- Some different ways of calling an executable that should all work
-- on a single-exe single-package project
mapM_ (cabal' "v2-run" >=> assertOutputContains "Hello World")
[ ["foo"]
, ["Single"]
, []
... | null | https://raw.githubusercontent.com/ghc/packages-Cabal/6f22f2a789fa23edb210a2591d74ea6a5f767872/cabal-testsuite/PackageTests/NewBuild/CmdRun/Single/cabal.test.hs | haskell | Some different ways of calling an executable that should all work
on a single-exe single-package project
non-existent exe | import Test.Cabal.Prelude
import Control.Monad ( (>=>) )
main = cabalTest $ do
mapM_ (cabal' "v2-run" >=> assertOutputContains "Hello World")
[ ["foo"]
, ["Single"]
, []
, ["Single:foo"]
, ["exe:foo"] ]
fails (cabal' "v2-run" ["bar"]) >>= assertOutputDoesNotContain "... |
399a8918b58f9232d13b2f18a4942a6146534f1a2529d4155ac848cfdd6661f0 | NorfairKing/the-notes | MACs.hs | # LANGUAGE QuasiQuotes #
module Cryptography.MACs where
import Notes hiding (cyclic,
inverse)
import Functions.Application.Macro
import Functions.Basics.Macro
import Functions.Basics.T... | null | https://raw.githubusercontent.com/NorfairKing/the-notes/ff9551b05ec3432d21dd56d43536251bf337be04/src/Cryptography/MACs.hs | haskell | # LANGUAGE QuasiQuotes #
module Cryptography.MACs where
import Notes hiding (cyclic,
inverse)
import Functions.Application.Macro
import Functions.Basics.Macro
import Functions.Basics.T... | |
afed2ba5ee286ce173179e8d43b92d5c522b0ea175f87d3f866cc357ca73fff1 | fukamachi/mito | util.lisp | (defpackage #:mito.migration.util
(:use #:cl)
(:import-from #:chipz
#:make-crc32
#:update-crc32
#:produce-crc32)
(:export #:generate-advisory-lock-id))
(in-package #:mito.migration.util)
(defun ascii-string-to-octets (value)
(check-type value string)
(map '(sim... | null | https://raw.githubusercontent.com/fukamachi/mito/fcc8003b823925d8cd73fc77af1fcb6f0b70f6a7/src/migration/util.lisp | lisp | (defpackage #:mito.migration.util
(:use #:cl)
(:import-from #:chipz
#:make-crc32
#:update-crc32
#:produce-crc32)
(:export #:generate-advisory-lock-id))
(in-package #:mito.migration.util)
(defun ascii-string-to-octets (value)
(check-type value string)
(map '(sim... | |
d87959912e2171e2e125fbfb8de89bf374317adeb5972476fb9ba4e4b965a8c9 | Decentralized-Pictures/T4L3NT | stored_data.ml | (*****************************************************************************)
(* *)
(* Open Source License *)
Copyright ( c ) 2020 - 2021 Nomadic Labs , < >
(* ... | null | https://raw.githubusercontent.com/Decentralized-Pictures/T4L3NT/6d4d3edb2d73575384282ad5a633518cba3d29e3/src/lib_store/stored_data.ml | ocaml | ***************************************************************************
Open Source License
Permission is h... | Copyright ( c ) 2020 - 2021 Nomadic Labs , < >
to deal in the Software without restriction , including without limitation
and/or sell copies of the Software , and to permit persons to whom the
THE SOFTWARE IS PROVIDED " AS IS " , WITHOUT WARRANTY OF ANY KIND , EXPRESS OR
LIABILITY , WHETHER IN... |
9d829d5d924b39d4a8c403eab1553b590ef6ede57ce9274b24831dd5055724c9 | amosr/folderol | Network.hs | # LANGUAGE NoImplicitPrelude #
# LANGUAGE FlexibleInstances #
{-# LANGUAGE OverloadedStrings #-}
module Folderol.Untyped.Network where
import Folderol.Untyped.Name
import Folderol.Untyped.Process
import Folderol.Untyped.Stream
import qualified Folderol.Internal.Pretty as Pretty
import qualified Folderol.Internal.Hask... | null | https://raw.githubusercontent.com/amosr/folderol/9b8c0cd30cfb798dadaa404cc66404765b1fc4fe/src/Folderol/Untyped/Network.hs | haskell | # LANGUAGE OverloadedStrings #
^ Hold the set of all channels ever used, in addition order.
This way we can give stable names as channels are added and removed | # LANGUAGE NoImplicitPrelude #
# LANGUAGE FlexibleInstances #
module Folderol.Untyped.Network where
import Folderol.Untyped.Name
import Folderol.Untyped.Process
import Folderol.Untyped.Stream
import qualified Folderol.Internal.Pretty as Pretty
import qualified Folderol.Internal.Haskell as Haskell
import P
import Da... |
ec7c693c986b52e12791c9e91c47c29d25f941f8c1ab11ce912c316ccd271192 | Liam-Eagen/BulletproofsPP | NormArgument.hs | # LANGUAGE StandaloneDeriving #
module Bulletproof.NormArgument where
import Data.Bifunctor
import Data.Foldable (foldrM, toList)
import Control.Monad (replicateM)
import Data.VectorSpace
import Utils
import Commitment
import Bulletproof
import Control.Parallel.Strategies
-- Returns functions for committing to x ... | null | https://raw.githubusercontent.com/Liam-Eagen/BulletproofsPP/0494201e2048f5c679f4ce3ee0cc6ac0ff9d3ef7/src/Bulletproof/NormArgument.hs | haskell | Returns functions for committing to x and r, as well as the computed scalar
values. Normalization can be handled by caller. For norms q scaling can occur
in the sc function
Swaps the scalars/basis points
----------
Must normalize
`using` parColl rdeepseq
--------
Norm --
Must normalize witness
`using` parColl ... | # LANGUAGE StandaloneDeriving #
module Bulletproof.NormArgument where
import Data.Bifunctor
import Data.Foldable (foldrM, toList)
import Control.Monad (replicateM)
import Data.VectorSpace
import Utils
import Commitment
import Bulletproof
import Control.Parallel.Strategies
foldXR :: (CanCommit v s, BPCollection f)... |
8af5c7f8380cf274b325df2bcb420b9b0963f53908d1c741ff7779ee1a7e6850 | moss/haskell-roguelike-challenge | rfk.hs | module RobotFindsKitten where
import Control.Monad
import System.Console.ANSI
import System.IO
type Position = (Int, Int)
data GameState = Playing { robot :: Position, kitten :: Position }
| FoundKitten
| Over deriving (Eq, Show)
data Command = MoveLeft
| MoveDown
... | null | https://raw.githubusercontent.com/moss/haskell-roguelike-challenge/2163c3aa6f14051bc2360de0d7a1694b54ef73a3/4-robot-finds-kitten/rfk.hs | haskell | |Play a game
|takeThrough, applied to a predicate @p@ and a list @xs@, returns the
[1,2,3] | module RobotFindsKitten where
import Control.Monad
import System.Console.ANSI
import System.IO
type Position = (Int, Int)
data GameState = Playing { robot :: Position, kitten :: Position }
| FoundKitten
| Over deriving (Eq, Show)
data Command = MoveLeft
| MoveDown
... |
1c5cf2d21fe658a1f916b82103db889db9001ec5ce029e6e99bdb4f5c57277ac | nikodemus/raylisp | obj.lisp | by Nikodemus Siivola < > , 2009 .
;;;;
;;;; Permission is hereby granted, free of charge, to any person
;;;; obtaining a copy of this software and associated documentation files
( the " Software " ) , to deal in the Software without restriction ,
;;;; including without limitation the rights to use, copy, modify, m... | null | https://raw.githubusercontent.com/nikodemus/raylisp/f79f61c6df283baad265dfdc207d798b63ca19a9/formats/obj.lisp | lisp |
Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation files
including without limitation the rights to use, copy, modify, merge,
subject to the following conditions:
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
IN NO EVEN... | by Nikodemus Siivola < > , 2009 .
( the " Software " ) , to deal in the Software without restriction ,
publish , distribute , sublicense , and/or sell copies of the Software ,
and to permit persons to whom the Software is furnished to do so ,
THE SOFTWARE IS PROVIDED " AS IS " , WITHOUT WARRANTY OF ANY KIND ... |
f1bbba45c3da16055910d96c7b47bb733717807c007de2154a03ef6f9ec4d623 | kowainik/summoner | Main.hs | module Main (main) where
import StackFull (projectName)
main :: IO ()
main = putStrLn ("Executable for " ++ projectName)
| null | https://raw.githubusercontent.com/kowainik/summoner/0e9343880171b81e515bc7bfebe8c6156330f9f2/summoner-cli/examples/stack-full/app/Main.hs | haskell | module Main (main) where
import StackFull (projectName)
main :: IO ()
main = putStrLn ("Executable for " ++ projectName)
| |
945e7916ffe976ad15de57c3c2f6b745fc5cf66c3eb6ee7b1861b153ac25635c | WhatsApp/eqwalizer | gradual_misc.erl | Copyright ( c ) Meta Platforms , Inc. and affiliates . All rights reserved .
%%%
This source code is licensed under the Apache 2.0 license found in
%%% the LICENSE file in the root directory of this source tree.
-module(gradual_misc).
-compile([export_all, nowarn_export_all]).
% code is unsafe
-spec use_invalid_... | null | https://raw.githubusercontent.com/WhatsApp/eqwalizer/ae608820ec08c2108e438a92b9d7a0fdf999a06b/eqwalizer/test_projects/check_gradual/src/gradual_misc.erl | erlang |
the LICENSE file in the root directory of this source tree.
code is unsafe
code is safe but violates opacity | Copyright ( c ) Meta Platforms , Inc. and affiliates . All rights reserved .
This source code is licensed under the Apache 2.0 license found in
-module(gradual_misc).
-compile([export_all, nowarn_export_all]).
-spec use_invalid_opaque_1(
opaque:contravariant(a)
) -> opaque:contravariant(a | b).
use_invalid_o... |
8692eba8efab965cfd0c4ad7d404c6c7662850303810f304453498b1c59cd808 | javalib-team/sawja | jCFAOptions.mli |
* This file is part of SAWJA
* Copyright ( c)2013 ( INRIA )
*
* This program is free software : you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation , either version 3 of
* the License , or ( at your option ) a... | null | https://raw.githubusercontent.com/javalib-team/sawja/da39f9c1c4fc52a1a1a6350be0e39789812b6c00/src/jCFAOptions.mli | ocaml |
* This file is part of SAWJA
* Copyright ( c)2013 ( INRIA )
*
* This program is free software : you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation , either version 3 of
* the License , or ( at your option ) a... | |
e24d8765e268011e2abe40ba773f0e93a97925d8d385e8891527774687a1f9f2 | hslua/hslua | Module.hs | {-# LANGUAGE OverloadedStrings #-}
|
Module : HsLua . Packaging . Module
Copyright : © 2019 - 2023 : MIT
Maintainer : >
Stability : alpha
Portability : Requires GHC 8 or later .
Utility functions for HsLua modules .
Module : HsLua.Packaging.Module
Copyright : © 2019-2023... | null | https://raw.githubusercontent.com/hslua/hslua/ebbc64c5f2584ca2294ee8bbec8983ec71794000/hslua-packaging/src/HsLua/Packaging/Module.hs | haskell | # LANGUAGE OverloadedStrings #
* Documented module
| Create a new module (i.e., a Lua table).
| Registers a 'Module'; leaves a copy of the module table on
the stack.
| Add the module under a different name to the table of preloaded
packages.
| Preload self-documenting module using the module's default name.
mod... | |
Module : HsLua . Packaging . Module
Copyright : © 2019 - 2023 : MIT
Maintainer : >
Stability : alpha
Portability : Requires GHC 8 or later .
Utility functions for HsLua modules .
Module : HsLua.Packaging.Module
Copyright : © 2019-2023 Albert Krewinkel
License : MIT... |
2cdd85ddd67bc26e10512077577fe23b0d0092fd21c2ce0037faf8fceeca4200 | lesguillemets/sicp-haskell | GenericArithmeticOperations.hs | # LANGUAGE UndecidableInstances #
# LANGUAGE FlexibleInstances #
-- do we really need this?
module GenericArithmeticOperations where
import Prelude hiding (Rational)
import ComplexNumber
class Arithmetic a where
add :: a -> a -> a
sub :: a -> a -> a
mul :: a -> a -> a
divide :: a -> a -> a
newtype Sch... | null | https://raw.githubusercontent.com/lesguillemets/sicp-haskell/df524a1e28c45fb16a56f539cad8babc881d0431/exercise/chap02/sect5/GenericArithmeticOperations.hs | haskell | do we really need this? | # LANGUAGE UndecidableInstances #
# LANGUAGE FlexibleInstances #
module GenericArithmeticOperations where
import Prelude hiding (Rational)
import ComplexNumber
class Arithmetic a where
add :: a -> a -> a
sub :: a -> a -> a
mul :: a -> a -> a
divide :: a -> a -> a
newtype SchemeNumber = SNumber Int der... |
7cce94b6de5c0aa61ec11bcb5bbd44df4b58e3a78463d335a37030e986eb54c2 | fossas/fossa-cli | ErlangSpec.hs | # LANGUAGE DataKinds #
# LANGUAGE QuasiQuotes #
module Analysis.ErlangSpec (spec) where
import Analysis.FixtureExpectationUtils
import Analysis.FixtureUtils
import Path
import Strategy.Rebar3 qualified as Rebar3
import Test.Hspec
import Types (DiscoveredProjectType (..), GraphBreadth (Complete))
erlangEnv :: Fixture... | null | https://raw.githubusercontent.com/fossas/fossa-cli/e1edac30265888f0252c58598f63b9e475813128/integration-test/Analysis/ErlangSpec.hs | haskell | # LANGUAGE DataKinds #
# LANGUAGE QuasiQuotes #
module Analysis.ErlangSpec (spec) where
import Analysis.FixtureExpectationUtils
import Analysis.FixtureUtils
import Path
import Strategy.Rebar3 qualified as Rebar3
import Test.Hspec
import Types (DiscoveredProjectType (..), GraphBreadth (Complete))
erlangEnv :: Fixture... | |
c798d5d5f1d234387fb81089a17ef878c2bdfcbe18618184565212a24c387638 | ygrek/mldonkey | http_client.ml | Copyright 2002 b8_bavard , b8_fee_carabine ,
This file is part of mldonkey .
mldonkey is free software ; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation ; either version 2 of the License , or
( at y... | null | https://raw.githubusercontent.com/ygrek/mldonkey/333868a12bb6cd25fed49391dd2c3a767741cb51/src/utils/net/http_client.ml | ocaml | (host,port,(login,password))
I get a lot more bittorrent urls with this line:
TODO: we should lowercase the names here!
The header-names are case-insensitive,
therefore we only use lowercased names.
call not more than once
if !verbose then lprintf_nl "Event %s" (string... | Copyright 2002 b8_bavard , b8_fee_carabine ,
This file is part of mldonkey .
mldonkey is free software ; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation ; either version 2 of the License , or
( at y... |
87e201bb8fb228501ffcb1c0028f8298aa29c8879a3dbf94511db9b0274cf2fe | camllight/camllight | num.mli | Operations on numbers
#open "ref";;
#open "big_int";;
#open "ratio";;
Numbers ( type [ num ] ) are arbitrary - precision rational numbers ,
plus the special elements [ 1/0 ] ( infinity ) and [ 0/0 ] ( undefined ) .
plus the special elements [1/0] (infinity) and [0/0] (undefined). *)
type num = Int of int... | null | https://raw.githubusercontent.com/camllight/camllight/0cc537de0846393322058dbb26449427bfc76786/sources/contrib/libnum/num.mli | ocaml | The type of numbers.
** Arithmetic operations
Addition
Subtraction
Multiplication
Squaring
Exponentiation
Test if a number is an integer
Usual comparisons between numbers
Absolute value.
[succ n] is [n+1]
[pred n] is [n-1]
[incr r] is [r:=!r+1], where [r] is a reference to a number.
** Coercion... | Operations on numbers
#open "ref";;
#open "big_int";;
#open "ratio";;
Numbers ( type [ num ] ) are arbitrary - precision rational numbers ,
plus the special elements [ 1/0 ] ( infinity ) and [ 0/0 ] ( undefined ) .
plus the special elements [1/0] (infinity) and [0/0] (undefined). *)
type num = Int of int... |
0fcb53261e42ee89521f71b31a4074463eef64fca037d82b10d02905c1be8f30 | ferdinand-beyer/refx | interceptors.cljc | (ns refx.interceptors
(:require [clojure.data :as data]
[refx.interceptor :refer [->interceptor assoc-coeffect
assoc-effect get-coeffect get-effect
update-coeffect]]
[refx.interop :as interop]
[refx.log :as... | null | https://raw.githubusercontent.com/ferdinand-beyer/refx/27651b5d650a9651d191326ecdb4bcb0e42e3230/core/src/refx/interceptors.cljc | clojure | put the original db back so that things like debug work later on
If no db effect is returned, we provide the original coeffect.
If the enriched db is nil, use the last known good db
call f for side effects
context is unchanged
work out if any "inputs" have changed
make sure the db is actually set in the effect | (ns refx.interceptors
(:require [clojure.data :as data]
[refx.interceptor :refer [->interceptor assoc-coeffect
assoc-effect get-coeffect get-effect
update-coeffect]]
[refx.interop :as interop]
[refx.log :as... |
48bb1853f37d4443e285017d8c690ad2284a4b3e0bc620c7f69f067aeb3f28a2 | ghcjs/ghcjs | t7970.hs | import Control.Exception as E
import Data.IORef
import System.Mem.Weak
import Control.Concurrent
main :: IO ()
main = do
ref <- newIORef 'x'
weak <- mkWeakIORef ref $ putStrLn "IORef finalized"
let check = deRefWeak weak >>= \m -> case m of
Nothing -> putStrLn "IORef was GCed"
Just ... | null | https://raw.githubusercontent.com/ghcjs/ghcjs/e4cd4232a31f6371c761acd93853702f4c7ca74c/test/ghc/concurrent/t7970.hs | haskell | import Control.Exception as E
import Data.IORef
import System.Mem.Weak
import Control.Concurrent
main :: IO ()
main = do
ref <- newIORef 'x'
weak <- mkWeakIORef ref $ putStrLn "IORef finalized"
let check = deRefWeak weak >>= \m -> case m of
Nothing -> putStrLn "IORef was GCed"
Just ... | |
f42418c127b0e734e38a4d6d1f8411b76110d4813ce4a3d0a90b34161f9b78a4 | ThomasHintz/keep-the-records | test-misc-utils.scm | (import misc-utils)
(test-begin "misc-utils")
(test-group
"fold-sep"
(test "xa*/b*/c*" (fold-sep (lambda (e) (string-append e "*")) "/" "x" '("a" "b" "c"))))
(test-group
"range"
(test '() (range 0))
(test '(0) (range 1))
(test '(0) (range 0 1))
(test '(0 1) (range 2))
(test '(0 1) (range 0 2))
(test '(1 2) ... | null | https://raw.githubusercontent.com/ThomasHintz/keep-the-records/c20e648e831bed2ced3f2f74bfc590dc06b5f076/tests/test-misc-utils.scm | scheme | (import misc-utils)
(test-begin "misc-utils")
(test-group
"fold-sep"
(test "xa*/b*/c*" (fold-sep (lambda (e) (string-append e "*")) "/" "x" '("a" "b" "c"))))
(test-group
"range"
(test '() (range 0))
(test '(0) (range 1))
(test '(0) (range 0 1))
(test '(0 1) (range 2))
(test '(0 1) (range 0 2))
(test '(1 2) ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.