_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 |
|---|---|---|---|---|---|---|---|---|
28272c65de4f2c94762caefe5f93511748abae6fa2d0d4b7cbfd025a89278fbf | freuk/obandit | obandit.ml | ---------------------------------------------------------------------------
Copyright ( c ) 2017 . All rights reserved .
Distributed under the ISC license , see terms at the end of the file .
% % NAME%% % % ---------------------------------------------------------------------------
Copyright (c) 2017 ... | null | https://raw.githubusercontent.com/freuk/obandit/0d8222c9e8dbb4b7f324290121bc45892620c783/src/obandit.ml | ocaml | **************************Utilities****************************
Makes a comparator function.
Gets the argmax of a function on a list.
Increments a list at position i, return a new list.
Sample an integer from a probability distribution.
*************************** UCB ******************************
****************... | ---------------------------------------------------------------------------
Copyright ( c ) 2017 . All rights reserved .
Distributed under the ISC license , see terms at the end of the file .
% % NAME%% % % ---------------------------------------------------------------------------
Copyright (c) 2017 ... |
5d07f48bb314234357d9d1061c5e92059e23edc10c667b14ff929816884f65ec | bos/pronk | Warp.hs | {-# LANGUAGE OverloadedStrings #-}
import Blaze.ByteString.Builder (fromByteString)
import Network.HTTP.Types (status200)
import Network.Wai (Response(ResponseBuilder))
import Network.Wai.Handler.Warp (run)
main :: IO ()
main = run 8000 $ const $ return $ ResponseBuilder
status200
[("Content-Type", "text/plain... | null | https://raw.githubusercontent.com/bos/pronk/e3a0f789801237b5abdd7b2c65d15b47d00d0b98/servers/ping/src/Warp.hs | haskell | # LANGUAGE OverloadedStrings # | import Blaze.ByteString.Builder (fromByteString)
import Network.HTTP.Types (status200)
import Network.Wai (Response(ResponseBuilder))
import Network.Wai.Handler.Warp (run)
main :: IO ()
main = run 8000 $ const $ return $ ResponseBuilder
status200
[("Content-Type", "text/plain"), ("Content-Length", "4")]
$ ... |
d679497008ac93e42b599ee375edd95272788e70d2a6156188640f2c77c0efbd | Apress/common-lisp-recipes | code.lisp | Copyright ( c ) 2015 , . All rights reserved .
This is example code for the book " Common Lisp Recipes " and meant
to be used with something like ( from SLIME ) C - M - x or C - c C - c.
;;; See the book for more information.
(eval-when (:compile-toplevel :load-toplevel :execute)
(error "This code is not ... | null | https://raw.githubusercontent.com/Apress/common-lisp-recipes/211a8b6eabc48ac906010e8c5a185f03504b3867/code/chapter-07/code.lisp | lisp | See the book for more information.
list meets string
vector meets list
vector and list again
<- ATTENTION, WILL LOOP FOREVER
new binding
note INTO here
<-- changed
note the difference
s... | Copyright ( c ) 2015 , . All rights reserved .
This is example code for the book " Common Lisp Recipes " and meant
to be used with something like ( from SLIME ) C - M - x or C - c C - c.
(eval-when (:compile-toplevel :load-toplevel :execute)
(error "This code is not meant to be used with LOAD or COMPILE-F... |
ab1bbe17c502622f815f4467b716a9fac24f713314867510f4d4c0778485e01c | shirok/Gauche | libmacro.scm | ;;;
;;; libmacro.scm - built-in macros
;;;
Copyright ( c ) 2000 - 2022 < >
;;;
;;; Redistribution and use in source and binary forms, with or without
;;; modification, are permitted provided that the following conditions
;;; are met:
;;;
;;; 1. Redistributions of source code must retain the above cop... | null | https://raw.githubusercontent.com/shirok/Gauche/bfe8f1fe64769307d2cde09cf49a1c67c54e0ad4/src/libmacro.scm | scheme |
libmacro.scm - built-in macros
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
1. Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclai... | Copyright ( c ) 2000 - 2022 < >
" AS IS " AND ANY EXPRESS OR IMPLIED WARRANTIES , INCLUDING , BUT NOT
SPECIAL , EXEMPLARY , OR CONSEQUENTIAL DAMAGES ( INCLUDING , BUT NOT LIMITED
LIABILITY , WHETHER IN CONTRACT , STRICT LIABILITY , OR TORT ( INCLUDING
(select-module gauche)
(use util.match)
(dec... |
7c89a336b8a442cb79d025628609f8a1e6534db9a0d57042a30f2d25352c5d60 | ml4tp/tcoq | coqide.mli | (************************************************************************)
v * The Coq Proof Assistant / The Coq Development Team
< O _ _ _ , , * INRIA - CNRS - LIX - LRI - PPS - Copyright 1999 - 2017
\VV/ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *... | null | https://raw.githubusercontent.com/ml4tp/tcoq/7a78c31df480fba721648f277ab0783229c8bece/ide/coqide.mli | ocaml | **********************************************************************
// * This file is distributed under the terms of the
* GNU Lesser General Public License Version 2.1
**********************************************************************
* The arguments that will be passed ... | v * The Coq Proof Assistant / The Coq Development Team
< O _ _ _ , , * INRIA - CNRS - LIX - LRI - PPS - Copyright 1999 - 2017
\VV/ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* * The CoqIde main module
v... |
36c3b8fe00b08d9bd479203a96ea2d288c3ba0cdd0a4ee14b02d71a15962071c | mirage/bechamel | ext.ml | ( c )
module Make (Functor : S.FUNCTOR) = struct
type t = ..
module type Extension = sig
type x
type t += T of x
end
type 'a extension = (module Extension with type x = 'a)
type instance = V : 'a * 'a Functor.t -> instance
let handlers = Hashtbl.create 16
module Injection (X : sig
typ... | null | https://raw.githubusercontent.com/mirage/bechamel/b76cd74f6b4a334683403baf838531da2e949d80/lib/ext.ml | ocaml | ( c )
module Make (Functor : S.FUNCTOR) = struct
type t = ..
module type Extension = sig
type x
type t += T of x
end
type 'a extension = (module Extension with type x = 'a)
type instance = V : 'a * 'a Functor.t -> instance
let handlers = Hashtbl.create 16
module Injection (X : sig
typ... | |
79440aea5ac84fd6748444b65e077f6d3bca721a7a7a5f7e1af316822453aadd | rizo/snowflake-os | ccomp.ml | (***********************************************************************)
(* *)
(* Objective Caml *)
(* *)
, projet ... | null | https://raw.githubusercontent.com/rizo/snowflake-os/51df43d9ba715532d325e8880d3b8b2c589cd075/plugins/ocamlopt.opt/utils/ccomp.ml | 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 Q Public License version 1.0 .
$ Id$
let command cmdline =
if !C... |
4c4523c85cd4e864a842c1f95f246f2ca0a0a02d2f580ae77374befd3f42ac16 | cirodrig/triolet | Progress.hs | {-| A progress-tracking monad transformer
-}
module Common.Progress
(ProgressT, runProgressT, evalProgressT,
step, stepIf, liftStep, stepTo, ignoreProgress, fixedpoint)
where
import Control.Monad
import Control.Monad.Trans
-- | Progress-tracking state; strict in the progress value
data P x = P !Bool x... | null | https://raw.githubusercontent.com/cirodrig/triolet/e515a1dc0d6b3e546320eac7b71fb36cea5b53d0/src/program/Common/Progress.hs | haskell | | A progress-tracking monad transformer
| Progress-tracking state; strict in the progress value
| A monad that keeps track of whether a computation has made progress.
Intended for fixed-point iteration.
| Run a 'ProgressT' computation and report whether progress was made
Initially, no progress has been made
| ... |
module Common.Progress
(ProgressT, runProgressT, evalProgressT,
step, stepIf, liftStep, stepTo, ignoreProgress, fixedpoint)
where
import Control.Monad
import Control.Monad.Trans
data P x = P !Bool x
newtype ProgressT m a = ProgressT {runP :: Bool -> m (P a)}
instance Monad m => Monad (ProgressT m) w... |
473923d14576c72a23ea41ec5835b15600e789650bfefa94b6eaa893c7f1f627 | rtoy/cmucl | main.lisp | ;;; -*- Package: C; Log: C.Log -*-
;;;
;;; **********************************************************************
This code was written as part of the CMU Common Lisp project at
Carnegie Mellon University , and has been placed in the public domain .
;;;
(ext:file-comment "$Header: src/compiler/main.lisp $")
;;;
;;;... | null | https://raw.githubusercontent.com/rtoy/cmucl/9b1abca53598f03a5b39ded4185471a5b8777dea/src/compiler/main.lisp | lisp | -*- Package: C; Log: C.Log -*-
**********************************************************************
**********************************************************************
This file contains the top-level interfaces to the compiler.
Exported:
Exported:
Exported:
Exported:
Value of the :byte-compile ... | This code was written as part of the CMU Common Lisp project at
Carnegie Mellon University , and has been placed in the public domain .
(ext:file-comment "$Header: src/compiler/main.lisp $")
Written by
(in-package "C")
(in-package "EXTENSIONS")
(intl:textdomain "cmucl")
(export '(*compile-progress* compile-fro... |
778fe3b4cd537e82914b85ac4b4d454fd2eb6e0cd1e0027d664bd436721911e7 | cachix/cachix | Permission.hs | module Cachix.Types.Permission where
import Data.Aeson (FromJSON, ToJSON)
import Data.Swagger (ToSchema)
import Protolude
data Permission = Read | Write | Admin
deriving (Generic, Show, FromJSON, ToJSON, ToSchema, NFData, Eq, Ord)
| null | https://raw.githubusercontent.com/cachix/cachix/4e5c4973223e2b4606e86b1f99de548b833fcf63/cachix-api/src/Cachix/Types/Permission.hs | haskell | module Cachix.Types.Permission where
import Data.Aeson (FromJSON, ToJSON)
import Data.Swagger (ToSchema)
import Protolude
data Permission = Read | Write | Admin
deriving (Generic, Show, FromJSON, ToJSON, ToSchema, NFData, Eq, Ord)
| |
fa74aa5dfd392861bd555a04e1c76f1f66b6f5816f4def1bba89e580aa9aa975 | jsinglet/cam | Main.hs | # LANGUAGE QuasiQuotes #
-- |
-- Module: Main
Author : < >
module Main where
import System.Environment
import QQ
import Lexer
import Compile
import VM
import Parser
import System.FilePath
main :: IO ()
main = do
command <- getArgs
case command of
(h:t) -> do
let action = ... | null | https://raw.githubusercontent.com/jsinglet/cam/bca0e53fe428baf7b5e489569df2355f77ea3484/camc/Main.hs | haskell | |
Module: Main
| Main Operations
for debugging | # LANGUAGE QuasiQuotes #
Author : < >
module Main where
import System.Environment
import QQ
import Lexer
import Compile
import VM
import Parser
import System.FilePath
main :: IO ()
main = do
command <- getArgs
case command of
(h:t) -> do
let action = lookup h dispatch
... |
0d154b5c5e9dd377c8c5f55d83176a73d1b51eb1a89a4717c3049abaa84d7959 | ocaml-multicore/eio | fs.ml | (** Defines types used by file-systems. *)
(** Tranditional Unix permissions. *)
module Unix_perm = File.Unix_perm [@@deprecated "Moved to File.Unix_perm"]
type path = string
type error =
| Already_exists of Exn.Backend.t
| Not_found of Exn.Backend.t
| Permission_denied of Exn.Backend.t
| File_too_large
typ... | null | https://raw.githubusercontent.com/ocaml-multicore/eio/a17ec4480ce5f49cd13f2fcb85fad89459fd5856/lib_eio/fs.ml | ocaml | * Defines types used by file-systems.
* Tranditional Unix permissions.
* When to create a new file.
* fail if the named file doesn't exist
* create if file doesn't already exist
* always create; fail if the file already exists
* If a new file is created, the given permissions are used for it.
* Note: use the fun... |
module Unix_perm = File.Unix_perm [@@deprecated "Moved to File.Unix_perm"]
type path = string
type error =
| Already_exists of Exn.Backend.t
| Not_found of Exn.Backend.t
| Permission_denied of Exn.Backend.t
| File_too_large
type Exn.err += E of error
let err e =
Exn.create (E e)
let () =
Exn.register_... |
36bb42d319ebc4c6c37490d659236685e464e95a49a909e2a33437f08ce0bf28 | mikeball/foundation | json_tests.clj | (ns taoclj.foundation.json-tests
(:require [clojure.test :refer :all]
[taoclj.foundation :refer :all]
[taoclj.foundation.tests-config :refer [tests-db]]
[taoclj.foundation.execution :refer [execute]]))
(deftest read-json-columns
(is (= '({:person {:name "bob"}})
(qry-... | null | https://raw.githubusercontent.com/mikeball/foundation/a0376f49759b1552f2f70e7585029b592b6fb346/test/taoclj/foundation/json_tests.clj | clojure | waiting on driver support...
(deftest insert-jsonb-columns
" person jsonb not null);")))
(trx-> tests-db
(insert :insert-jsonb {:person {:name "bob"}}))
(is (= [{:id 1 :person {:name "bob"}}]
(qry-> tests-db
(execute "SELECT id, person FROM insert_json... | (ns taoclj.foundation.json-tests
(:require [clojure.test :refer :all]
[taoclj.foundation :refer :all]
[taoclj.foundation.tests-config :refer [tests-db]]
[taoclj.foundation.execution :refer [execute]]))
(deftest read-json-columns
(is (= '({:person {:name "bob"}})
(qry-... |
5d8dd515d50c0e4540eb1c3c1fb693f5b262137ec9a70be436734146fb34b890 | Ericson2314/lighthouse | Interrupts.hs | | Interrupts ( section 3.4 in the paper )
module H.Interrupts(IRQ(..),enableIRQ,disableIRQ,eoiIRQ,
enableInterrupts,disableInterrupts) where
import Foreign.StablePtr(StablePtr,newStablePtr)
import Data.Word
import Data.Bits
import Data.Ix
import H.Monad(H,liftIO)
import H.Mutable(HArray , newArray , readArr... | null | https://raw.githubusercontent.com/Ericson2314/lighthouse/210078b846ebd6c43b89b5f0f735362a01a9af02/kernel/H/Interrupts.hs | haskell | ----------------------INTERFACE--------------------------
| Enable interrupts globally
| Disable interrupts globally
-------PRIVATE IMPLEMENTATION FOLLOWS---------------------- | | Interrupts ( section 3.4 in the paper )
module H.Interrupts(IRQ(..),enableIRQ,disableIRQ,eoiIRQ,
enableInterrupts,disableInterrupts) where
import Foreign.StablePtr(StablePtr,newStablePtr)
import Data.Word
import Data.Bits
import Data.Ix
import H.Monad(H,liftIO)
import H.Mutable(HArray , newArray , readArr... |
3c1a1eed431c7c48bb49538338cbce4758d8c2becf8b773e193fdc00f204e90f | aptmcl/rosetta | utils.rkt | #lang typed/racket/base/no-check
(require (for-syntax racket/base)
racket/path racket/file racket/format racket/list racket/math)
(provide singleton? singleton-ref)
(define #:forall (T) (singleton? [l : (Listof T)]) : Boolean
(and (not (null? l))
(null? (cdr l))))
(define #:forall (T) (singleton-ref... | null | https://raw.githubusercontent.com/aptmcl/rosetta/1b81b10b0c8eb77d92d6b5ea86d0eb940add0888/base/utils.rkt | racket | Extra test to avoid rounding errors
Typed lazy functions
This cannot be easily converted to a contract (and typed/untyped-utils is not helping)
(: random (case-> (-> Integer Integer) (-> Float Float)))
so we use this instead
This cannot be easily converted to a contract (and typed/untyped-utils is not helping)
(: rando... | #lang typed/racket/base/no-check
(require (for-syntax racket/base)
racket/path racket/file racket/format racket/list racket/math)
(provide singleton? singleton-ref)
(define #:forall (T) (singleton? [l : (Listof T)]) : Boolean
(and (not (null? l))
(null? (cdr l))))
(define #:forall (T) (singleton-ref... |
04bdf1b619a9d31b9d88352c564dd5a3d6257bd61af613cfb9e8f41a0d1e8df0 | davelambert/porky | http.lisp | -*- package : ; Syntax : Common - lisp ; Base : 10 -*-
;;;
;;;; http.lisp
;;;
;;;
;;; --------------------------------------------------------------------------------------
;;;
;;; The contents of this file are subject to the NOKOS License Version 1.0a (the
;;; "License"); you may not use this file except in c... | null | https://raw.githubusercontent.com/davelambert/porky/44a4ff0e791de23f723bfd93072fcef5f8523c8a/src/core/http.lisp | lisp | Syntax : Common - lisp ; Base : 10 -*-
http.lisp
--------------------------------------------------------------------------------------
The contents of this file are subject to the NOKOS License Version 1.0a (the
"License"); you may not use this file except in compliance with the License.
WARRANTY OF... |
Software distributed under the License is distributed on an " AS IS " basis , WITHOUT
The Original Software is
WILBUR2 : Nokia Semantic Web Toolkit for CLOS
Copyright ( c ) 2001 - 2005 Nokia and others . All Rights Reserved .
Portions Copyright ( c ) 1989 - 1992 . All Rights Reserved .
Cont... |
4d4468df6138b12e3ce16493660998e094bcb18c5d9f59bb35a4bda8b0d30ecb | cch1/http.async.client | websocket.clj | # # websocket.clj -- Asynchronous HTTP Client Websocket support for Clojure
Copyright 2015
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 ap... | null | https://raw.githubusercontent.com/cch1/http.async.client/d105c2ff25f5165aaafe49562bc5b6db1ada5142/src/clj/http/async/client/websocket.clj | clojure |
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
-2.0
Unless required by applicable law or agreed to in writing, software
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permission... | # # websocket.clj -- Asynchronous HTTP Client Websocket support for Clojure
Copyright 2015
distributed under the License is distributed on an " AS IS " BASIS ,
(ns http.async.client.websocket
"Asynchronous HTTP Client Websocket Extensions- Clojure"
{:author "Chris Hapgood"}
(:refer-clojure :exclude [a... |
09861e52c146a64807cb3fb33e696f0b870444585d223c17beff1324e47a301c | plande/grand-scheme | define-memoized.scm | (define-module (grand define-memoized)
#:use-module (grand syntax)
#:use-module (srfi srfi-1)
#:use-module (grand function)
#:export (memoize define/memoized))
(define (memoize proc)
(let ((cache (make-hash-table)))
(with-procedure-properties ((memoization-table cache))
(lambda args
(match (hash-g... | null | https://raw.githubusercontent.com/plande/grand-scheme/c40cc25373789a437fdf5e49f47f5dd456f76faf/grand/define-memoized.scm | scheme | Levinshtein distance | (define-module (grand define-memoized)
#:use-module (grand syntax)
#:use-module (srfi srfi-1)
#:use-module (grand function)
#:export (memoize define/memoized))
(define (memoize proc)
(let ((cache (make-hash-table)))
(with-procedure-properties ((memoization-table cache))
(lambda args
(match (hash-g... |
3bb206203ca3498decbeccee91aee52861f79b356628905b4690733524378a0a | sharplispers/ironclad | os-prng.lisp | ;;;; -*- mode: lisp; indent-tabs-mode: nil -*-
;;;; os-prng.lisp -- OS-provided pseudo-random number generator
(in-package :crypto)
#+unix
(defparameter *os-prng-stream* nil)
#+unix
(defparameter *os-prng-stream-lock* (bt:make-lock))
(defclass os-prng ()
())
(defmethod prng-random-data (num-bytes (prng os-prng))
... | null | https://raw.githubusercontent.com/sharplispers/ironclad/dd08d82af03c39e607fdbde75fcd948e89d0ee1d/src/prng/os-prng.lisp | lisp | -*- mode: lisp; indent-tabs-mode: nil -*-
os-prng.lisp -- OS-provided pseudo-random number generator |
(in-package :crypto)
#+unix
(defparameter *os-prng-stream* nil)
#+unix
(defparameter *os-prng-stream-lock* (bt:make-lock))
(defclass os-prng ()
())
(defmethod prng-random-data (num-bytes (prng os-prng))
#+unix
(let* ((seq (make-array num-bytes :element-type '(unsigned-byte 8)))
(n (bt:with-lock-held ... |
565aaf748e867c02e443b81b5a87bb55e656c5b368e0a49509abd9d6aaa72f30 | samrushing/irken-compiler | t_permutations.scm | ;; -*- Mode: Irken -*-
(include "lib/basis.scm")
(include "lib/map.scm")
(include "lib/combinatorics.scm")
(for perm (permutations '(0 1 2 3 4))
(printn perm))
| null | https://raw.githubusercontent.com/samrushing/irken-compiler/690da48852d55497f873738df54f14e8e135d006/tests/t_permutations.scm | scheme | -*- Mode: Irken -*- |
(include "lib/basis.scm")
(include "lib/map.scm")
(include "lib/combinatorics.scm")
(for perm (permutations '(0 1 2 3 4))
(printn perm))
|
f1b62e10ce66aa3b526768a3f4428f06b2c281766a1a80f1b60d6e9efd095989 | fcracker79/aws-lambda-haskell-url-shortener | Lib.hs | module Lib (module AWSFunctions, handler) where
import GHC.Generics
import Data.Aeson
import DynamoDB
import Aws.Lambda
import Network.HTTP.Types.Header
import Data.ByteString.Char8
import AWSFunctions
data Person = Person
{ personName :: String
, personAge :: Int
} deriving (Generic)
instance FromJSON Person
... | null | https://raw.githubusercontent.com/fcracker79/aws-lambda-haskell-url-shortener/3c1692a10ab5f92bfd31070c15ac663edd88fa2a/src/Lib.hs | haskell | handler :: Person -> Context () -> IO (Either String Person)
handler person context =
if personAge person > 0 then
return (Right person)
else
return (Left "A person's age must be positive") | module Lib (module AWSFunctions, handler) where
import GHC.Generics
import Data.Aeson
import DynamoDB
import Aws.Lambda
import Network.HTTP.Types.Header
import Data.ByteString.Char8
import AWSFunctions
data Person = Person
{ personName :: String
, personAge :: Int
} deriving (Generic)
instance FromJSON Person
... |
fd5c74f52d1baafc2055849260e83af35cfd121151d14ef30e490d0051c02f09 | ntestoc3/burp-clj | utils.clj | (ns burp-clj.utils
(:require [clojure.reflect :as reflect]
[clojure.pprint :as pp]
[camel-snake-kebab.core :as csk]
[clojure.tools.gitlibs :as gitlib]
[taoensso.timbre :as log]
[taoensso.timbre.appenders.core :as appenders]
[cemerick.pomegranate ... | null | https://raw.githubusercontent.com/ntestoc3/burp-clj/436802d34fb77e183cf513ba767e3310d96f6946/src/burp_clj/utils.clj | clojure | dep helper
class helper
log helper
gui helper
(gui/native!)
object helper
these are our own definitions
this is where we delegate to the prototype
必须加载依赖,否则在awt线程中会执行失败!
map helper
converter helper
time helper | (ns burp-clj.utils
(:require [clojure.reflect :as reflect]
[clojure.pprint :as pp]
[camel-snake-kebab.core :as csk]
[clojure.tools.gitlibs :as gitlib]
[taoensso.timbre :as log]
[taoensso.timbre.appenders.core :as appenders]
[cemerick.pomegranate ... |
0d662416b5de9d6dd1acd838412d9476c1262ab674640443a7d85ea3f5ccbbf3 | brianium/indexed.db | store_test.cljs | (ns indexed.db.store-test
(:require [cljs.test :refer [deftest is async use-fixtures]]
[indexed.db :as indexed.db]
[indexed.db.test-util :as util]))
(defonce *db (atom nil))
(def database-name "indexed.db.store-test")
(def database-version 1)
(use-fixtures :once
{:before
#(async
... | null | https://raw.githubusercontent.com/brianium/indexed.db/9e6129439ed87756edbbc983df7d64a2f735ea70/test/indexed/db/store_test.cljs | clojure | close to prevent blocking
commentig out because locale properties are non-standard | (ns indexed.db.store-test
(:require [cljs.test :refer [deftest is async use-fixtures]]
[indexed.db :as indexed.db]
[indexed.db.test-util :as util]))
(defonce *db (atom nil))
(def database-name "indexed.db.store-test")
(def database-version 1)
(use-fixtures :once
{:before
#(async
... |
a184c65004137da5a236296ca512359021828c8aefa8a14b58688bd5e7b27332 | manuel-serrano/hop | nested_closures.scm | ;*=====================================================================*/
* Author : * /
* Copyright : 2007 - 11 , see LICENSE file * /
;* ------------------------------------------------------------- */
* This file is part of Scheme2Js . ... | null | https://raw.githubusercontent.com/manuel-serrano/hop/481cb10478286796addd2ec9ee29c95db27aa390/scheme2js/nested_closures.scm | scheme | *=====================================================================*/
* ------------------------------------------------------------- */
* */
* but WITHOUT ANY WARRANTY; without even the implied warranty of */
* MERCHANTABILITY or FITNE... | * Author : * /
* Copyright : 2007 - 11 , see LICENSE file * /
* This file is part of Scheme2Js . * /
* Scheme2Js is distributed in the hope that it will be useful , * /
(module nested-closures
(import... |
256f4aa1ea41ad23d05a6666f0e6c235dbdbaa3819e83d6097e43dbe610bf385 | gafiatulin/codewars | BinToDecimal.hs | to Decimal
--
module BinToDecimal where
import Data.Char (digitToInt)
binToDec :: String -> Int
binToDec = sum . zipWith (\p n -> n*2^p) [0..] . map digitToInt . reverse
| null | https://raw.githubusercontent.com/gafiatulin/codewars/535db608333e854be93ecfc165686a2162264fef/src/8%20kyu/BinToDecimal.hs | haskell | to Decimal
module BinToDecimal where
import Data.Char (digitToInt)
binToDec :: String -> Int
binToDec = sum . zipWith (\p n -> n*2^p) [0..] . map digitToInt . reverse
| |
d51642d474e7953750b66a009e2390d713d879fbc39d2ba07ab65ba8673ab058 | backtracking/astro | bug.ml |
let x =
let jj = 2443825.5 in
0.788651608487
let th0 = 6.6460656 +. 2400.051262 *. t +. 0.00002581 *. t *. t in
let ts = th0 -. 24. *. floor (th0 /. 24.) in
let h = floor ts in
let ts' = (ts -. h) *. 60. in
let m = floor ts' in
(ts' -. m) *. 60.
let _ =
Printf.printf "%E\n" (x -. 1.33157320077)
| null | https://raw.githubusercontent.com/backtracking/astro/adb8020b8a56692f3d2b50d26dce2ccc442c6f39/bug.ml | ocaml |
let x =
let jj = 2443825.5 in
0.788651608487
let th0 = 6.6460656 +. 2400.051262 *. t +. 0.00002581 *. t *. t in
let ts = th0 -. 24. *. floor (th0 /. 24.) in
let h = floor ts in
let ts' = (ts -. h) *. 60. in
let m = floor ts' in
(ts' -. m) *. 60.
let _ =
Printf.printf "%E\n" (x -. 1.33157320077)
| |
c5903b3859b763166143c9c4b2f36f3f31b10844ba826358cf1471cbff9cf17e | arachne-framework/arachne-assets | dsl.clj | (ns arachne.assets.dsl
"User-facing DSL functions for init scripts"
(:refer-clojure :exclude [merge])
(:require [arachne.core.config :as cfg]
[arachne.core.util :as util]
[arachne.core.config.script :as script :refer [defdsl]]
[arachne.core.config.specs :as ccs]
[cl... | null | https://raw.githubusercontent.com/arachne-framework/arachne-assets/98ee04c6679f6320dccb03d4a7dddb0b0725fa47/src/arachne/assets/dsl.clj | clojure | TODO: implement include/exclude
::include
::exclude | (ns arachne.assets.dsl
"User-facing DSL functions for init scripts"
(:refer-clojure :exclude [merge])
(:require [arachne.core.config :as cfg]
[arachne.core.util :as util]
[arachne.core.config.script :as script :refer [defdsl]]
[arachne.core.config.specs :as ccs]
[cl... |
530a54b39036663f1035c95147db9d795807cfb8de22bbd770189f193e3ae2fc | takuto-h/yuzu | declExpr.ml | type t =
| Val of (Names.val_name * TypeExpr.t)
| AbstrType of (Names.typector_name * int)
| ConcrType of (TypeDef.t) list
| Exception of ExnDecl.t
| null | https://raw.githubusercontent.com/takuto-h/yuzu/e6bef0964d87c1ced65280083505448f56e5cf29/declExpr.ml | ocaml | type t =
| Val of (Names.val_name * TypeExpr.t)
| AbstrType of (Names.typector_name * int)
| ConcrType of (TypeDef.t) list
| Exception of ExnDecl.t
| |
d1287a20f7156dec9fbec542eb3edae6b9f1e674ea7c99ef0049ff37ff598e2c | ksaaskil/functional-programming-examples | TreeADT.hs | -- Example abstract data type
--
module TreeADT
( Tree
, leaf
, branch
, cell
, left
, right
, isLeaf
)
where
data Tree a = Leaf a | Branch (Tree a) (Tree a)
leaf = Leaf
branch = Branch
cell (Leaf a) = a
left (Branch l r) = l
right (Branch l r) = r
isLeaf (Leaf _) = True
i... | null | https://raw.githubusercontent.com/ksaaskil/functional-programming-examples/cbeb90f200d42e4a464dfb02fa5d7424bc12dd00/learn-you-a-haskell/src/TreeADT.hs | haskell | Example abstract data type
| module TreeADT
( Tree
, leaf
, branch
, cell
, left
, right
, isLeaf
)
where
data Tree a = Leaf a | Branch (Tree a) (Tree a)
leaf = Leaf
branch = Branch
cell (Leaf a) = a
left (Branch l r) = l
right (Branch l r) = r
isLeaf (Leaf _) = True
isLeaf _ = False
|
6b4b2aac73fa1cbd97048dca40b434f0239ce5489a5ee75d3568c1a1abf6a74d | basho/riak_cs_control | riak_cs_control_sup.erl | %% -------------------------------------------------------------------
%%
Copyright ( c ) 2007 - 2012 Basho Technologies , Inc. All Rights Reserved .
%%
%% -------------------------------------------------------------------
@author < >
2012 Basho Technologies , Inc.
%% @doc Supervisor for the riak_cs_cont... | null | https://raw.githubusercontent.com/basho/riak_cs_control/c4161ce85196259f4ae432170b9ff1652426c5e6/src/riak_cs_control_sup.erl | erlang | -------------------------------------------------------------------
-------------------------------------------------------------------
@doc Supervisor for the riak_cs_control application.
External exports
supervisor callbacks
@doc API for starting the supervisor.
@doc supervisor callback. | Copyright ( c ) 2007 - 2012 Basho Technologies , Inc. All Rights Reserved .
@author < >
2012 Basho Technologies , Inc.
-module(riak_cs_control_sup).
-author('Christopher Meiklejohn <>').
-behaviour(supervisor).
-export([start_link/0]).
-export([init/1]).
start_link() ->
supervisor:start_link({loc... |
c10b2626191b30213dbfb928ac0c71ef9efa94fa808c3c66693f2b919ad4288f | cryptosense/pkcs11 | test_p11_aes_key_wrap.ml | open OUnit2
type yojson =
[ `Null
| `Bool of bool
| `Int of int
| `Float of float
| `String of string
| `Intlit of string
| `List of yojson list
| `Tuple of yojson list
| `Assoc of (string * yojson) list
| `Variant of string * yojson option ]
[@@deriving eq, show]
let test_to_yojson =
let test p... | null | https://raw.githubusercontent.com/cryptosense/pkcs11/93c39c7a31c87f68f0beabf75ef90d85a782a983/test/lib/test_p11_aes_key_wrap.ml | ocaml | open OUnit2
type yojson =
[ `Null
| `Bool of bool
| `Int of int
| `Float of float
| `String of string
| `Intlit of string
| `List of yojson list
| `Tuple of yojson list
| `Assoc of (string * yojson) list
| `Variant of string * yojson option ]
[@@deriving eq, show]
let test_to_yojson =
let test p... | |
05759ae1930188b29f6781e9143d239d132a1e46088176688e73670701309dd1 | takikawa/racket-ppa | info.rkt | (module info setup/infotab (#%module-begin (define collection (quote multi)) (define deps (quote ("base" "future-visualizer" "typed-racket-lib"))) (define pkg-desc "type declarations for \"future-visualizer\"") (define pkg-authors (quote (jamesswaine))) (define license (quote (Apache-2.0 OR MIT)))))
| null | https://raw.githubusercontent.com/takikawa/racket-ppa/26d6ae74a1b19258c9789b7c14c074d867a4b56b/share/pkgs/future-visualizer-typed/info.rkt | racket | (module info setup/infotab (#%module-begin (define collection (quote multi)) (define deps (quote ("base" "future-visualizer" "typed-racket-lib"))) (define pkg-desc "type declarations for \"future-visualizer\"") (define pkg-authors (quote (jamesswaine))) (define license (quote (Apache-2.0 OR MIT)))))
| |
2a7fbb8dbda22bb932ad12898f2ad3ebf1e770a4d0992cf4a2debe5739e35801 | Zulu-Inuoe/clution | setup.lisp | (defpackage #:ql-setup
(:use #:cl)
(:export #:*quicklisp-home*
#:qmerge
#:qenough))
(in-package #:ql-setup)
(unless *load-truename*
(error "This file must be LOADed to set up quicklisp."))
(defvar *quicklisp-home*
(make-pathname :name nil :type nil
:defaults *load-truen... | null | https://raw.githubusercontent.com/Zulu-Inuoe/clution/b72f7afe5f770ff68a066184a389c23551863f7f/cl-clution/systems/cl-clution/quicklisp/setup.lisp | lisp | XXX Will this have problems with stuff like threads vs
away existing ASDF methods, so e.g. FASL recompilation :around
methods would be lost. This config file will make it possible to
| (defpackage #:ql-setup
(:use #:cl)
(:export #:*quicklisp-home*
#:qmerge
#:qenough))
(in-package #:ql-setup)
(unless *load-truename*
(error "This file must be LOADed to set up quicklisp."))
(defvar *quicklisp-home*
(make-pathname :name nil :type nil
:defaults *load-truen... |
41a845ea88e655805aa8061e2f52e43a28b21e6635cd6ecfe2d80d57c42c2ea3 | erlio/vmq_webhooks | vmq_webhooks_cache.erl | Copyright 2017 Erlio GmbH Basel Switzerland ( )
%%
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, sof... | null | https://raw.githubusercontent.com/erlio/vmq_webhooks/1ffff84f954858b9c183c9e1f3f9b2675955e37f/src/vmq_webhooks_cache.erl | erlang |
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
-2.0
Unless required by applicable law or agreed to in writing, software
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing perm... | Copyright 2017 Erlio GmbH Basel Switzerland ( )
Licensed under the Apache License , Version 2.0 ( the " License " ) ;
distributed under the License is distributed on an " AS IS " BASIS ,
` auth_on_register ` , ` auth_on_publish ` and ` auth_on_subscribe ` as
-module(vmq_webhooks_cache).
-export([
ne... |
47f85c69c219ae9acf6a579a2bd3a7e8fa995da3af4b108ed2e9eeb5caed49ea | erikd/haskell-big-integer-experiment | Integer.hs |
# LANGUAGE CPP , MagicHash , NoImplicitPrelude #
-----------------------------------------------------------------------------
-- |
-- Module : Simple.GHC.Integer
Copyright : ( c ) 2007 - 2012
-- License : BSD3
--
-- Maintainer :
-- Stability : internal
Portability : non - portable ( GHC... | null | https://raw.githubusercontent.com/erikd/haskell-big-integer-experiment/7841ec3fcc5be219fa16963849bd12137112f8a9/Simple/GHC/Integer.hs | haskell | ---------------------------------------------------------------------------
|
Module : Simple.GHC.Integer
License : BSD3
Maintainer :
Stability : internal
An simple definition of the 'Integer' type.
---------------------------------------------------------------------------
XXX |
# LANGUAGE CPP , MagicHash , NoImplicitPrelude #
Copyright : ( c ) 2007 - 2012
Portability : non - portable ( GHC Extensions )
#include "MachDeps.h"
module Simple.GHC.Integer (
Integer, mkInteger,
smallInteger, wordToInteger, integerToWord, integerToInt,
#if WORD_SIZE_IN_BITS < 64
integerTo... |
ac1fb90d2fb1ad6f8772e25d69568932081aa59ae4f8e56b35422cc4f5e8c5b0 | ardumont/haskell-lab | wc.hs | module Main where
import System . IO
import System.Environment (getArgs)
import Control.Exception (catch)
import System.IO.Error (isDoesNotExistError,
ioeGetFileName)
main :: IO ()
main = Control.Exception.catch countLines handlerExc
handlerExc :: IOError -> IO ()
handlerExc e
| isDoesNotEx... | null | https://raw.githubusercontent.com/ardumont/haskell-lab/6d1f130300f33dc982c9a6b5d0b6a63af2c2666d/src/io/wc.hs | haskell | module Main where
import System . IO
import System.Environment (getArgs)
import Control.Exception (catch)
import System.IO.Error (isDoesNotExistError,
ioeGetFileName)
main :: IO ()
main = Control.Exception.catch countLines handlerExc
handlerExc :: IOError -> IO ()
handlerExc e
| isDoesNotEx... | |
6c7d2ed1bbd2c53a186133037664c8d53afa866810ccd70850937fe4179767dc | danielsz/system | quartzite.clj | (ns system.monitoring.quartzite
(:require [system.monitoring.core :as c]
[clojurewerkz.quartzite.scheduler :as s])
(:import [system.components.quartzite Scheduler]))
(extend-type Scheduler
c/Monitoring
(started? [component]
(s/started? (:scheduler component)))
(stopped? [component]
(s/shu... | null | https://raw.githubusercontent.com/danielsz/system/4c8bf677e9988eec59033b3af4352567c459b50c/src/system/monitoring/quartzite.clj | clojure | (ns system.monitoring.quartzite
(:require [system.monitoring.core :as c]
[clojurewerkz.quartzite.scheduler :as s])
(:import [system.components.quartzite Scheduler]))
(extend-type Scheduler
c/Monitoring
(started? [component]
(s/started? (:scheduler component)))
(stopped? [component]
(s/shu... | |
508bf1fe2470ad71d79e3b8d5e14b8f83b3bd2d3d06c16f954f9bae4bb223a0a | soupi/yh | SplitTexture.hs | # LANGUAGE FunctionalDependencies #
# LANGUAGE MultiParamTypeClasses #
# LANGUAGE DuplicateRecordFields #
# LANGUAGE FlexibleInstances #
# LANGUAGE TemplateHaskell #
# LANGUAGE TypeApplications #
# LANGUAGE DeriveGeneric #
{-# LANGUAGE DeriveAnyClass #-}
module DecObj.SplitTexture where
import qualified SDL
im... | null | https://raw.githubusercontent.com/soupi/yh/4cfbcc7da6f3ca5e330b7fd7d4adeacee7e2dff4/app/DecObj/SplitTexture.hs | haskell | # LANGUAGE DeriveAnyClass #
# UNPACK #
# UNPACK #
# UNPACK #
# UNPACK #
# UNPACK # | # LANGUAGE FunctionalDependencies #
# LANGUAGE MultiParamTypeClasses #
# LANGUAGE DuplicateRecordFields #
# LANGUAGE FlexibleInstances #
# LANGUAGE TemplateHaskell #
# LANGUAGE TypeApplications #
# LANGUAGE DeriveGeneric #
module DecObj.SplitTexture where
import qualified SDL
import Play.Engine.Utils
import Pl... |
851164b76a22c753d3cd29f35d21e391e797adad9ad974ec04d757b30ce8b933 | stuartsierra/flow | project.clj | (defproject com.stuartsierra/flow "0.1.1-SNAPSHOT"
:description "Function definitions derived from graph declarations"
:url ""
:license {:name "Eclipse Public License"
:url "-v10.html"}
:dependencies [[org.clojure/tools.namespace "0.2.2"]]
:profiles {:dev {:dependencies [[org.clojure/clojure "1.4.... | null | https://raw.githubusercontent.com/stuartsierra/flow/d832c2ff2af4a05ae96447e48cbc1f98376721e8/project.clj | clojure | (defproject com.stuartsierra/flow "0.1.1-SNAPSHOT"
:description "Function definitions derived from graph declarations"
:url ""
:license {:name "Eclipse Public License"
:url "-v10.html"}
:dependencies [[org.clojure/tools.namespace "0.2.2"]]
:profiles {:dev {:dependencies [[org.clojure/clojure "1.4.... | |
f07928b4d2bb1c8e0409971796835775936d652264407be15bbea0a5c50b2340 | nuvla/api-server | user_template_email_invitation.cljc | (ns sixsq.nuvla.server.resources.spec.user-template-email-invitation
(:require
[clojure.spec.alpha :as s]
[sixsq.nuvla.server.resources.spec.core :as core]
[sixsq.nuvla.server.resources.spec.user-template :as ps]
[sixsq.nuvla.server.util.spec :as su]
[spec-tools.core :as st]))
(s/def ::email
(... | null | https://raw.githubusercontent.com/nuvla/api-server/a64a61b227733f1a0a945003edf5abaf5150a15c/code/src/sixsq/nuvla/server/resources/spec/user_template_email_invitation.cljc | clojure | no good defaults for these keys, make them optional in template
expanded template must have these keys defined
Defines the contents of the password user-template resource itself.
Defines the contents of the password template used in a create resource. | (ns sixsq.nuvla.server.resources.spec.user-template-email-invitation
(:require
[clojure.spec.alpha :as s]
[sixsq.nuvla.server.resources.spec.core :as core]
[sixsq.nuvla.server.resources.spec.user-template :as ps]
[sixsq.nuvla.server.util.spec :as su]
[spec-tools.core :as st]))
(s/def ::email
(... |
78b2eac57cbf10160cc97e944d30cd0c6276b5c27c41ee8027e9a16a1bec1411 | cjohansen/dumdom | core.cljs | (ns dumdom.core
(:require [dumdom.component :as component]
[dumdom.dom :as d]
[dumdom.element :as e]
[dumdom.string :as string]
[snabbdom :as snabbdom])
(:require-macros [dumdom.core]))
(def ^:private current-nodes
"A mapping from root DOM nodes to currently render... | null | https://raw.githubusercontent.com/cjohansen/dumdom/555eacd834f215beb6311507ab17d3529a89c8a3/src/dumdom/core.cljs | clojure | The handle event function must be bound dynamically here
because the data structure containing event data to pass to
it was already built before render was called. This binding
same node as the node it is rendered into if they have the same tag
root node to have a key circumvents this problem and ensures the root
... | (ns dumdom.core
(:require [dumdom.component :as component]
[dumdom.dom :as d]
[dumdom.element :as e]
[dumdom.string :as string]
[snabbdom :as snabbdom])
(:require-macros [dumdom.core]))
(def ^:private current-nodes
"A mapping from root DOM nodes to currently render... |
cdd08ccc3f5f1adef7027e58d0ae56ca1f8288cac9ff5698a0bd4a4dd94ea8d6 | onlyshk/epmail | maildir.erl | %%%-------------------------------------------------------------------
@author < >
( C ) 2011 ,
%%% @doc
%%%
%%% @end
Created : 22 Jan 2011 by < >
%%%-------------------------------------------------------------------
-module(maildir).
-export([destroy/0]).
-export([add_user/3]).
-export([delete_user/1]... | null | https://raw.githubusercontent.com/onlyshk/epmail/d08ab8e706a44e5e3287ea4b98490447cfb94448/src/maildir.erl | erlang | -------------------------------------------------------------------
@doc
@end
-------------------------------------------------------------------
Add user in dets db
Add new user mailbox
Domain - directory mailbox
UserName - User Name of new user
Password - password for access to user mailbox
| Postgresql ... | @author < >
( C ) 2011 ,
Created : 22 Jan 2011 by < >
-module(maildir).
-export([destroy/0]).
-export([add_user/3]).
-export([delete_user/1]).
-export([create_key_value_user_pass_db/1]).
-export([check_pass/2]).
-export([find_domain/1]).
-vsn('0.3').
-author('').
-record(users, {username,
pas... |
0f4ea5015b1f2afedf826ece191ebab22ca1a067c39776cfca4acd81854db4dd | TrustInSoft/tis-kernel | GuiPanel.mli | (**************************************************************************)
(* *)
This file is part of .
(* *)
is a fork of Frama - C. Al... | null | https://raw.githubusercontent.com/TrustInSoft/tis-kernel/748d28baba90c03c0f5f4654d2e7bb47dfbe4e7d/src/plugins/wp/GuiPanel.mli | ocaml | ************************************************************************
... | This file is part of .
is a fork of Frama - C. All the differences are :
Copyright ( C ) 2016 - 2017
is released under GPLv2
This file is part of WP plug - in of Frama - C.
Copyright ( C ) 2007 - 2015 ... |
a48cd4f000ef9ceebb2b6ad967734121cc134932593a14dd386fe877a014cbd3 | emiln/cljck | color.clj | (ns cljck.color
(:import [java.awt.image BufferedImage Raster]))
(defn image->pixels
"Converts a BufferedImage into a flat sequence of pixels. A pixel is really
just an int array with 3 elements.
The 'dummy' is needed for confusing Java reasons."
[^BufferedImage image]
(let [dummy (int-array 3)
ra... | null | https://raw.githubusercontent.com/emiln/cljck/9d66ee8db964963da5a853e0389a98e442ced238/src/cljck/color.clj | clojure | (ns cljck.color
(:import [java.awt.image BufferedImage Raster]))
(defn image->pixels
"Converts a BufferedImage into a flat sequence of pixels. A pixel is really
just an int array with 3 elements.
The 'dummy' is needed for confusing Java reasons."
[^BufferedImage image]
(let [dummy (int-array 3)
ra... | |
a135f44f40b355853763e9b274818e279a38c8b33104d39a9ccc799677b4dc2b | fossas/fossa-cli | PerlSpec.hs | module Perl.PerlSpec (
spec,
) where
import Data.Aeson (decodeFileStrict')
import Data.Aeson.Extra (TextLike (..))
import Data.Map.Strict (empty, fromList)
import Data.Set (singleton)
import Data.Text (Text)
import Data.Yaml (decodeFileEither, prettyPrintParseException)
import DepTypes (
DepEnvironment (EnvDevelop... | null | https://raw.githubusercontent.com/fossas/fossa-cli/7a52ae16398eafabca9c38de76ee23cb634d71bd/test/Perl/PerlSpec.hs | haskell | module Perl.PerlSpec (
spec,
) where
import Data.Aeson (decodeFileStrict')
import Data.Aeson.Extra (TextLike (..))
import Data.Map.Strict (empty, fromList)
import Data.Set (singleton)
import Data.Text (Text)
import Data.Yaml (decodeFileEither, prettyPrintParseException)
import DepTypes (
DepEnvironment (EnvDevelop... | |
e0995e0dccc1df7bee7384b6797c1fd974c62ee6b9171a0d8786984fd2c47064 | tsloughter/kuberl | kuberl_v1_token_review_spec.erl | -module(kuberl_v1_token_review_spec).
-export([encode/1]).
-export_type([kuberl_v1_token_review_spec/0]).
-type kuberl_v1_token_review_spec() ::
#{ 'audiences' => list(),
'token' => binary()
}.
encode(#{ 'audiences' := Audiences,
'token' := Token
}) ->
#{ 'audiences' => Audienc... | null | https://raw.githubusercontent.com/tsloughter/kuberl/f02ae6680d6ea5db6e8b6c7acbee8c4f9df482e2/gen/kuberl_v1_token_review_spec.erl | erlang | -module(kuberl_v1_token_review_spec).
-export([encode/1]).
-export_type([kuberl_v1_token_review_spec/0]).
-type kuberl_v1_token_review_spec() ::
#{ 'audiences' => list(),
'token' => binary()
}.
encode(#{ 'audiences' := Audiences,
'token' := Token
}) ->
#{ 'audiences' => Audienc... | |
2204697a04b245569e8f9e87eb003b0ab0c6a51f3394bd0c827237ed15c80603 | arttuka/reagent-material-ui | vertical_shades.cljs | (ns reagent-mui.icons.vertical-shades
"Imports @mui/icons-material/VerticalShades as a Reagent component."
(:require-macros [reagent-mui.util :refer [create-svg-icon e]])
(:require [react :as react]
["@mui/material/SvgIcon" :as SvgIcon]
[reagent-mui.util]))
(def vertical-shades (create-sv... | null | https://raw.githubusercontent.com/arttuka/reagent-material-ui/c7cd0d7c661ab9df5b0aed0213a6653a9a3f28ea/src/icons/reagent_mui/icons/vertical_shades.cljs | clojure | (ns reagent-mui.icons.vertical-shades
"Imports @mui/icons-material/VerticalShades as a Reagent component."
(:require-macros [reagent-mui.util :refer [create-svg-icon e]])
(:require [react :as react]
["@mui/material/SvgIcon" :as SvgIcon]
[reagent-mui.util]))
(def vertical-shades (create-sv... | |
7208c075eb4493e0c2377eb22b8a2827b55417a3adcec36d4ec02938d3c8fbcd | namin/staged-miniKanren | fuzzer.scm | ;; using namin/faster-miniKaren branch staged
(load "../faster-miniKanren/mk-vicare.scm")
(load "../faster-miniKanren/mk.scm")
(load "staged-interp.scm")
(load "staged-utils.scm")
(load "test-check.scm")
;; n = z | s n
(define nato
(eval
(gen 'nat? '(x)
'(if (equal? 'z x)
#t
(and... | null | https://raw.githubusercontent.com/namin/staged-miniKanren/f5b665170000720f5d499ab03f31b5c55871ec4f/fuzzer.scm | scheme | using namin/faster-miniKaren branch staged
n = z | s n
l = '() | cons n l | (load "../faster-miniKanren/mk-vicare.scm")
(load "../faster-miniKanren/mk.scm")
(load "staged-interp.scm")
(load "staged-utils.scm")
(load "test-check.scm")
(define nato
(eval
(gen 'nat? '(x)
'(if (equal? 'z x)
#t
(and (pair? x)
(pair? (cdr x))
... |
83f86df65241165f94e16c42d9b1367fd24fab8d981329036f022db9240b2b9c | compiling-to-categories/concat | AdditiveFun.hs | # LANGUAGE InstanceSigs #
# LANGUAGE TupleSections #
# LANGUAGE FlexibleInstances #
{-# LANGUAGE TypeSynonymInstances #-}
# LANGUAGE FlexibleContexts #
{-# LANGUAGE ConstraintKinds #-}
# LANGUAGE CPP #
# LANGUAGE TypeFamilies #
# LANGUAGE TypeOperators #
# LANGUAGE DefaultSignatures #
# LANGUAGE ScopedTypeVariables #
#... | null | https://raw.githubusercontent.com/compiling-to-categories/concat/49e554856576245f583dfd2484e5f7c19f688028/examples/src/ConCat/AdditiveFun.hs | haskell | # LANGUAGE TypeSynonymInstances #
# LANGUAGE ConstraintKinds #
| Additive maps
| Additive homomorphisms
newtype
deriving instance Additive b => Additive (a -+> b)
Prevents some subtle non - termination errors . See 2017 - 12 - 27 journal notes .
#define OPINLINE INLINE [0]
Changed to NOINLINE [ 0 ] . See 2017 - ... | # LANGUAGE InstanceSigs #
# LANGUAGE TupleSections #
# LANGUAGE FlexibleInstances #
# LANGUAGE FlexibleContexts #
# LANGUAGE CPP #
# LANGUAGE TypeFamilies #
# LANGUAGE TypeOperators #
# LANGUAGE DefaultSignatures #
# LANGUAGE ScopedTypeVariables #
# LANGUAGE MultiParamTypeClasses #
# LANGUAGE AllowAmbiguousTypes #
# LA... |
37eb7fc18528b7796423fa0bc5113d276144bc2c6420fbe15e47d3b2347a0cd2 | awakesecurity/language-ninja | Ninja.hs | -*- coding : utf-8 ; mode : ; -*-
-- File: library/Language/Ninja/IR/Ninja.hs
--
-- License:
-- Copyright 2017 Awake Security
--
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... | null | https://raw.githubusercontent.com/awakesecurity/language-ninja/e7badf49b45d9c28b558376be3152d51f5d2d437/library/Language/Ninja/IR/Ninja.hs | haskell | File: library/Language/Ninja/IR/Ninja.hs
License:
Copyright 2017 Awake Security
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 CO... | -*- coding : utf-8 ; mode : ; -*-
Licensed under the Apache License , Version 2.0 ( the " License " ) ;
distributed under the License is distributed on an " AS IS " BASIS ,
# LANGUAGE FlexibleInstances #
# LANGUAGE KindSignatures #
# LANGUAGE MultiParamTypeClasses #
# LANGUAGE OverloadedSt... |
fb685fa65f493f866723b58c48d5de5e703d799eba49df2e4d084ca80b925649 | mokus0/junkbox | FunWithHint.hs | #!/usr/bin/env runhaskell
{-
- ``FunWithHint''
-}
module Main where
import Language.Haskell.Interpreter.GHC
import Language.Haskell.Interpreter.GHC.Unsafe
main = do
s <- newSession
hashes <- withSession s $ do
unsafeSetGhcOption "-XTemplateHaskell"
setImports ["Prelude", "Language.Hask... | null | https://raw.githubusercontent.com/mokus0/junkbox/151014bbef9db2b9205209df66c418d6d58b0d9e/Haskell/Experiments/FunWithHint.hs | haskell |
- ``FunWithHint''
using template haskell to refer to our own "unpronounceable" let-binding | #!/usr/bin/env runhaskell
module Main where
import Language.Haskell.Interpreter.GHC
import Language.Haskell.Interpreter.GHC.Unsafe
main = do
s <- newSession
hashes <- withSession s $ do
unsafeSetGhcOption "-XTemplateHaskell"
setImports ["Prelude", "Language.Haskell.TH"]
inter... |
9ee2f5667226594f0da485bf1ca109686e1f393acb066053a3268d8df3f40c27 | nominolo/lambdachine | SumNoAlloc.hs | # LANGUAGE NoImplicitPrelude , MagicHash #
-- RUN: %bc_vm_chk
CHECK : @Result@ IND - > GHC.Bool . True`con_info
module Bc.SumNoAlloc where
import GHC.Prim
import GHC.Types
loop :: Int# -> Int# -> Int#
loop acc s =
if isTrue# (s <=# 0#) then acc else
loop (acc +# s) (s -# 1#)
test = isTrue# (loop 0# 1000# ==#... | null | https://raw.githubusercontent.com/nominolo/lambdachine/49d97cf7a367a650ab421f7aa19feb90bfe14731/tests/Bc/SumNoAlloc.hs | haskell | RUN: %bc_vm_chk | # LANGUAGE NoImplicitPrelude , MagicHash #
CHECK : @Result@ IND - > GHC.Bool . True`con_info
module Bc.SumNoAlloc where
import GHC.Prim
import GHC.Types
loop :: Int# -> Int# -> Int#
loop acc s =
if isTrue# (s <=# 0#) then acc else
loop (acc +# s) (s -# 1#)
test = isTrue# (loop 0# 1000# ==# 500500#)
|
67a0d041c5007c6a2371b5f023dc3a38cc7d77a700bff16361aaf51e10bfef6c | parapluu/Concuerror | concuerror_instrumenter.erl | @private
-module(concuerror_instrumenter).
-export([instrument/3]).
-define(inspect, concuerror_inspect).
-define(flag(A), (1 bsl A)).
-define(input, ?flag(1)).
-define(output, ?flag(2)).
-define(ACTIVE_FLAGS, [?input, ?output]).
-define(DEBUG_FLAGS , lists : foldl(fun erlang:'bor'/2 , 0 , ? ) ) .
-include("... | null | https://raw.githubusercontent.com/parapluu/Concuerror/152a5ccee0b6e97d8c3329c2167166435329d261/src/concuerror_instrumenter.erl | erlang | The inspect module should never be instrumented.
Replace with form_list please.
Leave receives without after clauses unaffected, so
that the compiler can expose matched patterns to the
rest of the program
Otherwise, replace original timeout with a fresh
variable to make the after clause immediately reachable
wh... | @private
-module(concuerror_instrumenter).
-export([instrument/3]).
-define(inspect, concuerror_inspect).
-define(flag(A), (1 bsl A)).
-define(input, ?flag(1)).
-define(output, ?flag(2)).
-define(ACTIVE_FLAGS, [?input, ?output]).
-define(DEBUG_FLAGS , lists : foldl(fun erlang:'bor'/2 , 0 , ? ) ) .
-include("... |
a1d44b712da14cacdabf89bb8e96f8eea90aa8ba5d45627ae83659546779d73e | maryrosecook/islaclj | story.clj | (ns isla.story
(:use [clojure.pprint])
(:use [isla.user :only [isla-list]])
(:require [clojure.string :as str])
(:require [isla.parser :as parser])
(:require [isla.interpreter :as interpreter])
(:require [isla.story-utils :as story-utils])
(:require [mrc.utils :as utils])
(:require [isla.library :as lib... | null | https://raw.githubusercontent.com/maryrosecook/islaclj/4394ddcbd05d3d2da91c89f28e57c764bfef8d88/src/isla/story.clj | clojure | item to player
room items w/o picked up item | (ns isla.story
(:use [clojure.pprint])
(:use [isla.user :only [isla-list]])
(:require [clojure.string :as str])
(:require [isla.parser :as parser])
(:require [isla.interpreter :as interpreter])
(:require [isla.story-utils :as story-utils])
(:require [mrc.utils :as utils])
(:require [isla.library :as lib... |
115649e231ba252de868bc634e5d5d831a553a09406609a5dd87078b4b620c12 | OCamlPro/ezjs_min | table.ml | open Js
type nonrec 'a t = < > t
let obj = Unsafe.global##._Object
let create () : 'a t = new%js obj
let add (t : 'a t) (k : string) (v : 'a) = Unsafe.set t (string k) v
let add_list (t : 'a t) (l : (string * 'a) list) =
List.iter (fun (k, v) -> add t k v) l
let add_listf (t : 'b t) (f : ('a -> 'b)) (l : (strin... | null | https://raw.githubusercontent.com/OCamlPro/ezjs_min/5f30f2129fcc517954387c92388da8ff590d348b/src/table.ml | ocaml | open Js
type nonrec 'a t = < > t
let obj = Unsafe.global##._Object
let create () : 'a t = new%js obj
let add (t : 'a t) (k : string) (v : 'a) = Unsafe.set t (string k) v
let add_list (t : 'a t) (l : (string * 'a) list) =
List.iter (fun (k, v) -> add t k v) l
let add_listf (t : 'b t) (f : ('a -> 'b)) (l : (strin... | |
566b1aa9b0cf23925a140283560f8e54d3db4529eb19585f879ebba5dfa79187 | CodyReichert/qi | lisp1.lisp | ;;;; -*- lisp -*-
(in-package :it.bese.arnesi)
;;;; * Entry point
(defgeneric lisp1 (form)
(:documentation "Translate FORM from Lisp-1 to Lisp-2.
Define methods on this generic function with DEFLISP1-WALKER."))
(defmethod lisp1 (form)
"If FORM isn't a FORM object, we'll convert it to one, apply
the transformat... | null | https://raw.githubusercontent.com/CodyReichert/qi/9cf6d31f40e19f4a7f60891ef7c8c0381ccac66f/dependencies/arnesi-master/src/lisp1.lisp | lisp | -*- lisp -*-
* Entry point
* Special Variables
* Definers
* Utils
By default all forms will stay the same.
Transform the test and branches recursively.
For any function-form (ie lambda), we just transform the body.
We also must add the parameters to the variable namespace, and
remove the parameters from the f... |
(in-package :it.bese.arnesi)
(defgeneric lisp1 (form)
(:documentation "Translate FORM from Lisp-1 to Lisp-2.
Define methods on this generic function with DEFLISP1-WALKER."))
(defmethod lisp1 (form)
"If FORM isn't a FORM object, we'll convert it to one, apply
the transformation and convert it back."
(unwalk-f... |
dcbe4257dbda1047689d59a68f73694ee804aa4e40bbf5c70bc80c08ba79ad95 | yesodweb/persistent | PgIntervalTest.hs | {-# LANGUAGE EmptyDataDecls #-}
# LANGUAGE FlexibleContexts #
# LANGUAGE GADTs , DataKinds , FlexibleInstances #
# LANGUAGE GeneralizedNewtypeDeriving #
# LANGUAGE MultiParamTypeClasses #
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE QuasiQuotes ... | null | https://raw.githubusercontent.com/yesodweb/persistent/bf4c3ae430d7e7ec0351a768783d73e6bd265890/persistent-postgresql/test/PgIntervalTest.hs | haskell | # LANGUAGE EmptyDataDecls #
# LANGUAGE OverloadedStrings #
# LANGUAGE QuasiQuotes #
# LANGUAGE TemplateHaskell #
# LANGUAGE UndecidableInstances #
# LANGUAGE DerivingStrategies #
# LANGUAGE DeriveAnyClass #
picosecond resolution. Round to the nea... | # LANGUAGE FlexibleContexts #
# LANGUAGE GADTs , DataKinds , FlexibleInstances #
# LANGUAGE GeneralizedNewtypeDeriving #
# LANGUAGE MultiParamTypeClasses #
# LANGUAGE TypeFamilies #
# LANGUAGE StandaloneDeriving #
module PgIntervalTest where
import PgInit... |
bd838986113ee398a294f5741a57d79e26fd18bc48bc38e01225413480329c1a | NorfairKing/smos | Config.hs | module Smos.Config
( SmosConfig (..),
module Smos.Actions,
Map,
Matchers
listMatchers,
exactString,
combo,
exactChar,
modifiedChar,
exactKey,
exactKeyPress,
KeyPress (..),
anyChar,
catchAll,
KeyMap (..),
FileKeyMap (..),
BrowserKeyMap (..),
ReportsKeyM... | null | https://raw.githubusercontent.com/NorfairKing/smos/f72b26c2e66ab4f3ec879a1bedc6c0e8eeb18a01/smos/src/Smos/Config.hs | haskell | Report config | module Smos.Config
( SmosConfig (..),
module Smos.Actions,
Map,
Matchers
listMatchers,
exactString,
combo,
exactChar,
modifiedChar,
exactKey,
exactKeyPress,
KeyPress (..),
anyChar,
catchAll,
KeyMap (..),
FileKeyMap (..),
BrowserKeyMap (..),
ReportsKeyM... |
3f23a1b89ead4ed9fb902b592e1434e3839f9b1e9b791cf13ec3d550886a9171 | fjvallarino/monomer | BinanceTypes.hs | |
Module : BinanceTypes
Copyright : ( c ) 2018
License : BSD-3 - Clause ( see the LICENSE file )
Maintainer :
Stability : experimental
Portability : non - portable
Types for the Binance Exchange in the ' Ticker ' example .
Module : BinanceTypes
Copyright : (c) 2018 Francisc... | null | https://raw.githubusercontent.com/fjvallarino/monomer/5d70174e6290cebf2ff3dfbce62f833b3306d16d/examples/ticker/BinanceTypes.hs | haskell | # LANGUAGE DeriveAnyClass # | |
Module : BinanceTypes
Copyright : ( c ) 2018
License : BSD-3 - Clause ( see the LICENSE file )
Maintainer :
Stability : experimental
Portability : non - portable
Types for the Binance Exchange in the ' Ticker ' example .
Module : BinanceTypes
Copyright : (c) 2018 Francisc... |
e4880dec4c1f07a47a64cff4eb0f81167bba1666496272c40c116f70691b4a03 | minoki/haskell-floating-point | Float128Spec.hs | # LANGUAGE CPP #
# LANGUAGE HexFloatLiterals #
# LANGUAGE ScopedTypeVariables #
# OPTIONS_GHC -Wno - orphans #
module Float128Spec where
import AugmentedArithSpec (augmentedAddition_viaRational,
augmentedMultiplication_viaRational)
import qualified AugmentedArithSpec
impor... | null | https://raw.githubusercontent.com/minoki/haskell-floating-point/7d7bb31bb2b07c637a5eaeda92fc622566e9b141/fp-ieee/test/Float128Spec.hs | haskell | orphan instances
Float128:
TODO: avoid overflow
TODO: Add more | # LANGUAGE CPP #
# LANGUAGE HexFloatLiterals #
# LANGUAGE ScopedTypeVariables #
# OPTIONS_GHC -Wno - orphans #
module Float128Spec where
import AugmentedArithSpec (augmentedAddition_viaRational,
augmentedMultiplication_viaRational)
import qualified AugmentedArithSpec
impor... |
f385d331e12c7852960c401f66c5adea183eb2222c8d3086e35193b03449ca68 | tilk/yieldfsm | RefreshFunctions.hs | |
Copyright : ( C ) 2022 : BSD2 ( see the file LICENSE )
Maintainer : < >
This module defines a function name refreshing transformation .
Copyright : (C) 2022 Marek Materzok
License : BSD2 (see the file LICENSE)
Maintainer : Marek Materzok <>
This module defines a function name refre... | null | https://raw.githubusercontent.com/tilk/yieldfsm/bf86708eab22faec90c63cb15b0ac94c7005724b/src/FSM/Process/RefreshFunctions.hs | haskell | |
Refreshes all function names. This is useful before lambda-lifting, which
puts every function into a single namespace.
| |
Copyright : ( C ) 2022 : BSD2 ( see the file LICENSE )
Maintainer : < >
This module defines a function name refreshing transformation .
Copyright : (C) 2022 Marek Materzok
License : BSD2 (see the file LICENSE)
Maintainer : Marek Materzok <>
This module defines a function name refre... |
aa50ca9b56cf16ab72883485f77d01b43fe6ef4b7b6c20930797a423db3b3393 | mgritter/aoc-lh | Main.hs | module Main (main) where
-- {-@ LIQUID "--no-termination" @-}
import LoadLines
import Valve
import qualified Data.Map as Map
import qualified Data.Set as Set
import Data.Sort
import Data.Either
import Data.Maybe
import Control.Exception
type Cavern = Map.Map String Valve
makeCavern :: [Valve] -> Cavern
makeCavern vs... | null | https://raw.githubusercontent.com/mgritter/aoc-lh/279fdd72f8b0e0d136e4f49dd829d0fd942a7915/2022/day16/Main.hs | haskell | {-@ LIQUID "--no-termination" @-}
projected value based on valves already opened
valves visited since last open
Using timeRemaining for termination checking was giving bad results.
(at least, I guess that is the part that the termination checker could not prove.)
@ tr :: SearchState -> Nat @
@ measure tr @
Best-f... | module Main (main) where
import LoadLines
import Valve
import qualified Data.Map as Map
import qualified Data.Set as Set
import Data.Sort
import Data.Either
import Data.Maybe
import Control.Exception
type Cavern = Map.Map String Valve
makeCavern :: [Valve] -> Cavern
makeCavern vs = Map.fromList (map (\v -> (name v, ... |
64b972f1b48174550d25ae464a657583625ed8e386922998c6616cca2e1a001d | glv2/cl-monero-tools | multisig.lisp | ;;;; This file is part of monero-tools
Copyright 2018
Distributed under the GNU GPL v3 or later .
;;;; See the file LICENSE for terms of use and distribution.
(in-package :monero-tools)
(define-constant +multisig-salt+ (map 'octet-vector #'char-code '(#\M #\u #\l #\t #\i #\s #\i #\g
... | null | https://raw.githubusercontent.com/glv2/cl-monero-tools/ab972ac3a7c5489cf23e3bdaa5d390d5cff1732b/monero-tools/crypto/multisig.lisp | lisp | This file is part of monero-tools
See the file LICENSE for terms of use and distribution. | Copyright 2018
Distributed under the GNU GPL v3 or later .
(in-package :monero-tools)
(define-constant +multisig-salt+ (map 'octet-vector #'char-code '(#\M #\u #\l #\t #\i #\s #\i #\g
#\nul #\nul #\nul #\nul #\nul
... |
c473a0cc677202e869bd8e2ebfd6dd10503334369bbac69e8dfd75e2fa7863c6 | MLanguage/mlang | format_mir.mli | Copyright ( C ) 2019 - 2021 Inria , contributor :
< >
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 ) any later
... | null | https://raw.githubusercontent.com/MLanguage/mlang/146ceccf3d70525f5a2644d8ac3b0e1d4aedca50/src/mlang/m_ir/format_mir.mli | ocaml | Copyright ( C ) 2019 - 2021 Inria , contributor :
< >
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 ) any later
... | |
fff8946ddaf94ad5292d84a34218ce20344335cfae482eb211596e080555121b | haskell-github/github | ShowIssueEvents.hs | module ShowIssueEvents where
import qualified Github.Issues.Events as Github
import Data.List (intercalate)
main = do
possibleEvents <- Github.eventsForIssue "thoughtbot" "paperclip" 49
case possibleEvents of
(Left error) -> putStrLn $ "Error: " ++ show error
(Right events) -> do
putStrLn "... | null | https://raw.githubusercontent.com/haskell-github/github/81d9b658c33a706f18418211a78d2690752518a4/samples/Issues/Events/ShowIssueEvents.hs | haskell | module ShowIssueEvents where
import qualified Github.Issues.Events as Github
import Data.List (intercalate)
main = do
possibleEvents <- Github.eventsForIssue "thoughtbot" "paperclip" 49
case possibleEvents of
(Left error) -> putStrLn $ "Error: " ++ show error
(Right events) -> do
putStrLn "... | |
4e194b3be991a6a3584d2fd6d94be489c4d80e421a86c15f26cee542278cabdc | emqx/emqx | emqx_persistent_session.erl | %%--------------------------------------------------------------------
Copyright ( c ) 2021 - 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/dbc10c2eed3df314586c7b9ac6292083204f1f68/apps/emqx/src/persistent_session/emqx_persistent_session.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 ) 2021 - 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_persistent_session).
-export([
is_store_enabled/0,
init_db_backend/0,
... |
baef29c5a4954b82c4a03be3e00f3d900b21f2b2f93a5a5f7a9803c0d2c2da7c | ucsd-progsys/liquidhaskell | Local00.hs | module Local00 where
@ foo : : @
foo = incr 10
where
@ incr : : @
incr :: Int -> Int
incr x = x + 1
@ globalThing : : @
globalThing :: Int -> Int
globalThing x = x + 1
| null | https://raw.githubusercontent.com/ucsd-progsys/liquidhaskell/20cd67af038930cb592d68d272c8eb1cbe3cb6bf/tests/names/pos/Local00.hs | haskell | module Local00 where
@ foo : : @
foo = incr 10
where
@ incr : : @
incr :: Int -> Int
incr x = x + 1
@ globalThing : : @
globalThing :: Int -> Int
globalThing x = x + 1
| |
8cdcc32baf3f74d2221d0579f60b60a16b9eb24f45bcd9bc148442998c31db27 | amnh/PCG | ScriptTests.hs | ------------------------------------------------------------------------------
-- |
Module : TestSuite . ScriptTests
Copyright : ( c ) 2015 - 2021 Ward Wheeler
-- License : BSD-style
--
-- Maintainer :
-- Stability : provisional
-- Portability : portable
--
---------------------------------... | null | https://raw.githubusercontent.com/amnh/PCG/9341efe0ec2053302c22b4466157d0a24ed18154/test/TestSuite/ScriptTests.hs | haskell | ----------------------------------------------------------------------------
|
License : BSD-style
Maintainer :
Stability : provisional
Portability : portable
---------------------------------------------------------------------------
# LANGUAGE OverloadedStrings #
# LANGUAGE Strict #
# LA... | Module : TestSuite . ScriptTests
Copyright : ( c ) 2015 - 2021 Ward Wheeler
# LANGUAGE FlexibleContexts #
# LANGUAGE Rank2Types #
module TestSuite.ScriptTests
( commandTestSuite
, costTestSuite
, failureTestSuite
) where
import Bio.Graph
import Bio.Graph.Referen... |
4f8e8078237aa8db749e18753a8667ab0e70425c928d6f668e12519f1e62852a | diku-dk/futhark | Benchcmp.hs | -- | @futhark benchcmp@
module Futhark.CLI.Benchcmp (main) where
import Control.Exception (catch)
import Data.Bifunctor (Bifunctor (bimap, first, second))
import Data.ByteString.Lazy.Char8 qualified as LBS
import Data.Either qualified as E
import Data.List qualified as L
import Data.Map qualified as M
import Data.Text... | null | https://raw.githubusercontent.com/diku-dk/futhark/48bea2cc8c62cae59b391ddba162cdc8f915bdd9/src/Futhark/CLI/Benchcmp.hs | haskell | | @futhark benchcmp@
| What factor the benchmark is improved by.
| Memory usage.
| If the speedup was significant.
| Terminal colors used when printing the comparisons. Some of these are not
colors ways of emphasising text.
| The header color.
| Okay color
| Warning color.
| When something fails.
| Default c... | module Futhark.CLI.Benchcmp (main) where
import Control.Exception (catch)
import Data.Bifunctor (Bifunctor (bimap, first, second))
import Data.ByteString.Lazy.Char8 qualified as LBS
import Data.Either qualified as E
import Data.List qualified as L
import Data.Map qualified as M
import Data.Text qualified as T
import D... |
c6d0940b45ddfb44a0d4df09aa09df1047e6a212b6ffeae34dd83c32bab23148 | graninas/Functional-Design-and-Architecture | Control.hs | {-# LANGUAGE GADTs #-}
module Andromeda.Simulator.Control where
import qualified Andromeda.LogicControl.Domain as T
import qualified Andromeda.LogicControl.Language as L
import qualified Andromeda.Simulator.Runtime as SimImpl
import qualified Andromeda.Simulator.Hardware.Device as SimImpl
import qualified Andromeda.... | null | https://raw.githubusercontent.com/graninas/Functional-Design-and-Architecture/b6a78f80a2a2e0b913bcab1d2279fc137a90db4c/Second-Edition-Manning-Publications/BookSamples/CH08/Section8p1/src/Andromeda/Simulator/Control.hs | haskell | # LANGUAGE GADTs # |
module Andromeda.Simulator.Control where
import qualified Andromeda.LogicControl.Domain as T
import qualified Andromeda.LogicControl.Language as L
import qualified Andromeda.Simulator.Runtime as SimImpl
import qualified Andromeda.Simulator.Hardware.Device as SimImpl
import qualified Andromeda.Simulator.Hardware.Inte... |
ee59af82c559b299804619c1d6ad60ef81cb494cae79bc17487926784da6dc15 | GaloisInc/curl | Opts.hs | --------------------------------------------------------------------
-- |
-- Module : Network.Curl.Opts
Copyright : ( c ) Galois Inc 2007 - 2009
-- License : BSD3
--
-- Maintainer: Sigbjorn Finne <>
-- Stability : provisional
-- Portability: portable
--
-- This module contains the various options that specify wh... | null | https://raw.githubusercontent.com/GaloisInc/curl/185c5370fc5ee7bd6b5e75d9a90033932b4afe71/Network/Curl/Opts.hs | haskell | ------------------------------------------------------------------
|
Module : Network.Curl.Opts
License : BSD3
Maintainer: Sigbjorn Finne <>
Stability : provisional
Portability: portable
This module contains the various options that specify what happens
----------------------------------------------------... | Copyright : ( c ) Galois Inc 2007 - 2009
when we use @perform@ on a @Curl@ handle .
module Network.Curl.Opts where
import Network.Curl.Types
import Network.Curl.Post
import Data.List
import Foreign.Ptr
import Foreign.C.Types
import Data.Bits
data CurlOption
^ number of seconds before timing out curl operation\... |
2fc40f82920a29bf2e1902ed1b5c33787809dfedc96928f8c14cbf1cdb97f7da | backtracking/ocamlgraph | xDotDraw.mli | (**************************************************************************)
(* *)
(* This file is part of OcamlGraph. *)
(* *)
Copyright... | null | https://raw.githubusercontent.com/backtracking/ocamlgraph/1c028af097339ca8bc379436f7bd9477fa3a49cd/src/xDotDraw.mli | ocaml | ************************************************************************
This file is part of OcamlGraph.
... | Copyright ( C ) 2009 - 2010
CEA ( Commissariat � l' � )
Lesser General Public License as published by the Free Software
Foundation , version 2.1 , with a linking exception .
( ) ... |
bca8d146edcd41bfa6094dfcec5be93552af81a4d0f915485a8583d5c2394010 | ericcervin/getting-started-with-sketching | pg025b.rkt | #lang sketching
(define (setup)
(size 480 120)
(smoothing 'smoothed)
(background 200)
(no-loop)
)
(define (draw)
(fill 153)
(ellipse 132 82 200 200)
(no-fill)
(ellipse 228 -16 200 200)
(no-stroke)
(ellipse 268 118 200 200)
)
| null | https://raw.githubusercontent.com/ericcervin/getting-started-with-sketching/0f0e75f3e7e9d18aaa13cda70541cfe3e3f5550d/pg025b.rkt | racket | #lang sketching
(define (setup)
(size 480 120)
(smoothing 'smoothed)
(background 200)
(no-loop)
)
(define (draw)
(fill 153)
(ellipse 132 82 200 200)
(no-fill)
(ellipse 228 -16 200 200)
(no-stroke)
(ellipse 268 118 200 200)
)
| |
f346e7a05647d6e87e172c03600aa500d93c0fead0b575a0bb0ec13312f3829a | reactiveml/rml | dragnDrop.ml | type drag_events = {
mutable ondragstart : Dom_html.dragEvent Js.t -> bool Js.t;
mutable ondragover : Dom_html.dragEvent Js.t -> bool Js.t;
mutable ondragend : Dom_html.dragEvent Js.t -> bool Js.t;
mutable ondrop : Dom_html.dragEvent Js.t -> bool Js.t;
mutable ondragleave : Dom_html.dragEvent Js.t -> ... | null | https://raw.githubusercontent.com/reactiveml/rml/d178d49ed923290fa7eee642541bdff3ee90b3b4/toplevel-alt/js/dragnDrop.ml | ocaml | type drag_events = {
mutable ondragstart : Dom_html.dragEvent Js.t -> bool Js.t;
mutable ondragover : Dom_html.dragEvent Js.t -> bool Js.t;
mutable ondragend : Dom_html.dragEvent Js.t -> bool Js.t;
mutable ondrop : Dom_html.dragEvent Js.t -> bool Js.t;
mutable ondragleave : Dom_html.dragEvent Js.t -> ... | |
abf1a42d5cf7f58ae3dd6fee0c9ad874ac3688f3412d21b2cf601f35c0c6a3e7 | kronkltd/jiksnu | conversation_transforms_test.clj | (ns jiksnu.transforms.conversation-transforms-test
(:require [clj-factory.core :refer [factory]]
[jiksnu.modules.core.actions.feed-source-actions :as actions.feed-source]
[jiksnu.mock :as mock]
[jiksnu.test-helper :as th]
[jiksnu.transforms.conversation-transforms :refe... | null | https://raw.githubusercontent.com/kronkltd/jiksnu/8c91e9b1fddcc0224b028e573f7c3ca2f227e516/test/jiksnu/transforms/conversation_transforms_test.clj | clojure | This is set by the other transform | (ns jiksnu.transforms.conversation-transforms-test
(:require [clj-factory.core :refer [factory]]
[jiksnu.modules.core.actions.feed-source-actions :as actions.feed-source]
[jiksnu.mock :as mock]
[jiksnu.test-helper :as th]
[jiksnu.transforms.conversation-transforms :refe... |
778757900f80275e395196dfaf919061ffb24f18a8ff3a8914cbbf7e56bbcdf7 | rescript-lang/rescript-compiler | js_reserved_map.ml |
Copyright ( C ) 2019 - Present , Authors of ReScript
*
* This program is free software : you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation , either version 3 of the License , or
* ( at your option ) any ... | null | https://raw.githubusercontent.com/rescript-lang/rescript-compiler/bae82e1ddd265e5c8886ce1a6527e031d95416ed/jscomp/ext/js_reserved_map.ml | ocaml | let c = cmp key midVal [@bs] in
a[lo] =< key < a[mid] <= a[hi]
a[lo] =< a[mid] < key <= a[hi]
let c = cmp key lo [@bs] in
let c2 = cmp key hi [@bs]in |
Copyright ( C ) 2019 - Present , Authors of ReScript
*
* This program is free software : you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation , either version 3 of the License , or
* ( at your option ) any ... |
3f367efe7ab9c0d0646f9e14079668a0d5de98e1bb340ec1250b8ed0cd1a5a58 | HealthSamurai/dojo.clj | openid.cljs | (ns zframes.openid
(:require
[re-frame.core :as rf]
[clojure.string :as str]
[goog.crypt.base64 :refer [encodeString decodeString]]))
(defn parse-id-token [jwt]
(let [[header payload sig] (str/split jwt ".")]
(js->clj (.parse js/JSON (js/atob payload))
:keywordize-keys true)))
(defn chec... | null | https://raw.githubusercontent.com/HealthSamurai/dojo.clj/94922640f534897ab2b181c608b54bfbb8351d7b/ui/src/zframes/openid.cljs | clojure | (ns zframes.openid
(:require
[re-frame.core :as rf]
[clojure.string :as str]
[goog.crypt.base64 :refer [encodeString decodeString]]))
(defn parse-id-token [jwt]
(let [[header payload sig] (str/split jwt ".")]
(js->clj (.parse js/JSON (js/atob payload))
:keywordize-keys true)))
(defn chec... | |
603481065998fb2d6673f27985b3d5c8bad49af0e2b37f926b804a6d69f30307 | VisionsGlobalEmpowerment/webchange | handler.clj | (ns webchange.common.handler
(:require [buddy.auth :refer [authenticated? throw-unauthorized]]))
(defn handle
([result]
(let [[ok? data] result]
{:status (if ok? 200 400) :body data}))
([result on-success]
(let [[ok? data] result
response {:status (if ok? 200 400) :body data}]
(if ok?
... | null | https://raw.githubusercontent.com/VisionsGlobalEmpowerment/webchange/d0c06e16d80cda2e7fa1c9a2c292e298fffcf028/src/clj/webchange/common/handler.clj | clojure | (ns webchange.common.handler
(:require [buddy.auth :refer [authenticated? throw-unauthorized]]))
(defn handle
([result]
(let [[ok? data] result]
{:status (if ok? 200 400) :body data}))
([result on-success]
(let [[ok? data] result
response {:status (if ok? 200 400) :body data}]
(if ok?
... | |
2d369fa59c55d4cf90e83afb9ea202b3fda1f0780d001acc78f29615c20f8d29 | juxt/joplin | 0001.clj | (ns migrators.jdbc.extrapath.0001
(:use [clojure.java.jdbc.deprecated :as sql]))
(defn up [db]
(sql/with-connection db
(sql/create-table :test_table_2
[:id "INT"])))
(defn down [db]
(sql/with-connection db
(sql/drop-table :test_table_2)))
| null | https://raw.githubusercontent.com/juxt/joplin/d190f883c47b11efafc5154237a80d36af0087d3/example/joplin/migrators/jdbc/extrapath/0001.clj | clojure | (ns migrators.jdbc.extrapath.0001
(:use [clojure.java.jdbc.deprecated :as sql]))
(defn up [db]
(sql/with-connection db
(sql/create-table :test_table_2
[:id "INT"])))
(defn down [db]
(sql/with-connection db
(sql/drop-table :test_table_2)))
| |
ea75f45f94a1cf402907e97e0c5072909bb0b8752b06ac7e835d3a9b940c2ee1 | chaw/r7rs-libs | disjoint-set-test.sps |
(import (scheme base)
(robin disjoint-set)
(srfi 64)
(scheme comparator))
(test-begin "robin-disjoint-set")
(let ((ds (make-disjoint-set eq? default-hash)))
(test-equal 0 (disjoint-set:size ds)) ; starts empty
(disjoint-set:make ds 'a)
(test-equal 1 (disjoint-set:size ds))
(disjoint-s... | null | https://raw.githubusercontent.com/chaw/r7rs-libs/b8b625c36b040ff3d4b723e4346629a8a0e8d6c2/robin-tests/disjoint-set-test.sps | scheme | starts empty
representative item for (a b) either a or b
representative item for (a b) either a or b
item not found
item not found with default |
(import (scheme base)
(robin disjoint-set)
(srfi 64)
(scheme comparator))
(test-begin "robin-disjoint-set")
(let ((ds (make-disjoint-set eq? default-hash)))
(disjoint-set:make ds 'a)
(test-equal 1 (disjoint-set:size ds))
(disjoint-set:make ds 'b)
(test-equal 2 (disjoint-set:size ds))
... |
2ccb13761eed60ec93bc52383c0545da1ab8b848b239021968d1ffce5a6beda5 | sanette/bogue | b_update.ml | (* This is where we store the widgets that receive the update event *)
(* similar to Sync.ml but we make sure there is no repeated entries in the
queue *)
(* see: examples/chain *)
(* TODO à vider en sortant ? *)
ou à attacher à la board ?
open B_utils
module Widget = B_widget
module Var = B_var
module Trigger... | null | https://raw.githubusercontent.com/sanette/bogue/0ba3637108ea8355e05e86251fd45ebee38a1c7f/lib/b_update.ml | ocaml | This is where we store the widgets that receive the update event
similar to Sync.ml but we make sure there is no repeated entries in the
queue
see: examples/chain
TODO à vider en sortant ?
OK??
Optimization (?) we don't want to reset the table to
[] if it was already empty
we keep the wi... |
ou à attacher à la board ?
open B_utils
module Widget = B_widget
module Var = B_var
module Trigger = B_trigger
let str = Printf.sprintf
let table : (Widget.t list) Var.t = Var.create []
let is_empty () =
Var.get table = []
let clear () =
if not (is_empty ()) then
begin
printd debug_warning "Th... |
fdb0e76511d4b136c0df4548ca3bf7d232cae0bfc65dedb2d00835f0959b4304 | acieroid/scala-am | indexer15.scm | (let* ((size 128)
(max 4)
(table (atom (make-vector size 0)))
(thread (lambda (tid)
(letrec ((hash (lambda (w) (modulo (* w 7) size)))
(process (lambda (m)
(if (< m max)
(letrec ((w (+ (*... | null | https://raw.githubusercontent.com/acieroid/scala-am/13ef3befbfc664b77f31f56847c30d60f4ee7dfe/test/concurrentScheme/futures/variations/indexer15.scm | scheme | (let* ((size 128)
(max 4)
(table (atom (make-vector size 0)))
(thread (lambda (tid)
(letrec ((hash (lambda (w) (modulo (* w 7) size)))
(process (lambda (m)
(if (< m max)
(letrec ((w (+ (*... | |
400c07a0321d5fbcef64d2b97c979669f3b5cfb50ac3d0dfc9b961e1f2f7bdde | binsec/haunted | network_io.mli | (**************************************************************************)
This file is part of BINSEC .
(* *)
Copyright ( C ) 2016 - 2019
CEA ( Co... | null | https://raw.githubusercontent.com/binsec/haunted/7ffc5f4072950fe138f53fe953ace98fff181c73/src/utils/network_io.mli | ocaml | ************************************************************************
alternatives)
you can redistribute it an... | This file is part of BINSEC .
Copyright ( C ) 2016 - 2019
CEA ( Commissariat à l'énergie atomique et aux énergies
Lesser General Public License as published by the Free Software
Foundation , ve... |
2c192202be131a83d4ac1f2291a175fbab908308a2db973b1a604165cce26567 | mtgred/netrunner | nrdb.clj | (ns web.nrdb
(:require [cheshire.core :as json]
[monger.collection :as mc]
[monger.operators :refer :all]
[org.httpkit.client :as http]
[clj-uuid :as uuid]
[clojure.string :as str]))
(def nrdb-decklist-url "/")
(def nrdb-readable-url "/")
(defn- parse-inpu... | null | https://raw.githubusercontent.com/mtgred/netrunner/f2f986cb24188dc9b40ce1e5dad6d92f7b757a8a/src/clj/web/nrdb.clj | clojure | (ns web.nrdb
(:require [cheshire.core :as json]
[monger.collection :as mc]
[monger.operators :refer :all]
[org.httpkit.client :as http]
[clj-uuid :as uuid]
[clojure.string :as str]))
(def nrdb-decklist-url "/")
(def nrdb-readable-url "/")
(defn- parse-inpu... | |
ef61311de8abac1842e68729f5ac3c499c44d6340ddd954fae7c753e3e089715 | deverl-ide/deverl | deverl_log_out_wx.erl | %% =====================================================================
%% 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) any later vers... | null | https://raw.githubusercontent.com/deverl-ide/deverl/69216c7720ce2a32344711f5526c0eb9676bcae0/deverl/src/deverl_log_out_wx.erl | erlang | =====================================================================
This program is free software: you can redistribute it and/or modify
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTAB... | it under the terms of the GNU General Public License as published by
the Free Software Foundation , either version 3 of the License , or
You should have received a copy of the GNU General Public License
@author < >
@author < >
, 2014
-module(deverl_log_out_wx).
-include_lib("wx/include/wx.hrl")... |
fbd7d40c39116d9e575665eaf21398268bab3b7baf75a48e2d8d945fc5dbbbfb | maranget/hevea | mylib.mli | (***********************************************************************)
(* *)
(* HEVEA *)
(* *)
, projet PARA , INR... | null | https://raw.githubusercontent.com/maranget/hevea/226eac8c506f82a600d453492fbc1b9784dd865f/mylib.mli | ocaml | *********************************************************************
HEVEA
... | , projet PARA , INRIA Rocquencourt
Copyright 1998 Institut National de Recherche en Informatique et
Automatique . Distributed only by permission .
val static_libdir : string
val libdir : string
|
cd953cd33ae873adc9b1f4c96aaaf7c07648cac28018065300e29297466d11ba | Chris00/ocaml-mindstorm | mindstorm.mli | File : mindstorm.mli
Copyright ( C ) 2007-
< >
WWW : /
This library is free software ; you can redistribute it and/or modify
it under the terms of the GNU General Public License version 2.1 or
later as published by the Free Software Foundation , with the special
exception ... | null | https://raw.githubusercontent.com/Chris00/ocaml-mindstorm/a96ea45059cafd136c98190674b6214f03357cf8/src/mindstorm.mli | ocaml | File : mindstorm.mli
Copyright ( C ) 2007-
< >
WWW : /
This library is free software ; you can redistribute it and/or modify
it under the terms of the GNU General Public License version 2.1 or
later as published by the Free Software Foundation , with the special
exception ... | |
379e17d799e1d47c1c57285f366948199eefaa19cbe561fbb725a48008a6cd66 | clj-commons/useful | macro_test.clj | (ns flatland.useful.macro-test
(:use clojure.test flatland.useful.macro))
;; necessary because deftest does weird shit with namespaces, resolution, and
;; macroexpansion, so this can't be inside there
(let [strip-extraneous-do (fn [form]
(->> form
(iterate... | null | https://raw.githubusercontent.com/clj-commons/useful/dc5cdebf8983a2e2ea24ec8951fbb4dfb037da45/test/flatland/useful/macro_test.clj | clojure | necessary because deftest does weird shit with namespaces, resolution, and
macroexpansion, so this can't be inside there | (ns flatland.useful.macro-test
(:use clojure.test flatland.useful.macro))
(let [strip-extraneous-do (fn [form]
(->> form
(iterate second)
(drop-while (comp #{`do} first))
first))
expan... |
9d967285beae3484449ef93e802bc3afafbc45783da47be7731520d570ec93d4 | tsoding/kgbotka | Log.hs | # LANGUAGE FlexibleInstances #
module KGBotka.Log
( loggingThread
, LogEntry(..)
, ProvidesLogging(..)
) where
import Control.Concurrent
import Control.Concurrent.STM
import qualified Data.Text as T
import Data.Time
import KGBotka.Queue
import System.IO
import Text.Printf
-- NOTE: the Tag is use to indicate ... | null | https://raw.githubusercontent.com/tsoding/kgbotka/67278a93611b0abe4e07df7967559884263147aa/src/KGBotka/Log.hs | haskell | NOTE: the Tag is use to indicate the "subsystem" where the event
is prefered to capitalize them.
to prevent busy looping | # LANGUAGE FlexibleInstances #
module KGBotka.Log
( loggingThread
, LogEntry(..)
, ProvidesLogging(..)
) where
import Control.Concurrent
import Control.Concurrent.STM
import qualified Data.Text as T
import Data.Time
import KGBotka.Queue
import System.IO
import Text.Printf
has happened . Examples are " TWIT... |
3ed505d6ca0790d1d5ef4c568af98a82640fde07acd57c0e3f08ac10d65d578c | jackfirth/rebellion | base.rkt | #lang racket/base
(require racket/contract/base)
(provide
(contract-out
[record-type
(->* (interned-symbol? keyset?)
(#:predicate-name (or/c interned-symbol? #f)
#:constructor-name (or/c interned-symbol? #f)
#:accessor-name (or/c interned-symbol? #f))
record-type?)]
[record-t... | null | https://raw.githubusercontent.com/jackfirth/rebellion/64f8f82ac3343fe632388bfcbb9e537759ac1ac2/type/record/base.rkt | racket | @------------------------------------------------------------------------------ | #lang racket/base
(require racket/contract/base)
(provide
(contract-out
[record-type
(->* (interned-symbol? keyset?)
(#:predicate-name (or/c interned-symbol? #f)
#:constructor-name (or/c interned-symbol? #f)
#:accessor-name (or/c interned-symbol? #f))
record-type?)]
[record-t... |
1d11fdc107b2254d81e0446110bd5f576631c42b617c58cf03df37d84dea9ac3 | dizengrong/erlang_game | role_loop.erl | @author dzR < >
%% @doc 玩家的循环
-module (role_loop).
-include ("log.hrl").
-include ("common.hrl").
-export ([one_second_loop/2]).
%% @doc 玩家的每秒循环
one_second_loop(RoleId, NowSeconds) ->
try
?_IF(NowSeconds rem 3 == 0, item_life:check_lifetime(RoleId, NowSeconds)),
ok
catch
Type:Reason -> ?PRINT_STACKTRACE(o... | null | https://raw.githubusercontent.com/dizengrong/erlang_game/4598f97daa9ca5eecff292ac401dd8f903eea867/gerl/src/map_srv/logic/role_loop.erl | erlang | @doc 玩家的循环
@doc 玩家的每秒循环 | @author dzR < >
-module (role_loop).
-include ("log.hrl").
-include ("common.hrl").
-export ([one_second_loop/2]).
one_second_loop(RoleId, NowSeconds) ->
try
?_IF(NowSeconds rem 3 == 0, item_life:check_lifetime(RoleId, NowSeconds)),
ok
catch
Type:Reason -> ?PRINT_STACKTRACE(one_second_loop, Type, Reason)
... |
270d7c11c80131464c6002c6b3067248f1c2a079beb93132965dd52c52ed2cd7 | shirok/Gauche-tk | button.scm | ;; simple button example
(use tk)
(tk-init '())
(tk-button '.b :text "Click me" :command (^[] (print "Yeah!")))
(tk-pack '.b)
(tk-mainloop)
| null | https://raw.githubusercontent.com/shirok/Gauche-tk/c11b51353871174d5b9e380120e0634633a340b6/examples/button.scm | scheme | simple button example |
(use tk)
(tk-init '())
(tk-button '.b :text "Click me" :command (^[] (print "Yeah!")))
(tk-pack '.b)
(tk-mainloop)
|
9537d9e1226917a9f0a24c206861c92811b92283258babcca8d28abf4db254f3 | khasm-lang/khasmc | parser.ml | type token =
| T_IDENT of string
| T_FIDENT of string
| T_INT of string
| T_FLOAT of string
| T_STRING of string
| INTIDENT of string
| INTEXTERN
| TRUE
| FALSE
| ADD
| SUB
| MUL
| SLASH
| BSLASH
| STRAIGHT
| AND
| DOT
| PERCENT
| AT
| HASH
| GT
| LT
| COMMA
| BANG
| EQ... | null | https://raw.githubusercontent.com/khasm-lang/khasmc/e190cad60ba66e701ad0ae9d288ddb9a55e63a12/lib/frontend/parser.ml | ocaml | type token =
| T_IDENT of string
| T_FIDENT of string
| T_INT of string
| T_FLOAT of string
| T_STRING of string
| INTIDENT of string
| INTEXTERN
| TRUE
| FALSE
| ADD
| SUB
| MUL
| SLASH
| BSLASH
| STRAIGHT
| AND
| DOT
| PERCENT
| AT
| HASH
| GT
| LT
| COMMA
| BANG
| EQ... | |
b5df36587da645a90be13b373e611116ca3a2742435700f69486daccf5bacd00 | takikawa/racket-ppa | counter.rkt | #lang racket
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Rate a move by a combination of counting strategies
;;
;; This code benefits greatly from racket compilation.
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(require "board.rkt"
"utils.rkt")
(provide params^
... | null | https://raw.githubusercontent.com/takikawa/racket-ppa/d336bb10e3e0ec3a20020e9ade9e77d2f6f80b6d/share/pkgs/games/pousse/counter.rkt | racket |
Rate a move by a combination of counting strategies
This code benefits greatly from racket compilation.
Go down columns
Go across rows
Counted usses and thems twice
If it's early in the game, bias towards the middle
We'd prefer to get rid of thems and not get rid of usses
Working towards connected parts is... | #lang racket
(require "board.rkt"
"utils.rkt")
(provide params^
up-to^
counter@)
(define-signature params^
(US-PIECE-WEIGHT
US-MIDDLE-PIECE-WEIGHT
US-LINE-PIECE-WEIGHT
US-CONNECT-PIECE-WEIGHT
THEM-PIECE-WEIGHT
THEM-MIDDLE-PIECE-WEIGHT
THEM-LINE-PIECE-WEIGHT
THEM-... |
22b2fa7f02521ad599feab675a4830771eced34cdaeb30fb5c695497b006e7e7 | AeroNotix/lispkit | keys.lisp | (in-package #:lispkit-test)
(plan 6)
(let ((keymap (lispkit::make-keymap)))
(is-type keymap 'lispkit::keymap)
(is-type (lispkit::bindings keymap) 'hash-table))
(let ((keybind (lispkit::keymap->keydesc* nil "foo" nil)))
(is-type keybind 'lispkit::keybind)
(is "foo" (lispkit::key keybind)))
(is "foo foo"
... | null | https://raw.githubusercontent.com/AeroNotix/lispkit/2482dbeabc79667407dabe7765dfbffc16584b08/test/keys.lisp | lisp | (in-package #:lispkit-test)
(plan 6)
(let ((keymap (lispkit::make-keymap)))
(is-type keymap 'lispkit::keymap)
(is-type (lispkit::bindings keymap) 'hash-table))
(let ((keybind (lispkit::keymap->keydesc* nil "foo" nil)))
(is-type keybind 'lispkit::keybind)
(is "foo" (lispkit::key keybind)))
(is "foo foo"
... | |
486e3aafbc636b5de234ead3c748e25dde397892b05cb76aee01a33195bbdfd5 | silkapp/rest | Build.hs | # LANGUAGE
CPP
, FlexibleInstances
, TypeSynonymInstances
, UndecidableInstances
#
CPP
, FlexibleInstances
, TypeSynonymInstances
, UndecidableInstances
#-}
#if !MIN_VERSION_base(4,8,0)
# LANGUAGE OverlappingInstances #
#endif
module Code.Build where
import Data.List
-- | Representat... | null | https://raw.githubusercontent.com/silkapp/rest/f0462fc36709407f236f57064d8e37c77bdf8a79/code-builder/src/Code/Build.hs | haskell | | Representation of code, each string represents a line
| Type class for lifting data structures into code
# OVERLAPPING #
# OVERLAPPABLE #
# OVERLAPPABLE #
# OVERLAPPING #
* Functions on code
* Combinators for building blocks of code
| Left outer-join
| Right outer-join
| Same as <++> but with space | # LANGUAGE
CPP
, FlexibleInstances
, TypeSynonymInstances
, UndecidableInstances
#
CPP
, FlexibleInstances
, TypeSynonymInstances
, UndecidableInstances
#-}
#if !MIN_VERSION_base(4,8,0)
# LANGUAGE OverlappingInstances #
#endif
module Code.Build where
import Data.List
newtype Code = C... |
7190b320115e2f8df2ea1925e21f497ab8b8d535615700ba9ecdb3213597e055 | remvee/markov | markov_chain_test.clj | (ns remworks.markov-chain-test
(:require [clojure.data.generators :as gen]
[clojure.string :as s]
[clojure.test :refer [deftest is testing]]
[remworks.markov-chain :as sut]))
(def sample-size 100)
(deftest analyse
(testing "one step lookback"
(is (= {:space {[] {1 1
... | null | https://raw.githubusercontent.com/remvee/markov/e1e86b70b40253545e6b18c05f89392e1c318c67/test/remworks/markov_chain_test.clj | clojure | (ns remworks.markov-chain-test
(:require [clojure.data.generators :as gen]
[clojure.string :as s]
[clojure.test :refer [deftest is testing]]
[remworks.markov-chain :as sut]))
(def sample-size 100)
(deftest analyse
(testing "one step lookback"
(is (= {:space {[] {1 1
... | |
914789eb0197a1bed90bcb10410368351c90234e3a871741c6d8bd7a74efa3dc | chrisdone/jl | Interpreter.hs | {-# LANGUAGE GADTs #-}
# LANGUAGE ScopedTypeVariables #
{-# LANGUAGE OverloadedStrings #-}
# LANGUAGE LambdaCase #
# LANGUAGE FlexibleContexts #
-- |
module JL.Interpreter where
import qualified Data.Text as T
import JL.Printer
import JL.Types
-- | Eval core.
eval :: Core -> Core
eval (Applicati... | null | https://raw.githubusercontent.com/chrisdone/jl/f4405aaf43add3b574d7d138a3e383607fe786a0/src/JL/Interpreter.hs | haskell | # LANGUAGE GADTs #
# LANGUAGE OverloadedStrings #
|
| Eval core.
| Substitute name in function body.
| Remove syntactic sugar and convert into executable form. | # LANGUAGE ScopedTypeVariables #
# LANGUAGE LambdaCase #
# LANGUAGE FlexibleContexts #
module JL.Interpreter where
import qualified Data.Text as T
import JL.Printer
import JL.Types
eval :: Core -> Core
eval (ApplicationCore op arg) =
case eval op of
LambdaCore param expr ->
case eval... |
e076800746c64589f362acc244d8a77b2f8066d4601eff7fc4372f150cbf9aa9 | dalaing/little-languages | Eval.hs | module Test.Term.Eval where
import Test.Tasty
import Test.Tasty.QuickCheck
import Data.Maybe (mapMaybe)
import Term.Gen
import Term
import Term.Eval.Value
import Term.Eval.SmallStep
import Term.Eval.BigStep
evalTests :: TestTree
evalTests =
testGroup "eval" [
testProperty "smallUnique" propSmallUnique
,... | null | https://raw.githubusercontent.com/dalaing/little-languages/9f089f646a5344b8f7178700455a36a755d29b1f/code/old/unityped/i/tests/Test/Term/Eval.hs | haskell | module Test.Term.Eval where
import Test.Tasty
import Test.Tasty.QuickCheck
import Data.Maybe (mapMaybe)
import Term.Gen
import Term
import Term.Eval.Value
import Term.Eval.SmallStep
import Term.Eval.BigStep
evalTests :: TestTree
evalTests =
testGroup "eval" [
testProperty "smallUnique" propSmallUnique
,... | |
89034c095085f64558901e379200d90eb47bb34297c9284888d97cc0f6e41953 | EduardoRFS/f-omega | typer.ml | open Ltree
open Ttree
exception Unbound_var of { name : name }
exception Variable_is_value of { name : name }
exception Variable_is_type of { name : name }
exception Variable_is_kind of { name : name }
exception Var_clash
exception Kind_clash of { received : kind; expected : kind }
exception Type_clash of { received :... | null | https://raw.githubusercontent.com/EduardoRFS/f-omega/a694d3a18e3324f107f4c98f87402eb01b22e2d1/src/typer.ml | ocaml | TODO: this is really bad
kind
typ_
expr
TODO: this behaviour is not ideal
TODO: this behaviour is not ideal
TODO: this behaviour is not ideal
TODO: this is not ideal if aliasing is considered
it will expand when not needed, probably head expansion | open Ltree
open Ttree
exception Unbound_var of { name : name }
exception Variable_is_value of { name : name }
exception Variable_is_type of { name : name }
exception Variable_is_kind of { name : name }
exception Var_clash
exception Kind_clash of { received : kind; expected : kind }
exception Type_clash of { received :... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.